Title: Encoding First Order Proofs in SAT
1Encoding First Order Proofs in SAT
- Todd Deshane, Wenjin Hu, Patty Jablonski, Hai
Lin, Christopher Lynch, and - Ralph Eric McGregor
- Clarkson University
2Introduction
- Novel Approach to First Order Logic Theorem
Proving - Method
- Encode proof of rigid unsatisfiability in SAT
- Use incrementally to solve general problem
- Proof in the Form of Rigid Connection Tableau
- Complete Sound
3Rigidly Unsatisfiable
- A formula F is rigidly unsatisfiable if there
exists a substitution s such that Fs is
unsatisfiable.
- R(x)
- R(y)
- R(a) ? R(b)
- Rigidly Unsatisfiable
- R(x)
- R(a) ? R(b)
- Not Rigidly Unsatisfiable
4Overview
- Preliminaries
- Closed Rigid Connection Tableaux
- Tableau Encodings Algorithms
- Rigid Horn Problems
- Rigid Non-Horn Problems
- General First Order Logic Algorithm
- An Implementation ChewTPTP
- Future Work
5Setting Definitions
- Classical First Order Logic
- View substitution as a set of equations
- An assignment is a single equation contained in a
substitution. - Standard definition of unifier
6Rigid Clausal Tableaux
- Rigid Clausal Tableaux are
- trees
- with all nodes (except the root node) labeled
with literals - with branches labeled with zero or more
assignments - with branches either open or closed
7Rigid Clausal Tableaux
- Defined inductively as follows
- For a set of clauses S
- Base Case A single unlabeled root node is a
rigid clausal tableau for S.
8Rigid Clausal Tableaux Expansion Rule
- Given rigid clausal tableau for S
- A leaf node on an open branch
- Some clause C in S
- Construct new rigid clausal tableau for S
- Expand leaf with literals in C
- Label each new branch as open
-
9Rigid Clausal Tableaux Closure Rule
- Given rigid clausal tableau for S
- A leaf node labeled L on an open branch
- An ancestor of the leaf labeled K
- s such that Ls Ks, and s is consistent with
other assignments - Construct new rigid clausal tableau for S
- Close branch
- Label branch with assignments of s
10Rigid Connection Tableau
- A rigid connection tableau is a
- rigid clausal tableau
- each clause (except the root clause) in the
tableau contains some literal which is unifiable
with the negation of its parent. - uses Extension Rule
11Closed Rigid Connection Tableaux
- A rigid connection tableau is closed if each
branch is closed.
12Negative Clause at Root
- A negative clause is a clause which contains only
negative literals. - Theorem If there exists a closed rigid
connection tableau for a set of clauses, S, then
there exists a closed rigid connection tableau
for S which has a negative clause off the root in
the tableau.
13Example
Figure 1
- R(a)
- Q(b) ? R(y)
- P(a) ? Q(x)
- P(w)
Figure 2
14Example Continued
- R(a)
- Q(b) ? R(y)
- P(a) ? Q(x)
- P(w)
Figure 3
Figure 4
15Proof for Rigid Unsatisfiability
- Theorem Let F be a first order logic formula.
There exists a closed rigid connection tableau
for F iff F is rigidly unsatisfiable.
16Our Goal
- To generate a propositional logic encoding G for
F such that G is propositionally satisfiable iff
G is an encoding of a rigid closed connection
tableau for F.
17Tableau Encoding
- Let F be a first order formula.
- We start by enumerating each clause in F and each
of the literals in each clause. - We denote clause i by Ci and the jth literal in
clause i by Lij.
- P(w)
- P(a) ? Q(x)
- Q(b) ? R(y)
- R(a)
- C1 L11
- C2 L21 ? L22
- C3 L31 ? L32
- C4 L41
18Defining Propositonal Variables For Horn Problems
- Define cm T iff Cm appears in the tableau.
- Define lmn T iff Lmn is a negative literal in
the tableau. - Define emnq T iff Cq is an extension of Lmn.
- Define ua T iff a is an assignment implied by
the substitutions used in the closure rules. - Define pmq T iff there exists a path from Cm to
Cq.
19Defining Propositional Clauses For Horn Problems
- 1. \/ ci , where ci is a negative clause
- 2. cm ? lmn , where lmn is a negative literal in
cm - 3. lmn (\/ emnq) , where Lmn is unifiable with
the postitive literal in Cq - 4. emnq ? cq
- 5. emnq ? ust , where s t is an assignment in
the unifier of Lmn and the positive literal in Cq
20Encoding For Horn Problems, continued
- 6. uxs ? uxt , where s and t are not
unifiable - 7. uxs ? uxt ? uyr , where y r is an
assignment in the unification of s
and t - 8. emnq ? pmq
- 9. pmq ? pqs ? pms , (transitivity of path
relation) - 10. pmm , (no cycles)
21Example
- R(a)
- Q(b) ? R(y)
- P(a) ? Q(x)
- P(w)
- 1. c1
- 2. c1 ? l11
- 3. c2 ? l21
- 4. c3 ? l31
- 5. l11 ? e112
- 6. e112 ? c2
- 7. e112 ? uya
- 8. l21 ? e213
- 9. e213 ? c3
- 10. e213 ? uxb
- 11. l31 ? e314
- 12. e314 ? c4
- 13. e314 ? uwa
- And so on 105 total clauses
22Algorithm For Rigid Horn Problems
- Input F, a set of FO formula in CNF.
- Output RIGIDLY UNSATISFIABLE or RIGIDLY
SATISFIABLE - generate set of encodings, S, for F
- loop
- run SAT solver on S
- if SAT solver returns SATISFIABLE
- run occurs-check procedure
- if no occurs-check return (RIGIDLY
UNSATISFIABLE) - else augment S and continue in loop
- else if SAT solver returns UNSATISFIABLE
- return (RIGIDLY SATISFIABLE)
23Encoding For Non-Horn Problems
- Similar to Horn Encoding
- Closure property encoded differently
24Sharing Expressed As Tree
25Algorithm For Rigid Non-Horn Problem
- May Need Multiple Copies of Clauses
26Algorithm For Rigid Non-Horn Problems
- Input F, a set of FO formula in CNF.
- Output RIGIDLY UNSATISFIABLE or RIGIDLY
SATISFIABLE - loop
- generate set of encodings, S, for F
- run SAT solver on S
- if SAT solver returns SATISFIABLE
- run occurs-check procedure
- if no occurs-check return (RIGIDLY
UNSATISFIABLE) - else augment S and continue in loop
- else if SAT solver returned UNSATISFIABLE
- augment F with additional copies of
original clauses
27General First Order Theorem Proving
- May Need Additional Instances
28General Algorithm
- Input F, a set of FO formula in CNF.
- Output RIGIDLY UNSATISFIABLE or RIGIDLY
SATISFIABLE - loop
- generate set of encodings, S, for F
- run SAT solver on S
- if SAT solver returns SATISFIABLE
- run occurs-check
- if no occurs-check return (RIGIDLY
UNSATISFIABLE) - else augment S and continue in loop
- else if SAT solver returned UNSATISFIABLE
- augment F with additional instances of
original clauses
29ChewTPTP An Implementation
- Written in C on Linux
- Options
- TPTP Input
- Uses Minisat
- Experimental Results
30ChewTPTP Example
- This is MiniSat 2.0 beta
- WARNING for repeatability, setting FPU to use
double precision - Problem Statistics
-
- Number of variables 0
- Number of clauses 4
- Parsing time 0.00 s
- Search Statistics
- Conflicts ORIGINAL
LEARNT Progress - Vars Clauses Literals
Limit Clauses Lit/Cl
- 0 0 0 0
0 0 nan 0.000
- restarts 1
- conflicts 0 (nan /sec)
- decisions 1 (0.00
random) (inf /sec) - propagations 109 (inf /sec)
- conflict literals 0 ( nan
deleted) - Memory used 0.37 MB
31Future Work
- Find good way to represent equality
- Find way to decide which clauses should have
multiple instances - Replace SAT solver with SAT solver modulo
theories
32Thank You