code wiki / (root) / nx_tptp_emit.nx

nx_tptp_emit.nx

buildroot/runtime/nx_tptp_emit.nx

8140 B206 linesdepth 6pulls 9 transitivereach 4 importersview sourcekind librarytopic tptp
docsdependenciesstructsconstsfunctions

about

nx_tptp_emit.nx -- TPTP CNF emitter. Per Vampire-displacement roadmap Phase 2. Closes the substrate's TPTP I/O loop: nx_tptp_load reads CNF files; this writes them back. Lets the substrate round-trip, normalize, archive, or share intermediate clause sets in a tool-interchange format. Emit functions append to a caller-provided buffer. Caller pre-allocates and tracks the cursor position. API: nx_emit_term(t, symtab, buf, *pos, cap) nx_emit_literal(l, symtab, eq_sym, buf, *pos, cap) nx_emit_clause_body(c, symtab, eq_sym, buf, *pos, cap) nx_emit_cnf_stmt(c, name, role, symtab, eq_sym, buf, *pos, cap) All return number of bytes written; -1 on capacity overflow.

dependencies 8 imports · 4 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_str.nx nx_result.nx nx_unify.nx nx_resolution.nx nx_tptp_symtab.nx nx_tptp_emit.nx nx_tptp_emit_test.nx nx_tptp_write_test.nx nx_tstp_emit.nx nx_tstp_emit_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_str.nxnx_result.nxnx_unify.nxnx_resolution.nxnx_tptp_symtab.nx

imported by: nx_tptp_emit_test.nxnx_tptp_write_test.nxnx_tstp_emit.nxnx_tstp_emit_test.nx

structs

none

consts

157const NX_TPTP_WRITE_BUF_CAP: nx_int = 32768

functions

35func nx_emit_term(t: *Term, symtab: *TptpSymtab, buf: *u8, pos: *nx_int, cap: nx_int) -> nx_int;
38func nx_emit_byte(b: nx_int, buf: *u8, pos: *nx_int, cap: nx_int) -> nx_int
46func nx_emit_str(s: *u8, buf: *u8, pos: *nx_int, cap: nx_int) -> nx_int
56func nx_emit_term(t: *Term, symtab: *TptpSymtab, buf: *u8, pos: *nx_int, cap: nx_int) -> nx_int
82func nx_emit_literal(l: *Literal, symtab: *TptpSymtab, eq_sym: nx_int,
112func nx_emit_clause_body(c: *Clause, symtab: *TptpSymtab, eq_sym: nx_int,
133func nx_emit_cnf_stmt(c: *Clause, name: *u8, role: *u8,
159func nx_int_to_decimal(n: nx_int, out: *u8) -> nx_int
called by 1: nx_tptp_write_cnf_file calls 1: sys_mmap
178func nx_tptp_write_cnf_file(path: *u8, clauses: *Clause, n: nx_int,