370 likes | 465 Views
Decision Procedures in First Order Logic. Propositional Encodings. TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A. A system of conjoined linear inequalities. Fourier-Motzkin Elimination. m constraints. n variables.
E N D
Decision Procedures in First Order Logic Propositional Encodings Daniel Kroening and Ofer Strichman TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAA
A system of conjoined linear inequalities Fourier-Motzkin Elimination mconstraints nvariables Decision Procedures An algorithmic point of view
When eliminating xn, partition the constraints according to the coefficient ai,n: • ai,n> 0: upper bound • ai,n< 0: lower bound Decision Procedures An algorithmic point of view
Assume we eliminatex1. • Example: (1) x1 – x2 ≤ 0 (2) x1 – x3 ≤ 0 (3) -x1 + x2 + 2x3 ≤ 0 (4) -x3 ≤ -1 Category? Lower bound Lower bound Upper bound Decision Procedures An algorithmic point of view
For each pair of a lower bound al,n<0 andupper bound au,n>0, we have • For each such pair, add a constraint • In other words, apply the proof rule: Decision Procedures An algorithmic point of view
Example: (1) x1 – x2 ≤ 0 (2) x1 – x3 ≤ 0 (3) -x1 + x2 + 2x3 ≤ 0 (4) -x3 ≤ -1 (5) 2x3 ≤ 0 (from 1 and 3) (6) x2 + x3 ≤ 0 (from 2 and 3) Eliminatex1. Decision Procedures An algorithmic point of view
Example: (1) x1 – x2 ≤ 0 (2) x1 – x3 ≤ 0 (3) -x1 + x2 + 2x3 ≤ 0 (4) -x3≤ -1 (5) 2x3 ≤ 0 (from 1 and 3) (6) x2 + x3 ≤ 0 (from 2 and 3) (7) 0 ≤ -1 (from 4 and 5) Eliminatex3. Contradiction (the system is unsatisfiable)! Decision Procedures An algorithmic point of view
Complexity of Fourier-Motzkin • In verification we typically solve a large number of small linear inequality systems. • The bottleneck: case splitting • Q: Is there an alternative to case-splitting ? Decision Procedures An algorithmic point of view
Boolean Fourier-Motzkin (BFM) (1/2) • Normalize formula: • Transform to NNF • Eliminate negations by reversing inequality signs (x1–x2 0) x1–x3< 0 (-x1 + 2x3 + x2 0 1 x3 ) x1–x2< 0 x1–x3< 0 (-x1 + 2x3 + x2 < 0 -x3< -1) Decision Procedures An algorithmic point of view
e1 e3 e5 x1 – x2< 0 -x1 + 2x3 + x2< 0 2x3 <0 e1 e3 e5 Boolean Fourier-Motzkin (BFM) (2/2) : x1 - x2< 0 x1 - x3< 0 (-x1 + 2x3 + x2 < 0 -x3< -1) e1 e2 ( e3 e4 ) 2.Derive Bsk 3. DeriveBtrans: Perform FM on the conjunction of all predicates: 4. Solve ’ =BskÆ(Btrans) Decision Procedures An algorithmic point of view
e1e3e5 e5 2x3 < 0 e6x2 + x3 < 0 e2e3e6 False 0 < -1 e4e5False BFM: example Computing Bsk Computing Btrans e1x1 – x2< 0 e2x1 – x3< 0 e3 -x1 + 2x3 + x2< 0 e4 -x3< -1 e1 e2 (e3 e4) Btrans ’ = BskÆBtrans is satisfiable Decision Procedures An algorithmic point of view
A proof rule • A proof step (r,p,a) • r: Rule • p: Proposition • a: Antecedents Decision Procedures An algorithmic point of view
Some proof rules Decision Procedures An algorithmic point of view
Let’s prove Decision Procedures An algorithmic point of view
Proof-graph of P A A,B:sets of propositions PprovesBusingA: A B Decision Procedures An algorithmic point of view
Boolean encoding • Definition(Proof-step Constraint): if A1…Ak are the antecedents of step then • Example: c(step):= e(x=5) Æe(:x¸ 0) !e(:5 ¸ 0) Decision Procedures An algorithmic point of view
A proofP =(s1,…, sn) is a set of Proof Steps, in which the Antecedence relation is acyclic. • The Proof Constraintc(P) induced by P is the conjunction of the constraints induced by its steps: Decision Procedures An algorithmic point of view
Propositional skeleton: Decision Procedures An algorithmic point of view
A proof P is said to prove validity of if :skÆc(P) is unsatisfiable. • Normally proofs refer to the Boolean skeleton (the roots are sub-formulas). • We will consider proofs starting from literals, and, hence, no Boolean structure. Decision Procedures An algorithmic point of view
Example • Prove validity of x 5 Çx ¸ 0 by using atoms only Decision Procedures An algorithmic point of view
Example (cont’d) :sk Æc(P’) is unsatisfiable hence is valid Decision Procedures An algorithmic point of view
Complete proofs • Definition (Complete proofs): A proof P is called complete with respect to if Decision Procedures An algorithmic point of view
TL(): Theory Literals corresponding to • Proposition (sufficient condition for completeness #1): Let be an unsatisfiable formula, and let A denote the set of full assignments that satisfy sk. A proof P is complete with respect to if 82 A, Decision Procedures An algorithmic point of view
TL(): Theory Literals corresponding to For a partial assignments.t.², is minimal if8v. nv 2 • Proposition (sufficient condition for completeness #2): Let be an unsatisfiable formula, and let A denote the set of minimal assignments that satisfy sk. A proof P is complete with respect to if 82 A, Decision Procedures An algorithmic point of view
Proposition (sufficient condition for completeness #3): Let be an unsatisfiable formula, and let A denote the set of minimal assignments that satisfy sk. A proof P is complete with respect to if 82 A, for some unsatisfiable coreTLuc() µ TL() TL(): Theory Literals corresponding to Decision Procedures An algorithmic point of view
Goal: find complete proofs • We will see a ‘complete’ proof mechanism, based on projection. • First, let us define projection in terms of proof steps. Decision Procedures An algorithmic point of view
Example - projection • Indeed, • x1 var(x4 > x4) • ’ = (x2 > x3) Æ (x4 > x4) is equisatisfiable to Decision Procedures An algorithmic point of view
Example – strong projection • Indeed are unsatisfiable and do not contain x1. U2 U1 Decision Procedures An algorithmic point of view
Examples • Disjunctive Linear arithmetic:Boolean Fourier-Motzkin • Equality Logic: • For each pair of predicatesof the form xi=xj and xj=xk in , apply: • To each pair of contradicting predicates of the form xi = xj and xi xj, apply Decision Procedures An algorithmic point of view
Optimizations • Conjunction Matrices • Early detection • Cross-theory learning Decision Procedures An algorithmic point of view
Cross-theory learning • T1: • T2: • From T1 we learn z1=z2,which we propagate to T2 • In T2 we get a contradiction on: z1> 2, z2=1, z1=z2 • This results in a conflict clause: • Which represents cross-theory learning Decision Procedures An algorithmic point of view