code wiki / (root) / nx_folkgame_sow_gate.nx

nx_folkgame_sow_gate.nx

buildroot/runtime/nx_folkgame_sow_gate.nx

7714 B159 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic folkgame
docsdependenciesstructsconstsfunctions

about

nx_folkgame_sow_gate.nx -- GATE for the sow (mancala) family of nx_folkgame_sow_lib. THE LOAD-BEARING TOOTH IS T8: seed conservation over an EXHAUSTIVE game tree. Sowing moves seeds and never creates or destroys one, so the total must equal perside*2*seeds at EVERY node of the tree, not at a sampled few. A sowing loop that is off by one anywhere -- a wrap that drops a seed, a capture that adds one, a relay that re-sows a pit it already emptied -- breaks it at some node, and no implementation can satisfy it across thousands of positions by accident. HONEST SCOPE, STATED PLAINLY: this is an INVARIANT, not a published constant. Unlike the align family's 255168 there is no cheap external number for these boards. Conservation proves the seeds are handled correctly; it does NOT prove the capture rules match Oware as played. The external anchor for that is OpenSpiel's Oware, graded THOROUGHLY-TESTED in its own table, and cross-checking against it is the named open rung. A green here means the arithmetic is sound and says nothing stronger. T9 CARRIES THE ANTI-VACUITY: the conservation checker is proven able to FAIL by planting a seed into a live position and asserting the total goes wrong. A checker that has only ever agreed has not been shown to check anything. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_folkgame_sow_lib.nx nx_gate_verdict.nx nx_folkgame_sow_gate.nx

imports: nx_folkgame_sow_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ fg_parse_named_file sys_mmap ↻ fg_read_spec sys_mmap ↻ ep_artifact_path sys_openat_rd sys_close ep_join fg_puts sys_write ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ fg_parse_named fg_parse_named_at fg_lineend

structs

none

consts

21const FGG_SPEC: *u8 = "knowledge/compare/folkgames.sow"
24const FGG_OWARE_CELLS: i64 = 12
25const FGG_OWARE_TOTAL: i64 = 48
26const FGG_OWARE_OPEN: i64 = 6
27const FGG_KALAH_CELLS: i64 = 14
28const FGG_CONGKAK_TOTAL: i64 = 98
29const FGG_PALLAN_TOTAL: i64 = 84
33const FGG_WALK_DEPTH: i64 = 6

functions

35func fgg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
38func fgg_walk(base: i64, snap: *i64, sw: i64, mvb: *i64, mm: i64, probe: *i64, d: i64, maxd: i64, bad: *i64) -> i64
57func fgg_open_moves(base: i64, probe: *i64) -> i64
called by 1: main calls 2: fg_maxmovesfgs_moves
65func main() -> i64