code wiki / (root) / nx_depparse_gate.nx

nx_depparse_gate.nx

buildroot/runtime/nx_depparse_gate.nx

10390 B141 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_depparse_gate.nx -- GATE for the dependency parser (nx_depparse), driven IN-PROCESS on a planted CoNLL-U mini-treebank under /tmp/nx_depparse_gate. Proves: the shared reader's HEAD and DEPREL columns (root head 0, a subtype's base name kept), the label table (first-seen interning, unknown reads -1), that the parser LEARNS (a train of one grammar is parsed perfectly at test, UAS and LAS 1000), converges, is deterministic, SKIPS a planted non-projective sentence and counts it, parses an arbitrary tagged token stream through dp_parse_stream with the same answers, and that an untrained parser is not a learned one (its right-branching chain scores far below). Every fixture asserts its own condition first. No network. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_reviewmine_lib.nx nx_postag.nx nx_depparse.nx nx_gate_verdict.nx nx_depparse_gate.nx

imports: nx_syscalls.nxnx_gatekit_lib.nxnx_reviewmine_lib.nxnx_postag.nxnx_depparse.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_head gv_puts sys_write 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 ↻ gk_mkdir sys_mkdir gk_write sys_openat_wr gk_len gk_write_all sys_write ↻ sys_close gv_check gv_puts ↻ gk_exists sys_openat_rd sys_close ↻ pt_reset sys_mmap ↻ sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻

structs

none

consts

15const G_ROOT: *u8 = "/tmp/nx_depparse_gate"
16const G_TRAIN: *u8 = "/tmp/nx_depparse_gate/train.conllu"
17const G_TEST: *u8 = "/tmp/nx_depparse_gate/test.conllu"
18const G_SUBTYPE: *u8 = "/tmp/nx_depparse_gate/subtype.conllu"
19const G_I64: i64 = 8
22const G_TRAIN_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tdog\tdog\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t2\tdet\t_\t_\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\t.\t.\tPUNCT\t.\t_\t3\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t3\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tThe\tthe\tDET\tDT\t_\t2\tdet\t_\t_\n2\tcat\tcat\tNOUN\tNN\t_\t3\tnsubj\t_\t_\n3\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n\n1\tw1\tw1\tNOUN\tNN\t_\t3\tobl\t_\t_\n2\tw2\tw2\tNOUN\tNN\t_\t4\tobl\t_\t_\n3\tw3\tw3\tVERB\tVBZ\t_\t0\troot\t_\t_\n4\tw4\tw4\tVERB\tVBZ\t_\t3\tconj\t_\t_\n"
23const G_TRAIN_SENTS: i64 = 6
24const G_TRAIN_TOKS: i64 = 26 // 4+4+5+5+3+5? no: 4+4+5+5+3+4 = 25 tokens plus the reader counts the range-free rows only
25const G_NONPROJ: i64 = 1
26const G_NREL: i64 = 7 // det nsubj root punct amod obl conj, in first-seen order
27const G_REL_ROOT: i64 = 2
28const G_TEST_ROWS: *u8 = "1\tThe\tthe\tDET\tDT\t_\t3\tdet\t_\t_\n2\tsmall\tsmall\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tdog\tdog\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\tsleeps\tsleep\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n\n1\tA\ta\tDET\tDT\t_\t3\tdet\t_\t_\n2\tbig\tbig\tADJ\tJJ\t_\t3\tamod\t_\t_\n3\tcat\tcat\tNOUN\tNN\t_\t4\tnsubj\t_\t_\n4\truns\trun\tVERB\tVBZ\t_\t0\troot\t_\t_\n5\t.\t.\tPUNCT\t.\t_\t4\tpunct\t_\t_\n"
29const G_TEST_TOKS: i64 = 10
30const G_TEST_SENTS: i64 = 2
32const G_SUBTYPE_ROWS: *u8 = "1\tits\tits\tPRON\tPRP$\t_\t2\tnmod:poss\t_\t_\n2\ttoy\ttoy\tNOUN\tNN\t_\t0\troot\t_\t_\n"
33const G_STREAM_TOKS: i64 = 3
34const G_UNTRAINED_MAX: i64 = 500

functions

36func main() -> i64