code wiki / (root) / nx_caplab_finance_test.nx

nx_caplab_finance_test.nx

buildroot/runtime/nx_caplab_finance_test.nx

3654 B79 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic caplab
docsdependenciesstructsconstsfunctions

about

nx_caplab_finance_test.nx -- gate for Capitalism Lab R7 (finances). Proves: (1) net worth = cash - debt, (2) a loan within the credit limit adds liquidity, (3) a loan over the limit is denied, (4) a loan does NOT change net worth (liquidity != wealth), (5) interest draws down cash, (6) repay reduces both cash and debt, (7) bankruptcy is detected when underwater beyond credit, (8) over-leverage drives a firm bankrupt as interest compounds the hole.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_caplab_finance.nx nx_caplab_finance_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_caplab_finance.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap println sys_write strlen sys_mmap ↻ nx_assert_eq print sys_write ↻ strlen ↻ print_i64 sys_mmap ↻ itoa sys_mmap ↻ sys_write ↻ println ↻ nx_clab_fin_networth mk2 sys_mmap ↻ nx_clab_fin_loan nx_clab_fin_interest nx_clab_fin_repay nx_clab_fin_bankrupt nx_clab_fin_networth ↻ print ↻ print_i64 ↻

structs

none

consts

none

functions

14func nx_assert_eq(label: *u8, got: nx_int, want: nx_int, pass_n: *nx_int, fail_n: *nx_int)
called by 1: main calls 3: printprint_i64println
20func mk2(a: nx_int, b: nx_int) -> *i64
called by 1: main calls 1: sys_mmap
27func main() -> nx_exit