code wiki / (root) / nx_eq_factor.nx

nx_eq_factor.nx

buildroot/runtime/nx_eq_factor.nx

4859 B111 linesdepth 6pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_eq_factor.nx -- equality factoring (Bachmair-Ganzinger 1994). Per Vampire-displacement roadmap Phase 2. Standard inference rule in superposition calculus, paired with paramodulation. Required for completeness when an equational saturation fires. Standard formulation: C ∨ s ≃ t ∨ s' ≃ t' (two positive equality literals) σ = mgu(s, s') -------------------------- (C ∨ s ≃ t ∨ t ≄ t')σ Reading: when two equality literals share a unifiable LHS, ONE of them (here s ≃ t) is kept and the OTHER's RHS is asserted DIFFERENT from the kept RHS (t ≄ t'). Future inference may resolve t≄t' against an equality elsewhere; if t and t' really were equal the resolvent is contradicted, otherwise the disequality survives. Ordering side conditions for full Bachmair-Ganzinger soundness are the caller's responsibility (typically checked via KBO/LPO): - s ≃ t is selected or maximal in C - sσ ⊁ tσ - (s ≃ t)σ ⊁ (s' ≃ t')σ API: caller picks the two equality-literal indices i and j; the primitive validates polarity + equality head, unifies the LHS pair, and emits the residual.

dependencies 6 imports · 1 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_result.nx nx_unify.nx nx_resolution.nx nx_eq_factor.nx nx_eq_factor_test.nx

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

imported by: nx_eq_factor_test.nx

structs

none

consts

none

functions

45func nx_eq_factor_make_diseq(t1: *Term, t2: *Term, eq_sym: nx_int) -> *Literal
61func nx_eq_factor(c: *Clause, i: nx_int, j: nx_int,