Pretending to be an SMT Solver with Vampire (and How We Do Instantiation) Giles Reger 1 , Martin Suda 2 , and Andrei Voronkov 1 , 2 1 School of Computer Science, University of Manchester, UK 2 TU Wien, Vienna, Austria SMT 2017 – Heidelberg, July 22, 2017 1/19
Introducing Vampire Automatic Theorem Prover (ATP) for first-order logic Main paradigm: superposition calculus + saturation a.k.f.: indexing, incomplete strategies, strategy scheduling 1/19
Introducing Vampire Automatic Theorem Prover (ATP) for first-order logic Main paradigm: superposition calculus + saturation a.k.f.: indexing, incomplete strategies, strategy scheduling 1/19
Introducing Vampire Automatic Theorem Prover (ATP) for first-order logic Main paradigm: superposition calculus + saturation a.k.f.: indexing, incomplete strategies, strategy scheduling Reasoning with Theories since 2010: progressively adding support for theories since 2016: participating in SMT-COMP 1/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ gnd Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP gnd Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP gnd SMT Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ E SPASS ATP VAMPIRE ... CVC4 veriT Z3 ... gnd SMT Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP gnd SMT Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP SMT Instantiation ... gnd Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP theory axioms ... SMT Instantiation ... gnd Z / R : + − ∗ / select / store 2/19
Reasoning with quantifiers and theories Two Dimensions of Complexity ∀∃ ATP theory axioms ... ? SMT Instantiation ... gnd Z / R : + − ∗ / select / store 2/19
Outline A Brief Introduction to Saturation-Based Proving 1 Theory Reasoning in Vampire 2 Theory Instantiation and Unification with Abstraction 3 Where We Currently Stand 4 3/19
Theorem Proving Pipeline in One Slide Standard form of the input: F := ( Axiom 1 ∧ . . . ∧ Axiom n ) → Conjecture 4/19
Theorem Proving Pipeline in One Slide Standard form of the input: F := ( Axiom 1 ∧ . . . ∧ Axiom n ) → Conjecture 1 Negate F to seek a refutation: ¬ F := Axiom 1 ∧ . . . ∧ Axiom n ∧ ¬ Conjecture 4/19
Theorem Proving Pipeline in One Slide Standard form of the input: F := ( Axiom 1 ∧ . . . ∧ Axiom n ) → Conjecture 1 Negate F to seek a refutation: ¬ F := Axiom 1 ∧ . . . ∧ Axiom n ∧ ¬ Conjecture 2 Preprocess and transform ¬ F to clause normal form (CNF) S := { C 1 , . . . , C n } 4/19
Theorem Proving Pipeline in One Slide Standard form of the input: F := ( Axiom 1 ∧ . . . ∧ Axiom n ) → Conjecture 1 Negate F to seek a refutation: ¬ F := Axiom 1 ∧ . . . ∧ Axiom n ∧ ¬ Conjecture 2 Preprocess and transform ¬ F to clause normal form (CNF) S := { C 1 , . . . , C n } 3 saturate S with respect to the superposition calculus aiming to derive the obvious contradiction ⊥ 4/19
b Saturation = fixed-point computation Given Clause Algorithm: Unprocessed Active Passive set of active clauses is stored in indexing structures passive works like a priority queue the process is “explosive” in nature 5/19
Controlling the Growth of the Search Space Superposition rule t [ s ] p ⊗ t ′ ∨ C 2 l ≃ r ∨ C 1 L [ s ] p ∨ C 2 l ≃ r ∨ C 1 , or ( t [ r ] p ⊗ t ′ ∨ C 1 ∨ C 2 ) θ ( L [ r ] p ∨ C 1 ∨ C 2 ) θ where θ = mgu ( l , s ) and r θ �� l θ and, for the left rule L [ s ] is not an equality literal, and for the right rule ⊗ stands either for ≃ or �≃ and t ′ θ �� t [ s ] θ 6/19
Controlling the Growth of the Search Space Superposition rule t [ s ] p ⊗ t ′ ∨ C 2 l ≃ r ∨ C 1 L [ s ] p ∨ C 2 l ≃ r ∨ C 1 , or ( t [ r ] p ⊗ t ′ ∨ C 1 ∨ C 2 ) θ ( L [ r ] p ∨ C 1 ∨ C 2 ) θ where θ = mgu ( l , s ) and r θ �� l θ and, for the left rule L [ s ] is not an equality literal, and for the right rule ⊗ stands either for ≃ or �≃ and t ′ θ �� t [ s ] θ Saturation up to Redundancy redundant clauses can be safely removed subsumption - an example reduction: remove C in the presence of D such that D σ ⊂ C 6/19
Controlling the Growth of the Search Space Superposition rule t [ s ] p ⊗ t ′ ∨ C 2 l ≃ r ∨ C 1 L [ s ] p ∨ C 2 l ≃ r ∨ C 1 , or ( t [ r ] p ⊗ t ′ ∨ C 1 ∨ C 2 ) θ ( L [ r ] p ∨ C 1 ∨ C 2 ) θ where θ = mgu ( l , s ) and r θ �� l θ and, for the left rule L [ s ] is not an equality literal, and for the right rule ⊗ stands either for ≃ or �≃ and t ′ θ �� t [ s ] θ Saturation up to Redundancy redundant clauses can be safely removed subsumption - an example reduction: remove C in the presence of D such that D σ ⊂ C Completeness considerations 6/19
Outline A Brief Introduction to Saturation-Based Proving 1 Theory Reasoning in Vampire 2 Theory Instantiation and Unification with Abstraction 3 Where We Currently Stand 4 7/19
Basic Support for Theories Normalization of interpreted operations, e.g. t 1 ≥ t 2 � ¬ ( t 1 < t 2 ) a − b � a + ( − b ) Evaluation of ground interpreted terms, e.g. f ( 1 + 2 ) � f ( 3 ) f ( x + 0 ) � f ( x ) 1 + 2 < 4 � true Balancing interpreted literals, e.g. 4 = 2 × ( x + 1 ) � ( 4 div 2 ) − 1 = x � x = 1 Interpreted operations treated specially by ordering 8/19
Adding Theory Axioms x + ( y + z ) = ( x + y ) + z x + 0 = x x + y = y + x − ( x + y ) = ( − x + − y ) − − x = x x + ( − x ) = 0 x ∗ 0 = 0 x ∗ ( y ∗ z ) = ( x ∗ y ) ∗ z x ∗ 1 = x x ∗ y = y ∗ x ( x ∗ y ) + ( x ∗ z ) = x ∗ ( y + z ) ¬ ( x < y ) ∨ ¬ ( y < z ) ∨ ¬ ( x < z ) x < y ∨ y < x ∨ x = y ¬ ( x < y ) ∨ ¬ ( y < x + 1 ) ¬ ( x < y ) ∨ x + z < y + z ¬ ( x < x ) x < y ∨ y < x + 1 ( for ints ) x = 0 ∨ ( y ∗ x ) / x = y ( for reals ) a handcrafted set subsets added based on the signature ongoing research on how to tame them [IWIL17] 9/19
AVATAR modulo Theories The AVATAR architecture [Voronkov14] modern architecture of first-order theorem provers combines saturation with SAT-solving efficient realization of the clause splitting rule ∀ x , z , w . s ( x ) ∨ ¬ r ( x , z ) ∨ ¬ q ( w ) � �� � � �� � share x and z is disjoint “propositional essence” of the problem delegated to SAT solver 10/19
AVATAR modulo Theories The AVATAR architecture [Voronkov14] modern architecture of first-order theorem provers combines saturation with SAT-solving efficient realization of the clause splitting rule ∀ x , z , w . s ( x ) ∨ ¬ r ( x , z ) ∨ ¬ q ( w ) � �� � � �� � share x and z is disjoint “propositional essence” of the problem delegated to SAT solver AVATAR modulo Theories use an SMT solver instead of the SAT solver sub-problems considered are ground-theory-consistent implemented in Vampire using Z3 10/19
One Slightly Imprecise View of AVATAR SMT Solver Vampire Theory Solver Incremental Theory Solver Theory Solver Theory Solver for Uninterpreted for Quantified Formulas for Arithmetic for BitVectors Functions Quantifier Core Instantiation CDCL SAT Solver 11/19
One Slightly Imprecise View of AVATAR SMT Solver Vampire Theory Solver Incremental Theory Solver Theory Solver Theory Solver for Uninterpreted for Quantified Formulas for Arithmetic for BitVectors Functions Quantifier Core Instantiation CDCL SAT Solver . . . and please remember: Vampire is the boss here! 11/19
Outline A Brief Introduction to Saturation-Based Proving 1 Theory Reasoning in Vampire 2 Theory Instantiation and Unification with Abstraction 3 Where We Currently Stand 4 12/19
Does Vampire Need Instantiation? Example Consider the conjecture ( ∃ x )( x + x ≃ 2 ) negated and clausified to x + x �≃ 2 . It takes Vampire 15 s to solve using theory axioms deriving lemmas such as x + 1 ≃ y + 1 ∨ y + 1 ≤ x ∨ x + 1 ≤ y . 13/19
Does Vampire Need Instantiation? Example Consider the conjecture ( ∃ x )( x + x ≃ 2 ) negated and clausified to x + x �≃ 2 . It takes Vampire 15 s to solve using theory axioms deriving lemmas such as x + 1 ≃ y + 1 ∨ y + 1 ≤ x ∨ x + 1 ≤ y . Heuristic instantiation would help, but normally any instance of a clause is immediately subsumed by the original! 13/19
Does Vampire Need Instantiation? Example Consider the conjecture ( ∃ x )( x + x ≃ 2 ) negated and clausified to x + x �≃ 2 . It takes Vampire 15 s to solve using theory axioms deriving lemmas such as x + 1 ≃ y + 1 ∨ y + 1 ≤ x ∨ x + 1 ≤ y . Heuristic instantiation would help, but normally any instance of a clause is immediately subsumed by the original! Recall the abstraction rule L [ t ] ∨ C = ⇒ x �≃ t ∨ L [ x ] ∨ C , where L is a theory literal, t a non-theory term, and x fresh. 13/19
Recommend
More recommend