code wiki / (root) / nx_caplab_supply_test.nx

nx_caplab_supply_test.nx

buildroot/runtime/nx_caplab_supply_test.nx

3986 B102 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic caplab
docsdependenciesstructsconstsfunctions

about

nx_caplab_supply_test.nx -- gate for Capitalism Lab R2 (production/supply). Proves: (1) unit-cost rollup for 1 and 2 inputs, (2) multi-stage chain rollup (raw -> intermediate -> finished), (3) throughput from stock, (4) the bottleneck input caps throughput, (5) NEG-CONTROL: zero stock of any input -> 0 output, (6) INTEGRATION: a supply-derived unit cost feeds the R0 market profit, and pricier inputs earn less (no magic numbers).

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_caplab_supply.nx nx_caplab_market.nx nx_caplab_supply_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_caplab_supply.nxnx_caplab_market.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_clab_unit_cost nx_assert_eq print sys_write ↻ strlen ↻ print_i64 sys_mmap ↻ itoa sys_mmap ↻ sys_write ↻ println ↻ nx_clab_throughput nx_clab_profit nx_clab_demand nx_assert_gt print ↻ print_i64 ↻ println ↻ print ↻ print_i64 ↻

structs

none

consts

none

functions

15func 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
26func nx_assert_gt(label: *u8, got: nx_int, floor: nx_int, pass_n: *nx_int, fail_n: *nx_int)
called by 1: main calls 3: printprint_i64println
37func main() -> nx_exit