A Proof-Producing CSP Solver 1 Michael Veksler Ofer Strichman Technion - Israel Institute of Technology CSP SAT June 18, 2011 1 Originally presented at AAAI 10
Introduction CSP proofs It is easy to validate a solution,... but difficult to validate UNSAT. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 2 / 36
Introduction CSP proofs It is easy to validate a solution,... but difficult to validate UNSAT. We introduce a CSP solver which produces a machine-checkable deductive proof. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 2 / 36
Introduction CSP proofs It is easy to validate a solution,... but difficult to validate UNSAT. We introduce a CSP solver which produces a machine-checkable deductive proof. This also gives us a better unsatisfiable core, Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 2 / 36
Introduction CSP proofs It is easy to validate a solution,... but difficult to validate UNSAT. We introduce a CSP solver which produces a machine-checkable deductive proof. This also gives us a better unsatisfiable core,... and facilitates developments as in the SAT world. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 2 / 36
CSP proofs Why bother? SAT solvers produce such proofs. Several killer-applications: (cont d...) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 3 / 36
CSP proofs Why bother? SAT solvers produce such proofs. Several killer-applications: Validate UNSAT results. (cont d...) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 3 / 36
CSP proofs Why bother? SAT solvers produce such proofs. Several killer-applications: Validate UNSAT results. Uses of the proof itself: Interpolation-based model checking [M03]. (cont d...) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 3 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Selective uses of the UNSAT core: Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Selective uses of the UNSAT core: Abstraction-refinement in model-checking [AM03], Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Selective uses of the UNSAT core: Abstraction-refinement in model-checking [AM03], Identify environment assumptions that are used in the proof [KKB09], Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Selective uses of the UNSAT core: Abstraction-refinement in model-checking [AM03], Identify environment assumptions that are used in the proof [KKB09], Faster solving of bitvector formulas [BKOSSB07]. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
CSP proofs Why bother?... Several killer-applications (... cont d): Selective uses of the UNSAT core: Abstraction-refinement in model-checking [AM03], Identify environment assumptions that are used in the proof [KKB09], Faster solving of bitvector formulas [BKOSSB07]. Can we foresee usage for proofs in CSP? Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 4 / 36
Introduction to proofs A deductive proof DAG c 1 c 2 c 3 i 1 i 2 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 5 / 36
Introduction to proofs A deductive proof DAG The roots: c CSP. c 1 c 2 c 3 i 1 i 2 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 5 / 36
Introduction to proofs A deductive proof DAG The roots: c CSP. The sink represents. c 1 c 2 c 3 i 1 i 2 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 5 / 36
Introduction to proofs A deductive proof DAG The roots: c CSP. The sink represents. The nodes in between are derived. c 1 c 2 c 3 i 1 i 2 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 5 / 36
Introduction to proofs A deductive proof DAG The roots: c CSP. The sink represents. The nodes in between are derived. c 1 c 2 c 3 i 1 i 2 parent 1 parent n [ rule name ] consequent Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 5 / 36
Resolution based proofs SAT solvers generate proofs: From initial clauses to (). Inference is via the binary-resolution rule. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 6 / 36
Resolution based proofs SAT solvers generate proofs: From initial clauses to (). Inference is via the binary-resolution rule. Unlike SAT solvers, CSPs: have non-boolean domains, and non-clausal constraints. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 6 / 36
Resolution based proofs SAT solvers generate proofs: From initial clauses to (). Inference is via the binary-resolution rule. Unlike SAT solvers, CSPs: have non-boolean domains, and non-clausal constraints. Can this gap be bridged? Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 6 / 36
Resolution based proofs Signed CNF [BHM00] - definition Let s be a set of values. A positive signed literal: a s, e.g., a {1, 2, 3}. Alternative notations: a [1..3], a = 4. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 7 / 36
Resolution based proofs Signed CNF [BHM00] - definition Let s be a set of values. A positive signed literal: a s, e.g., a {1, 2, 3}. Alternative notations: a [1..3], a = 4. A negative signed literal: a s, e.g., a {4}. Alternative notations: a {4}, a 4. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 7 / 36
Resolution based proofs Signed CNF [BHM00] - definition Let s be a set of values. A positive signed literal: a s, e.g., a {1, 2, 3}. Alternative notations: a [1..3], a = 4. A negative signed literal: a s, e.g., a {4}. Alternative notations: a {4}, a 4. A signed clause is a disjunction of signed literals. e.g., (a [1..3] b {4}) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 7 / 36
Resolution based proofs Signed CNF - resolution A binary-resolution rule for signed-cnf: (Literals 1 x A) (x B Literals 2 ) (sres(x)) (Literals 1 x A B Literals 2 ) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 8 / 36
Resolution based proofs Signed CNF - resolution A binary-resolution rule for signed-cnf: (Literals 1 x A) (x B Literals 2 ) (sres(x)) (Literals 1 x A B Literals 2 ) This can be used with constraints given as signed-clauses. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 8 / 36
Resolution based proofs Signed CNF - resolution A binary-resolution rule for signed-cnf: (Literals 1 x A) (x B Literals 2 ) (sres(x)) (Literals 1 x A B Literals 2 ) This can be used with constraints given as signed-clauses. But what about other constraints? e.g.,,alldifferent(v 1,...,v k ) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 8 / 36
CSP unsatisfiability proofs The challenge Q: Why not convert constraints to signed clauses? Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 9 / 36
CSP unsatisfiability proofs The challenge Q: Why not convert constraints to signed clauses? A: A clause representation is inefficient. e.g., x y requires: (x 1 y 1) (x 2 y 2) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT ) June 18, 2011 9 / 36
CSP unsatisfiability proofs The solution Solution: introduce clauses lazily. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 10 / 36
CSP unsatisfiability proofs The solution Solution: introduce clauses lazily. Consider a general constraint c, such that: In the context of l 1 l 2 l n, propagation of c implies l: (l 1 l n c) l Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 10 / 36
Explanation clauses The requirements (l 1 l n c) l Find an explanation clause e such that: e is not too strong: c e e is strong enough: (l 1 l n e) l Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 11 / 36
The structure of a PCS proof = e 1 e 2 e 3 sres x sres sres y sres sres sres () e 1,e 2,e 3 explanation clauses. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 12 / 36
Explanation rules For every constraint there is an explanation clause: constraint ( rule name ) explanation clause Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 13 / 36
Explanation rule example 1 Constraint: x y x y (x m y m) (Ne(m)) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 14 / 36
Explanation rule example 1 Propagation: context: l 1 : (x = 1), l 2 : (y [1..100]). constraint: c : x y. implies: l : (y [2..100]). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 15 / 36
Explanation rule example 1 Propagation: context: l 1 : (x = 1), l 2 : (y [1..100]). constraint: c : x y. implies: l : (y [2..100]). Explanation: e : (x 1 y 1) // = Ne(1) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 15 / 36
Explanation rule example 1 Propagation: context: l 1 : (x = 1), l 2 : (y [1..100]). constraint: c : x y. implies: l : (y [2..100]). Explanation: e : (x 1 y 1) // = Ne(1)... indeed: c Ne(1) e (l 1 l 2 e) l Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 15 / 36
Explanation rule example 2 Constraint: x y x y (x (,m] y [m + 1, )) (LE(m)) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 16 / 36
Explanation rule example 2 Propagation: context: l 1 : (x [1..3]), l 2 : (y [0..2]) constraint: c : x y. implies: l : x [1..2] Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 17 / 36
Explanation rule example 2 Propagation: context: l 1 : (x [1..3]), l 2 : (y [0..2]) constraint: c : x y. implies: l : x [1..2] Explanation: e : (x (,2] y [3, )). // = LE(2) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 17 / 36
Explanation rule example 2 Propagation: context: l 1 : (x [1..3]), l 2 : (y [0..2]) constraint: c : x y. implies: l : x [1..2] Explanation: e : (x (,2] y [3, )). // = LE(2)...indeed: c LE(2) e (l 1 l 2 e) l Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 17 / 36
Rule instantiation Q: How does PCS instantiate the rules? Consider the last example (LE(m)). We took m = max(domain(y)). Should we consider other values? Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 18 / 36
Rule instantiation Q: How does PCS instantiate the rules? Consider the last example (LE(m)). We took m = max(domain(y)). Should we consider other values? Yes! (to be shown later) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 18 / 36
Each constraint has its rule Constraint Name Inference rule a b x y a = b a b + c Ne(m) LE(m) Eq(D) LE + (m,n) a = b + c EQ a + (l b,u b,l c,u c ) AllDiff(v 1,...,v k ) AD(D,V) D +1 = V a b (a m b m) x y (x (,m] y [m + 1, )) a = b (a D b D) a b + c (a (,m + n] b [m + 1, ) c [n + 1, )) a = b + c (a [l b + l c,u b + u c ] b [l b,u b ] c [l c,u c ]) AllDiff(v 1,...,v k ) ( v V v D)... Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 19 / 36
The structure of a PCS proof = Eq(4) LE(3) Ne(1) e 1 e 2 e 3 sres x sres sres y sres sres sres () e 1,e 2,e 3 explanation clauses. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 20 / 36
But constraints are not axioms... So far we assumed that the constraints are axioms (unconditioned). Constraints can be conditioned, e.g., (b x y). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 21 / 36
But constraints are not axioms... So far we assumed that the constraints are axioms (unconditioned). Constraints can be conditioned, e.g., (b x y). Each of the above rules can be extended trivially to handle disjunction, e.g., b x y b (x (,m] y [m + 1, )) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 21 / 36
PCS: architecture partial assignment Decide full assignment BackTrack SAT bl 0 no conflict CP conflict Analyze- Conflict UNSAT bl < 0 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 22 / 36
From search to proof PCS is inspired by modern CDCL 2 SAT solvers. The learning mechanism is used for constructing a resolution proof. 2 Conflict-driven Clause-Learning Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 23 / 36
From search to proof PCS is inspired by modern CDCL 2 SAT solvers. The learning mechanism is used for constructing a resolution proof. Constraints propagation can be depicted in an implication graph... which is called a conflict graph in case of a conflict. 2 Conflict-driven Clause-Learning Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 23 / 36
From search to proof PCS is inspired by modern CDCL 2 SAT solvers. The learning mechanism is used for constructing a resolution proof. Constraints propagation can be depicted in an implication graph... which is called a conflict graph in case of a conflict. Analyze-Conflict learns a new clause from the conflict graph. 2 Conflict-driven Clause-Learning Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 23 / 36
From search to proof PCS is inspired by modern CDCL 2 SAT solvers. The learning mechanism is used for constructing a resolution proof. Constraints propagation can be depicted in an implication graph... which is called a conflict graph in case of a conflict. Analyze-Conflict learns a new clause from the conflict graph. If unsat: Starting from the empty clause, find the proof cone. Reconstruct a full proof. 2 Conflict-driven Clause-Learning Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 23 / 36
Implication graph (=>) Example Shows the context of implications. a D(a) = {1, 2} b c D(b) = {1, 2} D(c) = {1, 2} Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Example Shows the context of implications. a a = 1@1 b c D(b) = {1, 2} D(c) = {1, 2} b {1,2}@0 a=1@1 c {1,2}@0 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Example Shows the context of implications. a a = 1@1 b c D(b) = { 1, 2} D(c) = {1, 2} b {1,2}@0 a b a=1@1 a b b=2@1 c {1,2}@0 Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Example Shows the context of implications. b D(b) = {, 2} a a = 1@1 c D(c) = { 1,2} a b b {1,2}@0 a b b=2@1 a=1@1 a c c =2@1 c {1,2}@0 a c Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Example Shows the context of implications. b D(b) = {, 2} a a = 1@1 c D(c) = {, 2} a b b {1,2}@0 b c a b b=2@1 a=1@1 conflict a c c =2@1 c {1,2}@0 b c a c Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Shows the context of implications. Example a b b {1,2}@0 b c a b b=2@1 a=1@1 conflict a c c =2@1 c {1,2}@0 b c a c implied context constraint Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Shows the context of implications. Example a b b {1,2}@0 b c a b b=2@1 a=1@1 conflict a c c =2@1 c {1,2}@0 b c a c implied context constraint Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
Implication graph (=>) Shows the context of implications. Example a b b {1,2}@0 b c a b b=2@1 a=1@1 conflict a c c =2@1 c {1,2}@0 b c a c implied context constraint Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 24 / 36
ANALYZE-CONFLICT (<=) b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c b=2@1 c =2@1 b c b c conflict e = (b 2 c 2) cl = Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c front b=2@1 c =2@1 b c b c conflict cl = (b 2 c 2) Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c front b=2@1 c =2@1 b c b c conflict e = (a 1 c 1) cl = (b 2 c 2) cl Resolve(cl,e,c) Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c front b=2@1 c =2@1 b c b c conflict cl = (a 1 b 2 c {1,2}) Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c front b=2@1 c =2@1 b c b c conflict e = (a 1 b 1) cl = (a 1 b 2 c {1,2}) cl Resolve(cl,e,b) Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) front b {1,2}@0 a=1@1 c {1,2}@0 a b a b a c a c b=2@1 c =2@1 b c b c conflict cl = (a 1 b {1,2} c {1,2}) Invariant: cl contradicts the literals of front. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 25 / 36
ANALYZE-CONFLICT (<=) The resulting proof (b 2 c 2) R(c) NE(2) (a 1 c 1) R(c) (a 1 b 2 c {1,2}) NE(1) NE(1) b c a c a b R(b) (a 1 b 1) R(b) (a 1 b {1,2} c {1,2}) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 26 / 36
ANALYZE-CONFLICT (<=) The resulting proof NE(2) b c NE(1) (b 2 c 2) R(c) (a 1 c 1) R(c) (a 1 b 2 c {1,2}) NE(1) NE(1) a c a b NE(2) NE(2) (a 2 c 2) (b 1 c 1) R(c) R(c) (a 2 b 1 c {1,2}) R(b) (a 1 b 1) R(b) (a 1 b {1,2} c {1,2}) (a 2 b 2) R(b) R(b) (a 2 b {1,2} c {1,2}) R(a) R(a) (a {1,2} b {1,2} c {1,2}) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 26 / 36
ANALYZE-CONFLICT (<= The resulting proof (2) (a {1, 2} b {1, 2} c {1, 2}) (a {1, 2}) R(a) (b {1, 2} c {1, 2}) R(a) (b {1, 2}) R(b) (c {1, 2}) R(b) (c {1, 2}) R(c) () R(c) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 27 / 36
Optimization 1: augmented explanation Propagation: context: l 1 : (x [1..5]), l 2 : (y [2..3]) constraint: c : x y. implies: l : x [1..3] Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 28 / 36
Optimization 1: augmented explanation Propagation: context: l 1 : (x [1..5]), l 2 : (y [2..3]) constraint: c : x y. implies: l : x [1..3] Explanation: e : (x (,3] y [4, )). // = LE(3) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 28 / 36
Optimization 1: augmented explanation Propagation: context: l 1 : (x [1..5]), l 2 : (y [2..3]) constraint: c : x y. implies: l : x [1..3] Explanation: e : (x (,3] y [4, )). // = LE(3) But we now continue to resolve e with cl. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 28 / 36
Optimization 1: augmented explanation Propagation: context: l 1 : (x [1..5]), l 2 : (y [2..3]) constraint: c : x y. implies: l : x [1..3] Explanation: e : (x (,3] y [4, )). // = LE(3) But we now continue to resolve e with cl. Let cl = (x [6..8] z [1..2]). Resolve(e,cl,x) = (y [4, ) z [1..2]). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 28 / 36
Optimization 1: augmented explanation Let cl = (x [6..8] z [1..2]). Resolve(e,cl,x) = (y [4, ) z [1..2]). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 29 / 36
Optimization 1: augmented explanation Let cl = (x [6..8] z [1..2]). Resolve(e,cl,x) = (y [4, ) z [1..2]). Now consider LE(5): e : (x (,5] y [6, )). // = LE(5) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 29 / 36
Optimization 1: augmented explanation Let cl = (x [6..8] z [1..2]). Resolve(e,cl,x) = (y [4, ) z [1..2]). Now consider LE(5): e : (x (,5] y [6, )). // = LE(5) Resolve with cl: Resolve(e,cl,x) = (y [6, ] z [1,2]) Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 29 / 36
Optimization 1: augmented explanation Let cl = (x [6..8] z [1..2]). Resolve(e,cl,x) = (y [4, ) z [1..2]). Now consider LE(5): e : (x (,5] y [6, )). // = LE(5) Resolve with cl: Resolve(e,cl,x) = (y [6, ] z [1,2]) e is not an explanation, but it is good enough. We call it an augmented explanation. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 29 / 36
Optimization 1: formalization Assume that l 1 l n c l. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 30 / 36
Optimization 1: formalization Assume that l 1 l n c l. Let l cl be a literal such that var(l ) = var(l). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 30 / 36
Optimization 1: formalization Assume that l 1 l n c l. Let l cl be a literal such that var(l ) = var(l). e is an augmented explanation if c e (l 1 l n e ) l Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 30 / 36
Optimization 1: formalization Assume that l 1 l n c l. Let l cl be a literal such that var(l ) = var(l). e is an augmented explanation if c e (l 1 l n e ) l We choose e that results in the strongest resolvent. In particular: Resolve(e,cl,var(l)) Resolve(e,cl,var(l)). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 30 / 36
Optimization 2: Only consider relevant nodes Observation: vars(explanation) vars(predecessors). Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 31 / 36
Optimization 2: Only consider relevant nodes Observation: vars(explanation) vars(predecessors). Example: AllDiff (x,y,z). x = 1 y [2, 3]... y [1, 3] z = 2 z [1, 2] Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 31 / 36
Optimization 2: Only consider relevant nodes Observation: vars(explanation) vars(predecessors). Example: AllDiff (x,y,z). x = 1 y [2, 3]... y [1, 3] z = 2 z [1, 2] z becomes irrelevant. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 31 / 36
Optimization 3: Only consider distinct nodes Consider a conflict graph that includes a chain: x [1..4]@2 x [1..3]@3 x [1..2]@4... Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 32 / 36
Optimization 3: Only consider distinct nodes Consider a conflict graph that includes a chain: x [1..4]@2 x [1..3]@3 x [1..2]@4... Only right-most node matters. Others will not change the resolvent. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 32 / 36
Performance PCS participated in CSC 09 For n-ary constraints, out of 14: category rank rank rank SAT UNSAT total extension 9/14 6/14 9/14 intention 4/14 1/14 4/14 2-ary constraints PCS got poor results. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 33 / 36
New results (2011) PCS is now on-par with Mistral. Out of 2847 supported CSC 09 test cases (t/o is 200 secs) Mistral PCS shared shared shared case time * success time success success all 4.62 2187 9.23 (x2.0) 2104 (-83) 1963 with tables 4.38 1216 12.7 (x2.9) 1112 (-104) 1069 w/o tables 4.91 971 3.88 (x0.79) 992 (+21) 894 with 6.44 576 3.69 (x0.57) 628 (+52) 547 Shared time - average time on cases solved by both. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 34 / 36
Future work Non-clausal conflict analysis, Interpolation algorithms ( ), Word-level model checking? Performance, performance, performance. Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 35 / 36
Summary PCS is a COOL CSP solver, which Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 36 / 36
Summary PCS is a COOL CSP solver, which... performs similar to Mistral, but Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 36 / 36
Summary PCS is a COOL CSP solver, which... performs similar to Mistral, but... produces machine-checkable proofs. PCS: http://tx.technion.ac.il/ mveksler/pcs/index.html Michael Veksler Ofer Strichman (Technion - Israel A Proof-Producing Institute of Technology[3 CSP Solverpt] CSP SAT June ) 18, 2011 36 / 36