code wiki / (root) / nx_hol_ingest.nx

nx_hol_ingest.nx

buildroot/runtime/nx_hol_ingest.nx

7356 B215 linesdepth 5pulls 6 transitivereach 6 importersview sourcekind librarytopic hol
docsdependenciesstructsconstsfunctions

about

nx_hol_ingest.nx -- HOL Light statement-level ingester (H0). HOL Light uses OCaml-embedded syntax: let NAME = prove (`<term>`, <tactic_script>);; let NAME = define `<recursive>`;; let NAME = new_axiom `<axiom>`;; let NAME = REWRITE_RULE [...] <theorem>;; (* OCaml comment *) We recognize the "let NAME = prove" pattern as the primary theorem declaration form, and "let NAME = new_axiom" for axioms. genealogy_id: harrison_hol_light_1996 lineage_id: higher_order_logic + statement_parsing

dependencies 4 imports · 6 importers

nx_syscalls.nx nx_axioms.nx nx_lex.nx nx_ascii.nx nx_hol_ingest.nx nx_corpus_drive.nx nx_five_systems_test.nx nx_hol_dir_ingest.nx nx_hol_ingest_test.nx nx_hol_stream_ingest.nx nx_hol_stream_ingest_test.nx

imports: nx_syscalls.nxnx_axioms.nxnx_lex.nxnx_ascii.nx

imported by: nx_corpus_drive.nxnx_five_systems_test.nxnx_hol_dir_ingest.nxnx_hol_ingest_test.nxnx_hol_stream_ingest.nxnx_hol_stream_ingest_test.nx

structs

39struct HolDecl
46struct HolDb

consts

27const NX_HOL_TOK_NONE: i64 = 0
28const NX_HOL_TOK_LET: i64 = 1
29const NX_HOL_TOK_PROVE: i64 = 2
30const NX_HOL_TOK_AXIOM: i64 = 3 // new_axiom
31const NX_HOL_TOK_DEFINE: i64 = 4
32const NX_HOL_TOK_IDENT: i64 = 5
33const NX_HOL_TOK_EQUALS: i64 = 6
34const NX_HOL_TOK_SEMICOLON: i64 = 7
36const NX_HOL_MAX_NAME_LEN: i64 = 256
37const NX_HOL_MAX_DECLS: i64 = 65536
44const NX_HOL_DECL_BYTES: i64 = 16

functions

52func nx_hol_db_alloc() -> *HolDb
called by 1: nx_hol_ingest_corpus calls 1: sys_mmap
61func nx_hol_decl_at(db: *HolDb, i: i64) -> *HolDecl
72func nx_hol_skip_ws(buf: *u8, pos: *i64, len: i64) -> i64
called by 1: nx_hol_next_token calls 1: nx_lex_is_ws
111func nx_hol_next_token(buf: *u8, pos: *i64, len: i64, out_label: *u8) -> i64
150func nx_hol_record_decl(db: *HolDb, kind: i64, label: *u8) -> i64
167func nx_hol_ingest_corpus(buf: *u8, len: i64) -> *HolDb
206func nx_hol_count_kind(db: *HolDb, kind: i64) -> i64
called by 2: mainmain calls 1: nx_hol_decl_at