Tree Interpolation in Vampire R´ egis Blanc (EPFL) Ashutosh Gupta (IST Austria) Laura Kov´ acs (Chalmers) Bernhard Kragl (TU Vienna)
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . I n − 1 I 1 I 2 . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . I n − 1 I 1 I 2 . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . → I n − 1 I 1 I 2 . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . → → I n − 1 I 1 I 2 . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . → → → I n − 1 I 1 I 2 . . . 2 / 11
Interpolation Craig/Binary Interpolant → ∧ A B ⊥ I I ∈ L ( A ) ∩ L ( B ) Sequence Interpolant → A 1 ∧ A 2 ∧ A 3 ∧ ∧ A n ⊥ . . . → → → I n − 1 I 1 I 2 . . . I 1 ∈ L ( A 1 ) ∩ L ( A 2 , . . . , A n ) I 2 ∈ L ( A 1 , A 2 ) ∩ L ( A 3 , . . . , A n ) I n − 1 ∈ L ( A 1 , . . . , A n − 1 ) ∩ L ( A n ) 2 / 11
Tree interpolation A 0 ∧ A 1 ∧ A 2 ∧ A 3 ∧ A 4 → ⊥ A 4 A 3 A 2 A 1 A 0 3 / 11
Tree interpolation A 0 ∧ A 1 ∧ A 2 ∧ A 3 ∧ A 4 → ⊥ A 4 A 3 I 4 I 3 A 2 A 1 I 2 I 1 A 0 ⊥ 3 / 11
Tree interpolation A 0 ∧ A 1 ∧ A 2 ∧ A 3 ∧ A 4 → ⊥ node ∧ child Itps → Itp A 4 → I 4 A 4 A 3 A 3 → I 3 I 4 I 3 A 1 → I 1 A 2 ∧ I 4 ∧ I 3 → I 2 A 0 ∧ I 2 ∧ I 1 → ⊥ A 2 A 1 I 2 I 1 A 0 ⊥ 3 / 11
Tree interpolation A 0 ∧ A 1 ∧ A 2 ∧ A 3 ∧ A 4 → ⊥ node ∧ child Itps → Itp A 4 → I 4 A 4 A 3 A 3 → I 3 I 4 I 3 A 1 → I 1 A 2 ∧ I 4 ∧ I 3 → I 2 A 0 ∧ I 2 ∧ I 1 → ⊥ A 2 A 1 I 2 I 1 Language restrictions I 4 ∈ L ( A 4 ) ∩ L ( A 3 , A 2 , A 1 , A 0 ) I 3 ∈ L ( A 3 ) ∩ L ( A 4 , A 2 , A 1 , A 0 ) A 0 I 2 ∈ L ( A 4 , A 3 , A 2 ) ∩ L ( A 1 , A 0 ) ⊥ I 1 ∈ L ( A 1 ) ∩ L ( A 3 , A 2 , A 1 , A 0 ) 3 / 11
Related Work Solving recursion-free Horn clauses [Gupta, Popeea, Rybalchenko POPL ’11] Interpolants for procedure summarization [McMillan, Rybalchenko MSR-TR’13] Generalized property directed reachability [Hoder, Bjørner SAT’12] Interpolation and Horn Clauses [Hojjat, R¨ ummer, Kuncak CAV’13] Nested Interpolants [Heizmann, Hoenicke, Podelski POPL ’10] and many more ... 4 / 11
Important questions Do interpolants always exist? Yes, in first-order logic (also with respect to a theory) Is a logic closed under interpolation? (e.g. quantifier free fragments) Not necessarily, consider a = 2 b + 1 ∧ a = 2 c over Z 5 / 11
Important questions Do interpolants always exist? Yes, in first-order logic (also with respect to a theory) Is a logic closed under interpolation? (e.g. quantifier free fragments) Not necessarily, consider a = 2 b + 1 ∧ a = 2 c over Z How to interpolate efficiently? How to obtain “good” interpolants? 5 / 11
Proof-based interpolation Refutations (should) capture the cause of unsatisfiability Extensive literature on interpolant extraction for various theories ☞ Notion of local proof 6 / 11
Proof-based interpolation Refutations (should) capture the cause of unsatisfiability Extensive literature on interpolant extraction for various theories ☞ Notion of local proof Consider a = b ∧ b = c and c = d ∧ a � = d 6 / 11
Proof-based interpolation Refutations (should) capture the cause of unsatisfiability Extensive literature on interpolant extraction for various theories ☞ Notion of local proof Consider a = b ∧ b = c and c = d ∧ a � = d b = c c = d a = b b = d a � = d a = b ⊥ 6 / 11
Proof-based interpolation Refutations (should) capture the cause of unsatisfiability Extensive literature on interpolant extraction for various theories ☞ Notion of local proof Consider a = b ∧ b = c and c = d ∧ a � = d b = c c = d a = b b = c a = c c = d a = b b = d a = d a � = d a � = d a = b ⊥ ⊥ 6 / 11
Proof-based interpolation Refutations (should) capture the cause of unsatisfiability Extensive literature on interpolant extraction for various theories ☞ Notion of local proof Consider a = b ∧ b = c and c = d ∧ a � = d b = c c = d a = b b = c a = c c = d a = b b = d a = d a � = d a � = d a = b ⊥ ⊥ interpolant: a = c 6 / 11
Vampire Vampire is one of the best first-order theorem provers Recent developments/extensions: Invariant generation [FASE’09, MICAI’11] Interpolation and Symbol Elimination [CADE’09, IJCAR’10] Interpolant minimization & Theory independent proof localization [POPL ’12] Incremental tree interpolation [today] 7 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 a = c c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 a = c c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 a � = d a = c c = d ∧ X 5 8 / 11
Incremental tree interpolation Visit tree nodes in topological order Per node: partition the tree and compute binary interpolant Crucial: reuse previously computed interpolants L ( X 1 , X 2 , X 3 , X 4 , X 5 ) ∩ { a , b , c , d } = ∅ a = b ∧ X 1 b = c ∧ X 2 a = b b = c a � = d ∧ X 4 X 3 a � = d a = c c = d ∧ X 5 ⊥ 8 / 11
Tool usage n 1 : a = b n 2 : b = c n 3 : ⊤ n 4 : a � = d n 5 : c = d 9 / 11
Tool usage Tree interpolation problem in SMT-LIB 1.2 syntax using iZ3 n 1 : a = b n 2 : b = c convention ... :assumption (implies (and n 3 : ⊤ n 4 : a � = d (= a b) ) n1 ) :assumption (implies (and n 5 : c = d (= b c) ) n2 ) :assumption (implies (and n1 n2 true ) n3 ) :assumption (implies (and (not (= a d)) ) n4 ) :formula (implies (and n3 n4 (= c d) ) false ) 9 / 11
Recommend
More recommend