SNAPKITTYWEST · FORMAL SYSTEMS · LIQUID HASKELL HERITAGE

Calculus of Constrained Constructions — a sovereign alternative to SMT solvers and refinement type systems, built from first principles. Every term carries its constraints.

⟨t | C⟩ : τ iff Γ ⊢ t : τ and SAT(C) ⟨t | C⟩ ⟶ v iff C satisfiable and v = eval(t, model(C)) ¬SAT(C) iff ⟨t | C⟩ does not exist
View Source Proof Obligations Contribute

vs. Liquid Haskell · Z3 · Lean 4 · Dex

C³ unifies four systems that currently do not talk to each other.

CapabilityLiquid HaskellZ3/CVC5Lean 4Dex
Refinement types
SMT constraint solvingvia Z3built-in
Non-linear arithmetic (CAD)limitedpartialfull, from scratch
Automatic differentiation
Quantifier eliminationpartialfull QE via CAD
Proof extraction
Zero external solver depsN/A
Algebraic numbers (no CAS)✓ Thom encoding

Quantifier Elimination — live examples

Full QE over real closed fields. Virtual substitution for linear/quadratic. CAD for the general case. Every result carries a proof certificate.

// ∃x. x² + bx + c = 0  →  b² - 4c ≥ 0
val result = QEEngine().eliminate(QEProblem(
  quantifiers = List(Quantifier.Exists("x", 0)),
  matrix      = QFFormula.Atom(x2 + bx + c, Relation.Eq),
  freeVars    = List("b", "c"),
  nTotalVars  = 3
))
println(result.formula)  // b² - 4c ≥ 0

// ∃x. ∀y. x ≤ y  →  False  (no least real)
val result2 = QEEngine().eliminate(QEProblem(
  quantifiers = List(Quantifier.Exists("x", 0), Quantifier.Forall("y", 1)),
  matrix      = QFFormula.Atom(x - y, Relation.Le),
  freeVars    = Nil, nTotalVars = 2
))
println(result2.formula)  // False

// Extract and check proof certificate
val proof = ProofCertificateExtractor.extract(problem, result)
val check = ProofChecker.check(proof)
println(check.valid)      // true

Test suite

LINEAR (Virtual Substitution)
✓ ∃x. x > 0 ∧ x < 1 → True ✓ ∃x. x > a ∧ x < b → a < b ✓ ∀x. x² ≥ 0 → True
QUADRATIC
✓ ∃x. x² = 2 → True ✓ ∃x. x² + 1 = 0 → False ✓ ∃x. x² + bx + c = 0 → b² - 4c ≥ 0
MIXED QUANTIFIERS
✓ ∀x. ∃y. y > x → True ✓ ∃x. ∀y. x ≤ y → False
NEGATIVE TESTS
✓ ∃x. x² < 0 → False ✓ ∀x. x > 0 → False
PROOF CERTIFICATES
✓ Certificate extracted for ground problem
FORMULA SIMPLIFIER
✓ ¬(A ∧ B) = ¬A ∨ ¬B (De Morgan) ✓ True ∧ F = F ✓ False ∨ F = F
14 passed · 0 failed

Open proof obligations

All 15 open proof obligations are tracked in OBLIGATIONS.md. No obligation is hidden. No proof gap is silent.

OBL-001
Kernel Soundness
Logical relations over constraint-extended term model
OBL-004
CAD Projection Correctness
Collins (1975) + subresultant PRS theory
OBL-006
Thom Encoding Uniqueness
Rolle's theorem + sign variation
OBL-008
Virtual Substitution (Linear)
Weispfenning (1988)
OBL-010
Nelson-Oppen Combination
Nelson-Oppen (1979)
OBL-014
QE Completeness
Tarski (1951) + Collins (1975)