code wiki / (root) / nx_question_genealogy.nx

nx_question_genealogy.nx

buildroot/runtime/nx_question_genealogy.nx

10936 B290 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_question_genealogy.nx -- the why-chain primitive. Records the chain of refinement questions that motivate each theorem / primitive. Per QUESTION_GENEALOGY_DOCTRINE: a newcomer's "why does this matter?" question resolves CONTINUOUSLY from the layperson root question to the niche specialization, with each node citing the theorem that answered it and the new sub-question it opened. Data structure: a forest of question-trees (DAG, but for now modeled as parent-pointer tree; one node may be referenced from multiple children but only one parent is tracked here). genealogy_id: feynman_motivational_explanation + popper_problem_situations + dewey_inquiry_pragmatism lineage_id: pedagogical_scaffolding + question_tree axioms: NX_AX_LOGIC_IDENTITY (a question's identity = its phrasing)

dependencies 2 imports · 3 importers

syscalls.nx nx_axioms.nx nx_question_genealogy.nx nx_help.nx nx_help_test.nx nx_question_genealogy_test.nx

imports: syscalls.nxnx_axioms.nx

imported by: nx_help.nxnx_help_test.nxnx_question_genealogy_test.nx

structs

37struct QuestionNode
50struct QuestionTree

consts

30const NX_QG_TIER_ROOT: i64 = 0 // layperson original question
31const NX_QG_TIER_REFINEMENT: i64 = 1 // refinement chain
32const NX_QG_TIER_NICHE: i64 = 2 // niche specialization
33const NX_QG_TIER_OPEN_RESEARCH: i64 = 3 // unanswered frontier
48const NX_QG_NODE_BYTES: i64 = 64
56const NX_QG_MAX_NODES: i64 = 4096

functions

58func nx_qg_tree_alloc() -> *QuestionTree
called by 2: mainmain
67func nx_qg_node_at(t: *QuestionTree, i: i64) -> *QuestionNode
72func nx_qg_add_root(t: *QuestionTree, text: *u8) -> i64
called by 1: nx_qg_seed_corpus calls 1: nx_qg_node_at
89func nx_qg_add_refinement(t: *QuestionTree, parent_id: i64, tier: i64,
called by 1: nx_qg_seed_corpus calls 1: nx_qg_node_at
114func nx_qg_trace_from_root(t: *QuestionTree, target: i64,
140func nx_qg_count_by_tier(t: *QuestionTree, tier: i64) -> i64
called by 1: main calls 1: nx_qg_node_at
152func qg_putc(fd: i64, c: i64) -> i64
called by 1: qg_i64
159func qg_str(fd: i64, s: *u8, n: i64) -> i64
164func qg_strz(fd: i64, s: *u8) -> i64
171func qg_i64(fd: i64, n: i64) -> i64
195func nx_qg_emit_narrative(fd: i64, t: *QuestionTree, target: i64) -> i64
224func nx_qg_seed_corpus(t: *QuestionTree) -> i64