code wiki / (root) / nx_answer.nx

nx_answer.nx

buildroot/runtime/nx_answer.nx

3420 B88 linesdepth 6pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_answer.nx -- AnswerLiteral support for "find a witness" queries. Per Vampire-displacement roadmap Phase 2. When a conjecture has the shape ∃X. p(X) and we want to know WHICH X works (not just that some X exists), we attach a special $answer(X) literal to the negated conjecture clause. Saturation tracks the answer literal through every inference; when the proof closes (empty-clause-modulo- answer), the surviving $answer(witness) literal carries the X instantiation that closed the proof. Convention: the answer predicate symbol id is caller-supplied (no magic constant, same shape as eq_sym in nx_tautology / nx_tptp_load). Recommended: NX_ANS_BASE (700_000) -- distinct from user (1_000+), Tseitin (800_000+), Skolem (900_000+). API: nx_answer_attach(c, ans_sym, witness_var_id) -- adds $answer(X) literal nx_clause_is_answer_only(c, ans_sym) -- 1 iff c only has $answer(...) nx_clause_extract_answer(c, ans_sym) -- returns the witness term, null if none

dependencies 6 imports · 1 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_result.nx nx_unify.nx nx_resolution.nx nx_answer.nx nx_answer_test.nx

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

imported by: nx_answer_test.nx

structs

none

consts

34const NX_ANS_BASE: nx_int = 700000

functions

38func nx_answer_lit(ans_sym: nx_int, witness_var_id: nx_int) -> *Literal
50func nx_answer_attach(c: *Clause, ans_sym: nx_int, witness_var_id: nx_int) -> *NxResult
called by 1: main calls 2: nx_clause_addnx_answer_lit
57func nx_clause_is_answer_only(c: *Clause, ans_sym: nx_int) -> nx_int
called by 1: main calls 1: nx_clause_lit_at
72func nx_clause_extract_answer(c: *Clause, ans_sym: nx_int) -> *Term
called by 1: main calls 2: nx_clause_lit_atnx_term_arg