Automated reasoning for first-order logic Theory, Practice and Challenges
Konstantin Korovin1 The University of Manchester UK
korovin@cs.man.ac.uk
Part II
1supported by a Royal Society University Fellowship
Automated reasoning for first-order logic Theory, Practice and - - PowerPoint PPT Presentation
Automated reasoning for first-order logic Theory, Practice and Challenges Konstantin Korovin 1 The University of Manchester UK korovin@cs.man.ac.uk Part II 1 supported by a Royal Society University Fellowship Modular instantiation-based
korovin@cs.man.ac.uk
1supported by a Royal Society University Fellowship
3 / 144
4 / 144
◮ Inefficient in propositional case ◮ Length of clauses can grow fast ◮ Recombination of clauses ◮ No effective model representation
5 / 144
6 / 144
i ϕ(¯
◮ How to restrict instantiations. ◮ How to interleave instantiation with propositional reasoning.
7 / 144
8 / 144
9 / 144
10 / 144
11 / 144
12 / 144
13 / 144
14 / 144
15 / 144
16 / 144
17 / 144
18 / 144
19 / 144
20 / 144
21 / 144
22 / 144
◮ C 1, . . . , Cn |
◮ C 1, . . . , Cn ≺ C ◮ P(a) |
◮ P(a) ≺ ✭✭✭✭✭
23 / 144
◮ C 1, . . . , Cn |
◮ C 1, . . . , Cn ≺ C ◮ P(a) |
◮ P(a) ≺ ✭✭✭✭✭
◮ many usual redundancy elimination techniques ◮ redundancy for inferences ◮ new instantiation-specific redundancies
24 / 144
25 / 144
26 / 144
◮ split D ⊂ C ◮ check Sgr |
◮ add D to S and remove C
27 / 144
◮ split D ⊂ C ◮ check Sgr |
◮ add D to S and remove C
28 / 144
29 / 144
30 / 144
31 / 144
◮ strict subsumption ◮ subsumption resolution ◮ . . .
32 / 144
33 / 144
34 / 144
35 / 144
36 / 144
37 / 144
38 / 144
39 / 144
40 / 144
41 / 144
42 / 144
43 / 144
◮ Cσ = Cθτ, and ◮ θ properly instantiates C
44 / 144
◮ Cσ = Cθτ, and ◮ θ properly instantiates C
45 / 144
◮ Cσ = Cθτ, and ◮ θ properly instantiates C
46 / 144
◮ C1 · σ1, . . . , Cn · σn |
◮ C1 · σ1, . . . , Cn · σn ≺ C · σ
◮ generalises usual redundancy ◮ new instantiation specific redundancies
◮ blocking non-proper instances (merging variables) can be eliminated ◮ dismatching constraints
◮ redundancy for inferences
47 / 144
48 / 144
49 / 144
50 / 144
51 / 144
52 / 144
53 / 144
54 / 144
55 / 144
56 / 144
57 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 58 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 59 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 60 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 61 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 62 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 63 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 64 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 65 / 144
◮ Inst-Gen is sound and complete for first-order logic ◮ combines efficient ground reasoning with first-order reasoning ◮ decision procedure for effectively propositional logic (EPR) ◮ redundancy elimination
◮ usual: tautology elimination, strict subsumption ◮ global subsumption:
◮ closure-based redundancies: ◮ blocking non-proper instantiators ◮ dismatching constraints 66 / 144
◮ Inefficient in the ground/EPR case ◮ Length of clauses can grow fast ◮ Recombination of clauses ◮ No explicit model representation
68 / 144
69 / 144
70 / 144
71 / 144
74 / 144
75 / 144
76 / 144
77 / 144
78 / 144
79 / 144
80 / 144
81 / 144
82 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
83 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
84 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
85 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
86 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
87 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
88 / 144
◮ sound and complete for first-order logic with equality ◮ combines SMT for ground reasoning and superposition-based unit
◮ unit superposition does not have weaknesses of the general
◮ all redundancy elimination techniques from Inst-Gen are applicable
◮ redundancy elimination become more powerful: now we can use
89 / 144
◮ correspond to different clauses, ◮ have different dismatching constraints ◮ be represented many times in the same proof search
90 / 144
◮ correspond to different clauses, ◮ have different dismatching constraints ◮ be represented many times in the same proof search
91 / 144
◮ correspond to different clauses, ◮ have different dismatching constraints ◮ be represented many times in the same proof search
92 / 144
◮ Preserve Boolean structure of proofs ◮ Closure is a propositional variable in an AND/OR tree ◮ Conjunction ∧ in superposition, disjunction ∨ in merging
93 / 144
◮ Not produced in normal form ◮ Sequence of inferences determines shape ◮ Potential growth ad infinitum ◮ OBDD as normal form ◮ Maintenance effort ◮ Reordering required
94 / 144
95 / 144
97 / 144
98 / 144
99 / 144
100 / 144
101 / 144
102 / 144
◮ complete ground reasoning modulo T ◮ answer completeness of unit reasoning modulo T ◮ T is universal
103 / 144
◮ complete ground reasoning modulo T ◮ answer completeness of unit reasoning modulo T ◮ T is universal
104 / 144
◮ complete ground reasoning modulo T ◮ answer completeness of unit reasoning modulo T ◮ T is universal
105 / 144
107 / 144
108 / 144
109 / 144
110 / 144
112 / 144
◮ Hardware Verification (Intel) ◮ Planning/Scheduling ◮ Finite model reasoning
113 / 144
114 / 144
115 / 144
116 / 144
117 / 144
◮ The same functional behaviour can be implemented in different ways ◮ Optimised for:
◮ Timing – better performance ◮ Power – longer battery life ◮ Area – smaller chips
◮ Verification: optimisations do not change functional behaviour
118 / 144
◮ s0, . . . , sk constants denote unrolling bounds ◮ first-order formulas I(S), P(S), T(S, S′) ◮ next state predicate Next(S, S′)
◮ EPR encoding provides succinct representation ◮ avoids copying transition relation ◮ reasoning can be done at higher level
119 / 144
◮ s0, . . . , sk constants denote unrolling bounds ◮ first-order formulas I(S), P(S), T(S, S′) ◮ next state predicate Next(S, S′)
◮ EPR encoding provides succinct representation ◮ avoids copying transition relation ◮ reasoning can be done at higher level
120 / 144
121 / 144
◮ Inst-Gen also uses SAT solver and resolution for simplifications ◮ Query answering: using answer substitutions ◮ Finite model finding: based on EPR/sort inference/non-cyclic sorts ◮ Bounded model checking mode: (Intel format) ◮ Proof representation: non-trivial due to SAT solver simplifications ◮ Model representation: using formulas in term algebra;
123 / 144
◮ Inst-Gen Given clause algorithm ◮ SAT solvers for ground reasoning: MiniSAT, PicoSAT, Lingeling ◮ strategy scheduling ◮ preprocessing ◮ splitting with naming
◮ Literal selection ◮ Subsumption (forward/backward) ◮ Subsumption resolution (forward/backward) ◮ Dismatching constraints ◮ Blocking non-proper instantiators ◮ Global subsumption: SAT solver is used for non-ground
124 / 144
◮ priority queues based on lexicographic combinations of parameters
◮ unification index on selected literals
125 / 144
◮ priority queues based on lexicographic combinations of parameters
◮ unification index on selected literals
126 / 144
◮ priority queues based on lexicographic combinations of parameters
◮ unification index on selected literals
127 / 144
128 / 144
◮ Single subsumption is NP-hard. ◮ We can have 100,000 clauses in our search space ◮ Applying naively between all pairs of clauses we need
◮ non-perfect discrimination trees for unification, matching ◮ compressed feature vector indexes for subsumption, subsumption
129 / 144
◮ Single subsumption is NP-hard. ◮ We can have 100,000 clauses in our search space ◮ Applying naively between all pairs of clauses we need
◮ non-perfect discrimination trees for unification, matching ◮ compressed feature vector indexes for subsumption, subsumption
130 / 144
131 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
132 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
133 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
134 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
135 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
136 / 144
◮ clause C can not subsume any clause with number of literals strictly
◮ clause C can not subsume any clause with number of positive
◮ clause C can not subsume any clause with the number of
◮ . . .
137 / 144
138 / 144
139 / 144
140 / 144
141 / 144
142 / 144
◮ Query answering: using answer substitutions ◮ Finite model finding: based on EPR/sort inference/non-cyclic sorts ◮ Bounded model checking mode: (Intel format) ◮ Proof representation: non-trivial due to SAT solver simplifications ◮ Model representation: using formulas in term algebra;
143 / 144
144 / 144