code wiki / (root) / nx_amort_gate.nx

nx_amort_gate.nx

buildroot/runtime/nx_amort_gate.nx

5089 B97 linesdepth 7pulls 13 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_amort_gate.nx -- LOAN AMORTIZATION GATE. Proves exact monthly interest, the level payment found by bisection (minimal payment that clears the loan), the final payment that absorbs the rounding, the CONSERVATION invariant (sum of principal reductions == principal, with and without interest), zero total interest at 0pct, monotonicity of balance in payment, and the fail-closed refusals. Zero-rate cases are hand-exact. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_amort_lib.nx nx_matter_lib.nx nx_amort_gate.nx

imports: nx_amort_lib.nxnx_matter_lib.nx

imported by: nobody (leaf or entry point)

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

main ag_puts ag_ck ag_puts ↻ ag_putn amort_monthly_interest amort_level_payment amort_monthly_interest ↻ amort_balance_after amort_balance_after ↻ amort_final_payment amort_level_payment ↻ amort_balance_after ↻ amort_principal_sum amort_level_payment ↻ amort_total_interest amort_level_payment ↻ amort_final_payment ↻ ag_putn ↻

structs

none

consts

none

functions

10func ag_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: ag_ckmain
11func ag_putn(v: i64) -> i64
called by 2: ag_ckmain
25func ag_ck(cnt: *i64, name: *u8, got: i64, want: i64) -> i64
called by 1: main calls 2: ag_putsag_putn
37func main(argc: i64, argv: *i64) -> i64