r/formalmethods • • 2d ago

7-state propagation + sparse $\mathbb{F}_7$ Exact-1 pre-processing for conflict auditing and causal traces

I put together a small, zero-dependency Python prototype (f7_auditor.py) and a short write-up (seven_valued_relational_logic_over_f7_v9.md) exploring a hybrid pre-processing pass for Boolean rule/feature configs and DIMACS .cnf instances ahead of CDCL:

What It Actually Is (and Isn't)

  • Not a general SAT solver or an $\mathbb{F}_2$ XOR replacement: On pure binary XOR chains or standard CDCL/inequality-heavy problems (e.g., standard PHP(5,4) or graph 3-coloring), $\mathbb{F}_2$ elimination / CDCL is the right tool. The framework sits squarely inside standard algebraic/Nullstellensatz/PC boundaries.
  • What it targets: Small-to-medium Exact-1 cardinality constraints ($2 \le m \le 6$) and gated parity loops in configuration/feature models or structured CNF where modulo-2 wrap-around hides cardinality collisions or where engineers need human-readable causal conflict traces.

How the 5-Stage Pipeline Works

  1. Local 7-State Propagation & Clause Shrinking: Tracks 3-bit epistemic signatures (t, f, u) (Pure Unknown, Plausible, Contradictory, etc.), strips falsified literals while keeping causal dependencies, and emits plain-English traces on State 5 (t=1, f=1) clashes.
  2. Iterative Leaf Quarantine (2-Core Peeling): Peels degree-1 variables so hanging branches don't pollute the algebraic core.
  3. Automatic Exact-1 Lifting & Gated Pair Extraction: Lifts Exact-1 cliques ($2 \le m \le 6$) into $\mathbb{F}_7$ (where $0 \le \sum T_{L_i} \le 6 < 7$, avoiding mod-2 wrap-around) and extracts bounded-gate complementary parity pairs ($\vert{}G\vert{} \le k_{\max}$) via variable-set bucketing.
  4. Sparse $\mathbb{F}_7$ RREF + Boolean/Residual Checks: Runs sparse row-dictionary Gaussian elimination modulo 7, checks $B(T_v) = T_v(T_v - 1) \pmod 7$ for non-Boolean fixed points, and checks a coupled residual $Q(a, e) \pmod 7$ on 0/1 bridge variables.
  5. Factored Disjunctive Backbone Extraction: Substitutes RREF solutions into gated equations (filtering tautologies) and feeds forced backbones back into Stage 1.

Quick Benchmarks

  • 100-config synthetic benchmark (auto-lifted raw CNF, ~42–45 ms total): 30/30 vs. 0/30 on exact1_unsat masked-bridge instances, 35/35 on gated backbones, 20/20 on odd cycles, 0/15 false positives on SAT controls.
  • Bijective PHP(6,4) (Exact-1 on both sides): Caught as UNSAT_LINEAR in ~3.5 ms ($6 \not\equiv 4 \pmod 7$), whereas $\mathbb{F}_2$ misses it ($6 \equiv 4 \pmod 2$).
  • FeatureIDE-style 120-feature model: Lifts 66 Exact-1 cliques in ~8.9 ms (SAT) and catches injected cross-tree clashes as UNSAT_STATE5 in ~1.4 ms.

Questions for This Community

  1. In real-world feature models or configuration verification benchmarks you work with, how often do Exact-1 / cardinality collisions or gated parity cycles show up as a bottleneck rather than general CDCL/pseudo-Boolean constraints?
  2. Are there any obvious soundness or edge-case traps in lifting Exact-1 cliques ($m \le 6$) to $\mathbb{F}_7$ and feeding extracted backbones/residuals back into unit propagation that I should stress-test next?
1 Upvotes

1 comment sorted by

1

u/CorrSurfer Mod 2d ago

Just to let you know: The majority of readers here will not know what "7-State Propagation", "Iterative Leaf Quarantine (2-Core Peeling)", "Algebraic Core", "Exact-1 Lifting", and "Gated Pair Extraction" are. And as a user of LLMs (like everyone else), I notice that these look fairly close to the terms that they come up with when asking them for finding better ways of solving certain problems.

Having said this, are there any practical problems in which the types of CNF formulas that you target come up naturally?

For soundness issues, most likely you will not find any reader here doing a deep dive into what you did. But you may ask an LLM to formalize your approach in Lean and prove it for correctness. Then you only have to check that the claim is right and you've got an answer.