Automated resolution-based proof search via stellar resolution and bidirectional unification
Category: Formal Verification - Automated Theorem Proving
Status: Production Ready (21 verified test cases)
Dependencies: theorem-prover-orchestration
Stellogen is a resolution-based prover using stellar resolution - bidirectional proof search with:
21 test files covering automata, linear logic, Prolog, unification, and boolean logic.
Positive Rays (Axioms) Negative Rays (Goals)
↓ ↓
⊕ types ⊖ goals
⊕ rules ⊖ subgoals
↓ ↓
└─────── Interaction ────────────────┘
(Cut Elimination)
↓
Color-matched proofs
(GF(3) conserved)
A proof is a sequence of color-matched interactions between positive and negative rays:
test/syntax/definitions.sg - Type & rule definitionstest/syntax/blocks.sg - Logical blockstest/syntax/empty.sg - Minimal programstest/behavior/automata.sg - Finite automata proofstest/behavior/linear.sg - Linear logic reasoningtest/behavior/prolog.sg - Prolog-style unificationtest/behavior/galaxy.sg - Complex search spacesexercises/00-unification.sg - Basic unificationexercises/01-paths.sg - Path findingexercises/02-registers.sg - State machine registersexercises/04-boolean.sg - Boolean satisfiabilityexercises/solutions/ - Reference solutionsexamples/npda.sg - Non-deterministic pushdown automataexamples/*.sg - Domain-specific proof patternsrequire 'stellogen'
# Define proof goal
proof_goal = {
antecedent: [:A, :B], # What we have
consequent: [:C] # What we want
}
# Search for proof
prover = Stellogen::Prover.new
result = prover.search(proof_goal, timeout: 5.0)
if result.success?
puts "Proof found!"
puts result.proof_trace
else
puts "No proof in timeout"
end
# Example from exercises/00-unification.sg
unifier = Stellogen::Unifier.new
term1 = Stellogen::Term.parse("f(X, Y)")
term2 = Stellogen::Term.parse("f(a, g(b))")
if unifier.unify(term1, term2)
puts "Unification succeeded"
puts "Substitution: #{unifier.substitution}"
# => {X => :a, Y => g(:b)}
end
# From test/behavior/automata.sg
automata = Stellogen::Automata.new
# Define states & transitions
automata.add_state(:q0, initial: true)
automata.add_state(:q1)
automata.add_transition(:q0, 'a', :q1)
automata.add_transition(:q1, 'b', :q0)
# Verify acceptance
word = "abab"
if automata.accepts?(word)
puts "Word '#{word}' accepted"
puts "Proof trace: #{automata.proof_trace}"
end
Routing from theorem-prover-orchestration:
# Automatic detection of Stellogen-suitable proofs
search_proof("unification")
=> Routes to stellogen-proof-search/exercises/00-unification.sg
compile_proof("UnificationExample", :julia)
=> Extracts proof to Julia code
verify_equivalence([
("Dafny", "spi_galois.dfy"),
("Stellogen", "examples/unification.sg")
])
=> Cross-verifies proof correctness
| Category | Files | Focus | Status |
|---|---|---|---|
| Syntax | 3 | Parser correctness | ✓ |
| Behavior | 4 | Search algorithms | ✓ |
| Exercises | 6 | Pedagogical proofs | ✓ |
| Examples | 3+ | Domain applications | ✓ |
| Total | 21 | Automated search | ✓ |
Proofs maintain color invariant:
Σ(colors) ≡ 0 (mod 3)
This ensures:
Robinson's Algorithm with extensions:
stellogen-proof-search/
├── SKILL.md # This file
├── stellogen_runner.jl # Execution interface
├── proof_cache.jl # Memoization & caching
├── test_proofs/
│ ├── syntax/
│ │ ├── definitions.sg
│ │ ├── blocks.sg
│ │ └── empty.sg
│ ├── behavior/
│ │ ├── automata.sg
│ │ ├── linear.sg
│ │ ├── prolog.sg
│ │ └── galaxy.sg
│ ├── exercises/
│ │ ├── 00-unification.sg
│ │ ├── 01-paths.sg
│ │ ├── 02-registers.sg
│ │ ├── 04-boolean.sg
│ │ └── solutions/
│ └── examples/
│ └── npda.sg
└── examples/
├── basic_search.rb
├── automata_verification.rb
└── benchmark_search_time.rb
Encode 3-SAT clause as Stellogen goal:
# (x₁ ∨ ¬x₂ ∨ x₃) ∧ (¬x₁ ∨ x₂ ∨ ¬x₃)
clause1 => {
literals: [
{atom: :x1, polarity: :positive},
{atom: :x2, polarity: :negative},
{atom: :x3, polarity: :positive}
]
}
# Proof search finds satisfying assignment via unification
theorem-prover-orchestration - Master dispatcherthree-match - 3-SAT via non-backtracking geodesicsdafny-formal-verification - Low-level proofslean4-music-topos - High-level theoremsspi-parallel-verify - Parallelism verification# As part of plurigrid/asi
npx ai-agent-skills install plurigrid/asi --with-theorem-provers
# Standalone
npx ai-agent-skills install stellogen-proof-search
# Compile all .sg tests
stellogen compile test_proofs/*.sg
# Run specific test
stellogen run test_proofs/behavior/automata.sg
# Benchmark search performance
stellogen benchmark exercises/
# Generate proof trace with colors
stellogen trace --with-colors examples/npda.sg
# Verify GF(3) conservation
stellogen verify-gf3 test_proofs/