nx_saturation.nx
buildroot/runtime/nx_saturation.nx
about
nx_saturation.nx -- given-clause saturation loop with factoring.
Per user 2026-05-14 "keep going till we can submit to casc". This
is the proof-search engine on top of unify + resolution. Given a
set of clauses (typically the negation of a conjecture), iterate
resolution + factoring until either:
- the empty clause is derived -> UNSAT (proof of original conjecture)
- no new clauses can be derived -> UNKNOWN / SAT
- resource budget exhausted -> TIMEOUT
Discovery-Otter-Vampire-E-SPASS use this same skeleton; their
performance differences come from clause selection heuristic +
indexing + subsumption.
dependencies 10 imports · 15 importers
diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_result.nxnx_unify.nxnx_resolution.nxnx_subsumption.nxnx_tautology.nxnx_disctree.nxnx_paramodulation.nx
imported by: nx_avatar_solve_test.nxnx_backward_subsume_test.nxnx_casc_bench.nxnx_casc_runner_test.nxnx_clause_weight_test.nxnx_discount_test.nxnx_fof_cnf_test.nxnx_fof_tseitin_test.nxnx_indexed_subsume_test.nxnx_saturation_test.nxnx_solve.nxnx_solve_test.nxnx_tptp_formula_test.nxnx_tptp_load_test.nxnx_tptp_write_test.nx
structs
| 83 | struct Saturation |
consts
| 31 | const NX_MAGIC_9223372036854775807: i64 = 9223372036854775807 |
| 80 | const NX_SAT_MAX_PROCESSED: nx_int = 256 |
| 81 | const NX_SAT_MAX_UNPROCESSED: nx_int = 1024 |
| 104 | const NX_SAT_BYTES: nx_int = 72 |
| 170 | const NX_SAT_VERDICT_UNSAT: nx_int = 2 |
| 171 | const NX_SAT_VERDICT_UNKNOWN: nx_int = 5 |
functions
| 39 | func nx_factor(c: *Clause, i: nx_int, j: nx_int, c_out: *Clause) -> *NxResult called by 1: main calls 8: nx_result_errnx_clause_lit_atnx_subst_newnx_unifynx_result_is_errnx_lit_apply_subst+2 |
| 106 | func nx_saturation_new(initial_budget: nx_int) -> *Saturation |
| 125 | func nx_sat_proc_subsumes_indexed(s: *Saturation, c: *Clause) -> nx_int; |
| 128 | func nx_sat_rebuild_index(s: *Saturation); |
| 131 | func nx_sat_unproc_at(s: *Saturation, i: nx_int) -> *Clause |
| 135 | func nx_sat_proc_at(s: *Saturation, i: nx_int) -> *Clause |
| 140 | func nx_sat_add_unproc(s: *Saturation, c: *Clause) -> *NxResult called by 18: mainmainmk_p1mk_p2mk_p3run_problem+12 calls 3: nx_result_errnx_sat_unproc_atnx_result_ok |
| 150 | func nx_sat_pick_given(s: *Saturation) -> *Clause |
| 158 | func nx_sat_move_to_processed(s: *Saturation, given: *Clause) -> *NxResult |
| 173 | func nx_sat_try_resolve_pair(s: *Saturation, given: *Clause, other: *Clause) -> nx_int called by 1: nx_sat_run calls 5: nx_clause_newnx_resolvenx_result_is_oknx_clause_is_emptynx_sat_add_unproc |
| 192 | func nx_sat_run(s: *Saturation) -> nx_int |
| 240 | func nx_sat_proc_subsumes(s: *Saturation, c: *Clause) -> nx_int |
| 255 | func nx_sat_clause_dedup(c: *Clause) -> *Clause called by 1: nx_sat_add_unproc_filtered calls 4: nx_clause_newnx_clause_lit_atnx_term_eqnx_clause_add |
| 288 | func nx_sat_add_unproc_filtered(s: *Saturation, c: *Clause, eq_sym: nx_int) -> nx_int |
| 302 | func nx_sat_try_paramodulate_pair_filtered(s: *Saturation, eq_clause: *Clause, |
| 336 | func nx_sat_try_resolve_pair_filtered(s: *Saturation, given: *Clause, |
| 367 | func nx_sat_backward_subsume(s: *Saturation, newest: *Clause) -> nx_int called by 3: mainnx_sat_run_discount_lrsnx_sat_run_discount calls 3: nx_sat_proc_atnx_subsumesnx_dt_delete_value |
| 400 | func nx_sat_index_clause(s: *Saturation, clause_idx: nx_int) |
| 423 | func nx_sat_proc_subsumes_indexed(s: *Saturation, c: *Clause) -> nx_int called by 2: comparemain calls 5: sys_mmapnx_clause_lit_atnx_dt_find_generalizationsnx_sat_proc_atnx_subsumes |
| 460 | func nx_clause_weight_term(t: *Term) -> nx_int |
| 472 | func nx_clause_weight(c: *Clause) -> nx_int |
| 489 | func nx_sat_pick_given_best_first(s: *Saturation) -> *Clause |
| 508 | func nx_sat_pick_given_oldest_unpicked(s: *Saturation) -> *Clause |
| 532 | func nx_sat_pick_given_lrs(s: *Saturation, counter: nx_int, ratio: nx_int) -> *Clause called by 1: nx_sat_run_discount_lrs calls 2: nx_sat_pick_given_oldest_unpickednx_sat_pick_given_best_first |
| 541 | func nx_sat_run_discount_lrs(s: *Saturation, eq_sym: nx_int, ratio: nx_int) -> nx_int |
| 589 | func nx_sat_rebuild_index(s: *Saturation) |
| 609 | func nx_sat_run_discount(s: *Saturation, eq_sym: nx_int) -> nx_int |