A Proof-Producing CSP Solver 1

Similar documents
SAT and SMT-based Interactive Configuration for Container Vessel Stowage Planning

G53CLP Constraint Logic Programming

CS472 Foundations of Artificial Intelligence. Final Exam December 19, :30pm

Utilizing Don t Care States in SAT-based Bounded Sequential Problems

Depth-bounded Discrepancy Search

Application of Bayesian Networks to Shopping Assistance

Robust Task Execution: Procedural and Model-based. Outline. Desiderata: Robust Task-level Execution

CENG 466 Artificial Intelligence. Lecture 4 Solving Problems by Searching (II)

Aryeh Rappaport Avinoam Meir. Schedule automation

SEARCH TREE. Generating the children of a node

Better Search Improved Uninformed Search CIS 32

6.034 Artificial Intelligence

FEATURES. Features. UCI Machine Learning Repository. Admin 9/23/13

Lecture 10. Support Vector Machines (cont.)

Knot Theory Week 2: Tricolorability

SEARCH SEARCH TREE. Node: State in state tree. Root node: Top of state tree

Transformer fault diagnosis using Dissolved Gas Analysis technology and Bayesian networks

Abstract Currently there is a growing interest in the evolutionary algorithm paradigm, as it promises a robust and general search technique. Still, in

CSE 3401: Intro to AI & LP Uninformed Search II

The Safety Case. The safety case

Theo and Octopus at CASC-J3 Monty Newborn

CS 221 PROJECT FINAL

Queue analysis for the toll station of the Öresund fixed link. Pontus Matstoms *

The Safety Case. Structure of Safety Cases Safety Argument Notation

Math Spring Operational Geometry PBA Item #18 Classmates in the Pool VH003506

Uninformed search strategies

D-Case Modeling Guide for Target System

Analysis of the Article Entitled: Improved Cube Handling in Races: Insights with Isight

Uninformed search methods II.

The notion of independence in the theory of evidence: An algebraic study

Advanced Search Hill climbing

UNDERSTANDING A DIVE COMPUTER. by S. Angelini, Ph.D. Mares S.p.A.

Math Released Item Grade 4 M03436

A SEMI-PRESSURE-DRIVEN APPROACH TO RELIABILITY ASSESSMENT OF WATER DISTRIBUTION NETWORKS

At each type of conflict location, the risk is affected by certain parameters:

Introduction to Alloy

Artificial Intelligence for the EChO Mission Scheduler

Problem Solving as Search - I

OPTIMAL FLOWSHOP SCHEDULING WITH DUE DATES AND PENALTY COSTS

Atmospheric Rossby Waves Fall 2012: Analysis of Northern and Southern 500hPa Height Fields and Zonal Wind Speed

Online Companion to Using Simulation to Help Manage the Pace of Play in Golf

WESEP 594 Research Seminar

Generating None-Plans in Order to Find Plans 1

Tennis Victoria Club Guide Coach Relationship

#19 MONITORING AND PREDICTING PEDESTRIAN BEHAVIOR USING TRAFFIC CAMERAS

consist of friends, is open to all ages, and considers fair play of paramount importance. The matches are played without referees, since, according to

A Study of Olympic Winning Times

Lecture 04 ( ) Hazard Analysis. Systeme hoher Qualität und Sicherheit Universität Bremen WS 2015/2016

A new Decomposition Algorithm for Multistage Stochastic Programs with Endogenous Uncertainties

TERMINATION FOR HYBRID TABLEAUS

Reasoning for Ontology Engineering and Usage

Introduction. AI and Searching. Simple Example. Simple Example. Now a Bit Harder. From Hammersmith to King s Cross

C. Mokkapati 1 A PRACTICAL RISK AND SAFETY ASSESSMENT METHODOLOGY FOR SAFETY- CRITICAL SYSTEMS

1.1 The size of the search space Modeling the problem Change over time Constraints... 21

Solving Problems by Searching chap3 1. Problem-Solving Agents

Investigating the Problems of Ship Propulsion on a Supercomputer

Uninformed search methods II.

Flock Theory, Applied (To Scrum)

Lossless Comparison of Nested Software Decompositions

Uninformed search methods

Quantitative Aptitude Time and Work Problems for the Electrical Engineer

Ten Problems About Twenty- Five Horses

Modern volleyball aspects

Waves & Interference

CSE 3402: Intro to Artificial Intelligence Uninformed Search II

PSM I PROFESSIONAL SCRUM MASTER

T H E R M O P T I M CALCULATION OF MOIST GAS FROM EXTERNAL CLASSES VERSION JAVA 1.5 R. GICQUEL MARCH 2007

Math Released Item Grade 4 PBA Item #17 Number of Baskets VF565302

Analysis and Research of Mooring System. Jiahui Fan*

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Uninformed search methods

Game Theory (MBA 217) Final Paper. Chow Heavy Industries Ty Chow Kenny Miller Simiso Nzima Scott Winder

CITIUS ALTIUS FORTIUS: Lessons learned from the Theorem Prover WALDMEISTER

Introduction to Pattern Recognition

Formula One Race Strategy

David DiPierro, John Amberson. Steering Committee Meeting #4 Overview

4.) There are no forces of attraction or repulsion between gas particles. This means that

Planning. CS 510: Intro to AI October 19 th 2017

Fishery Improvement Projects

Dealing with Dependent Failures in Distributed Systems

CSC242: Intro to AI. Lecture 21

Blocking Presupposition by Causal and Identity Inferences. Henk Zeevat SFB991,Heinrich Heine University Düsseldorf & ILLC, Amsterdam University

Problem Solving Agents

Uninformed Search (Ch )

Compensator Design for Speed Control of DC Motor by Root Locus Approach using MATLAB

Hazard analysis. István Majzik Budapest University of Technology and Economics Dept. of Measurement and Information Systems

CSC384: Introduction to Artificial Intelligence. Search

OPERATIONAL AMV PRODUCTS DERIVED WITH METEOSAT-6 RAPID SCAN DATA. Arthur de Smet. EUMETSAT, Am Kavalleriesand 31, D Darmstadt, Germany ABSTRACT

Lesson 22: Average Rate of Change

Multiagent Classical Planning

Products and Services HR3D, AUV3D

Excel Solver Case: Beach Town Lifeguard Scheduling

Wind Farm Blockage: Searching for Suitable Validation Data

ECONOMIC COMPETITION AND THE PRODUCTION OF WINNING IN PROFESSIONAL SPORTS KEVIN P. MONGEON. A dissertation submitted in partial fulfillment of

Windcube FCR measurements

Algebra I: A Fresh Approach. By Christy Walters

midas Gen V.741 Enhancements Analysis & Design Part

From Bombe stops to Enigma keys

Numerical simulation of the ALBA s synchrotron cooling system response to pump start-up and shut-down Page 1

Calculation of Trail Usage from Counter Data

Transcription:

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