nx_caplab_market_test.nx
buildroot/runtime/nx_caplab_market_test.nx
about
nx_caplab_market_test.nx -- gate for Capitalism Lab R0 (the market atom).
Proves, bit-exact: (1) the linear demand curve, (2) revenue/profit,
(3) NEG-CONTROL that pricing below cost loses money, (4) NEG-CONTROL
that no units sell past the choke price, (5) the optimal-pricing solver
finds the TRUE monopoly peak (matches the closed form AND is a strict
local max, not an endpoint artifact).
Market under test: a=100 (max demand), b=2 (slope), unit_cost=10.
Closed-form monopoly price p* = (a + b*c)/(2b) = 120/4 = 30, profit 800.
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.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
structs
| none |
consts
| none |
functions
| 17 | func nx_assert_eq(label: *u8, got: nx_int, want: nx_int, pass_n: *nx_int, fail_n: *nx_int) |
| 29 | func nx_assert_gt(label: *u8, got: nx_int, floor: nx_int, pass_n: *nx_int, fail_n: *nx_int) |
| 40 | func main() -> nx_exit |