nx_pure_lit.nx
buildroot/runtime/nx_pure_lit.nx
about
nx_pure_lit.nx -- pure-literal elimination preprocessing.
A predicate symbol is "pure" if it appears with only one polarity
across the entire clause set. Clauses containing a pure literal
can be vacuously satisfied -- there's no clause that could ever
contradict them, so removing them preserves UNSAT-equivalence.
Standard SAT-solver preprocessing (Davis-Putnam 1960 lineage)
extended to first-order: the predicate symbol is the unit of
purity, not the literal. A clause containing ANY pure-positive
literal of pred p (or ANY pure-negative literal of pred p) is
dropped. Iterating to fixpoint can cascade: dropping clauses may
make other predicates become pure.
API: nx_pure_lit_eliminate(input, n_input, out, *out_n) -- one
pass. Caller iterates to fixpoint if desired.
Bits-up nx_int.
dependencies 6 imports · 1 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_result.nxnx_unify.nxnx_resolution.nx
imported by: nx_pure_lit_test.nx
structs
| none |
consts
| 33 | const NX_PURE_MAX_PREDS: nx_int = 1024 |
| 37 | const NX_PURE_POS_BIT: nx_int = 1 |
| 38 | const NX_PURE_NEG_BIT: nx_int = 2 |
functions
| 43 | func nx_pure_collect(clauses: *Clause, n: nx_int, polarities: *nx_int) |
| 71 | func nx_pure_clause_has_pure_lit(c: *Clause, polarities: *nx_int) -> nx_int |
| 97 | func nx_pure_lit_eliminate(input: *Clause, n_input: nx_int, |