Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.

Slides:



Advertisements
Similar presentations
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Advertisements

Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Max Cut Problem Daniel Natapov.
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Weizmann Institute Deciding equality formulas by small domain instantiations O. Shtrichman The Weizmann Institute Joint work with A.Pnueli, Y.Rodeh, M.Siegel.
Carnegie Mellon University Boolean Satisfiability with Transitivity Constraints Boolean Satisfiability with Transitivity Constraints
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part III – Decision Procedures for Equality Logic and Uninterpreted Functions.
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
SAT-Based Decision Procedures for Subsets of First-Order Logic
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part II – Equality Logic and Uninterpreted Functions.
Ofer Strichman, Technion Deciding Combined Theories.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Binary Decision Diagrams (BDDs)
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic Range Allocation.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
28.
NPC.
CSC 413/513: Intro to Algorithms
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
1 A framework for eager encoding Daniel Kroening ETH, Switzerland Ofer Strichman Technion, Israel (Executive summary) (submitted to: Formal Aspects of.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
Decision Procedures in First Order Logic
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
Decision Procedures in Equality Logic
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
NP-Complete Problems.
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CS154, Lecture 16: More NP-Complete Problems; PCPs
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Lecture 23 NP-Hard Problems
Presentation transcript:

Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel

Technion2 Equality Logic A Boolean combination of equalities ( x 1 = x 2 Æ ( x 2  x 3 Ç x 1  x 3 )) x 1, x 2, x 3 2 N Typically combined with Uninterpreted Functions (EUF) The decision problem for Equality Logic: NP – C

Technion3 Basic notions  E : x = y Æ y = z Æ z  x x y z (non-polar) Equality Graph: Gives an abstract view of  E

Technion4 From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method  E : x 1 = x 2 Æ x 2 = x 3 Æ x 1  x 3  sk : e 1,2 Æ e 2,3 Æ :e 1,3 Encode all edges with Boolean variables  This is an abstraction  Transitivity of equality is lost!  Must add transitivity constraints! e 1,3 e 1,2 e 2,3 x1x1 x2x2 x3x3

Technion5 From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method  E : x 1 = x 2 Æ x 2 = x 3 Æ x 1  x 3  sk : e 1,2 Æ e 2,3 Æ :e 1,3 Transitivity Constraints: For each cycle of size n, forbid a true assignment to n -1 edges T S = ( e 1,2 Æ e 2,3 ! e 1,3 ) Æ ( e 1,2 Æ e 1,3 ! e 2,3 ) Æ ( e 1,3 Æ e 2,3 ! e 1,2 ) Check:  sk Æ T S e 1,3 e 1,2 e 2,3 x1x1 x2x2 x3x3

Technion6 Thm-1: It is sufficient to constrain chord-free simple cycles There can be an exponential number of chord-free simple cycles… e1e1 e2e2 e3e3 e4e4 e5e5 T T T F T F From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method

Technion7 Make the graph ‘chordal’. In a chordal graph, it is sufficient to constrain only triangles. Polynomial # of edges and constraints. # constraints = 3 £ #triangles From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method

Technion8 An improvement Reduced Transitivity Constraints (RTC) So far we did not consider the polarity of the edges. Assuming  E is in Negation Normal Form  E : x = y Æ y = z Æ z  x x y z (polar) Equality Graph: = = 

Technion9 Monotonicity of NNF Thm-2: NNF formulas are monotonically satisfied (in CNF this is simply the pure literal rule)  ’’ Satisfied literals  ²  !  ’ ²   :  ’: 1 1  : ( x 1 Æ : x 2 ) Ç ( x 2 Ç ( x 3 Æ x 1 ))

Technion10 Here, T R = e 3 Æ e 2 ! e 1 is sufficient This is only true because of monotonicity of NNF An improvement Reduced Transitivity Constraints (RTC) e1e1 e2e2 e3e3 x z y = =  Allowing e.g.  x = z, x = y, z  y F T T T  ’: x = z, x = y, z = y

Technion11 Definitions Dfn-1: A contradictory cycle is a cycle with exactly one disequality edge. Dfn-2: A contradictory Cycle C is constrained under T  if T does not allow an assignment in which dashed edges are True and the solid edge is False. C = F T T T T 

Technion12 Main theorem Let T R be a conjunction of transitivity constraints. If T R constrains all simple contradictory cycles then  E is satisfiable iff  sk Æ T R is satisfiable The Equality Formula

Technion13 Proof strategy for the main theorem (  ) Proof strategy:  Let  R be a satisfying assignment to  sk Æ T R  We will construct  S that satisfies  sk Æ T S  From this we will conclude that  E is satisfiable Skip proof

Technion14 Transitivity: 5 constraints RTC: 0 constraints Transitivity: 5 constraints RTC: 1 constraint F T T T T

Technion15 Applying RTC How can we use the theorem without enumerating contradictory cycles ? Answer:  Consider the chordal graph.  Still – which triangles ? in which direction?

Technion16 x0x0 x1x1 x2x2 x3x3 x4x4 x5x5 Our CAV’05 solution Exp # cycles to traverse. Solution: Stop before adding an existing constraint With a cost: must constrain non-simple cycles as well. cache: e 0,2 Æ e 1,2  e 0,1 e 1,3 Æ e 2,3  e 1,2 e 2,4 Æ e 3,4  e 2,3 e 4,5 Æ e 3,5  e 3,4

Technion17 Should we constrain this triangle? In which direction ? T T T T T T T

Technion18 1. Focus on Bi-connected dashed components built on top of a solid edge  Includes all contradictory cycles involving this edge 2. Make the graph chordal

Technion19 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 Constraining simple contradictory cycles eses x7x7 1.Focus on each solid edge e s separately - (find its dashed Bi-connected component) 2. Make the graph chordal Do we need: e 5,6 Æ e 3,6 ! e 3,5 ?

Technion20 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 Constraining simple contradictory cycles eses Do we need: e 5,6 Æ e 3,6 ! e 3,5 ? yes! Do we need: e 3,5 Æ e 3,6 ! e 5,6 ?

Technion21 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 Constraining simple contradictory cycles 3. Remove a vertex x k that leans on an edge ( x i, x j ) 4. Is ( x i, x j ) on a simple cycle with e s ? O(|E|) 5. If yes, add (e k,i Æ e k,j ! e i,j ) eses e 5,6 Æ e 3,6  e 3,5

Technion22 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 Constraining simple contradictory cycles 1. Remove a vertex v k that leans on an edge (v i,v j ) 2. Does (v i,v j ) on the same simple cycle with e s ? 3. If yes, add (e k,i Æ e k,j ! e i,j ) eses e 5,6 Æ e 3,6  e 3,5

Technion23 Random graphs (Satisfiable)

Technion24 Results – random graphs V=200, E=800, 16 random topologies # constraints: reduction of 17% Run time: reduction of 32%

Technion25 Results – random graphs V=200, E=800, 16 random topologies # constraints: reduction of 17% Run time: reduction of 32%

Technion26 A crafted example 2 n assignments satisfy  sk. None satisfy the theory.

Technion27 Results Uclid benchmarks* (all unsat) * Results strongly depend on the reduction method of Uninterpreted Functions.

Technion28 Possible refutations of CNF’s generated by Sparse T R T S – T R B P3 P1 P0 P4 Thm: B is satisfiable ! B Æ ( T S – T R ) is satisfiable T S B Æ P2 Constraints of the form e 1 Æ e 2 ! e 3 Hypothesis: ( T S – T R ) clauses hardly participate in the proof P2 Boolean Encoding Transitivity constraints A P3 proof exists according to the main theorem.

Technion29 T S - T R T R B T S - T R T R B Average on: 10 graphs, ~890K clauses All Unsat Sparse: ~ 22 sec. RTC: ~ 12 Sec. B – Boolean encoding T R – RTC constraints T S – Sparse constraints

Technion30 Summary The RTC method is ~dominant over the Sparse method. Open issue: find a P-time algorithm that exploits the full power of the main theorem.

Technion31 vkvk vivi vjvj eses 1. Consider each solid edge e s separately 2. Remove a vertex v k that leans on an edge (v i,v j ) 3. Does (v i,v j ) on the same simple cycle with e s ? 4. If yes, add (e k,i Æ e k,j ! e i,j )

Technion32 Focus on Bi-connected dashed components built on top of a solid edge  Includes all contradictory cycles involving this edge

Technion33 Make the component chordal (by adding edges).

Technion34 The RTC algorithm For each vertex v:  remove v

Technion35 Constrains all contradictory cycles Constraints cache:  e 2 Æ e 3 ! e 1  e 4 Æ e 7 ! e 2  e 6 Æ e 3 ! e 4 Expanding only simple cycles requires the removal of the cache condition. Can it still be done in P time ?

Technion36 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 The constraint e 3,6 Æ e 3,5  e 5,6 is not added Constraining simple contradictory cycles cache: … e 5,6 Æ e 4,6  e 4,5 Open problem: constrain simple contradictory cycles in P time

Technion37 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 the constraint e 3,6 Æ e 3,5  e 5,6 is not added, though needed Suppose the graph has 3 more edges Constraining simple contradictory cycles cache: … e 5,6 Æ e 4,6  e 4,5 Here we will stop, although … Open problem: constrain simple contradictory cycles in P time

Technion38 Example: Circuit Transformations A pipeline processes data in stages Data is processed in parallel – as in an assembly line Formal Model: Stage 1 Stage 3 Stage 2

Technion39 Example: Circuit Transformations The maximum clock frequency depends on the longest path between two latches Note that the output of g is used as input to k We want to speed up the design by postponing k to the third stage

Technion40 Validating Circuit Transformations = ?

Technion41 Validating a compilation process Source program z = ( x 1 + y 1 )  ( x 2 + y 2 ); Target program u 1 = x 1 + y 1 ; u 2 = x 2 + y 2 ; z = u 1  u 2 ; Need to prove that: ( u 1 = x 1 + y 1  u 2 = x 2 + y 2  z = u 1  u 2 ) $ z = ( x 1 + y 1 )  ( x 2 + y 2 ) Compilation Target Source

Technion42 Validating a compilation process Need to prove that: ( u 1 = x 1 + y 1  u 2 = x 2 + y 2  z = u 1  u 2 ) $ z = ( x 1 + y 1 )  ( x 2 + y 2 ) f1f1 f2f2 g1g1 g2g2 f1f1 f2f2 Source program z = ( x 1 + y 1 )  ( x 2 + y 2 ); Target program u 1 = x 1 + y 1 ; u 2 = x 2 + y 2 ; z = u 1  u 2 ; Compilation

Technion43 Need to prove that: ( u 1 = x 1 + y 1  u 2 = x 2 + y 2  z = u 1  u 2 ) $ z = ( x 1 + y 1 )  ( x 2 + y 2 ) f1f1 f2f2 g1g1 g2g2 f1f1 f2f2 Instead, prove: under functional consistency: for every uninterpreted function f x = y ! f ( x ) = f ( y ) Which translates to (via Ackermann’s reduction): Validating a compilation process

Technion44 Dfn: A graph is chordal iff every cycle of size 4 or more has a chord. How to make a graph chordal ? eliminate vertices one at a time, and connect their neighbors. From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method

Technion45 Definitions for the proof… A Violating cycle under an assignment  R  This assignment violates T S but not necessarily T R eFeF e T2 e T1 T T F Either dashed or solid

Technion46 More definitions for the proof… An edge e = ( v i, v j ) is equal under an assignment  iff there is an equality path between v i and v j all assigned T under  Denote: T T F T T v1v1 v2v2 v3v3

Technion47 More definitions for the proof… An edge e = ( v i, v j ) is disequal under an assignment  iff there is a disequality path between v i and v j in which the solid edge is the only one assigned false by  Denote: T T F T T v1v1 v2v2 v3v3

Technion48 Proof… Observation 1: The combination is impossible if  =  R (recall:  R ² T R ) Observation 2: if ( v 1, v 3 ) is solid, then F T T v1v1 v2v2 v3v3

Technion49 ReConstructing  S Type 1: It is not the case that Assign  S ( e 23 ) = F Type 2: Otherwise it is not the case that Assign  ( e 13 ) = T F T T In all other cases  S =  R F T T  F  T v1v1 v2v2 v3v3 v1v1 v2v2 v3v3

Technion50 ReConstructing  S Starting from  R, repeat until convergence:   ( e T ) := F in all Type 1 cycles   ( e F ) := T in all Type 2 cycles All Type 1 and Type 2 triangles now satisfy T S B is still satisfied (monotonicity of NNF) Left to prove: all contradictory cycles are still satisfied

Technion51 Proof… Invariant: contradictory cycles are not violating throughout the reconstruction. contradicts the precondition to make this assignment… F T T v1v1 v2v2 v3v3  F T T

Technion52 Proof… Invariant: contradictory cycles are not violating throughout the reconstruction. contradicts the precondition to make this assignment… F T T v1v1 v2v2 v3v3  T T F

Technion53 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 The constraint e 3,6 Æ e 3,5  e 5,6 is not added Constraining simple contradictory cycles cache: … e 5,6 Æ e 4,6  e 4,5 Open problem: constrain simple contradictory cycles in P time

Technion54 x0x0 x1x1 x2x2 x3x3 x6x6 x4x4 x5x5 the constraint e 3,6 Æ e 3,5  e 5,6 is not added, though needed Suppose the graph has 3 more edges Constraining simple contradictory cycles cache: … e 5,6 Æ e 4,6  e 4,5 Here we will stop, although … Open problem: constrain simple contradictory cycles in P time

Technion55 Equality Logic  E :( x 1 = x 2 Æ ( x 2  x 3 Ç x 1  x 3 )) A: Mainly when combined with Uninterpreted Functions f ( x, y ), g ( z ),… Uninterpreted Functions can be reduced to Equality Logic via e.g. Ackermann’s reduction. Mainly used in proving equivalences, but not only

Technion56 Thm-1: It is sufficient to constrain simple cycles only e1e1 e2e2 e3e3 e4e4 e5e5 e6e6 T TT TT F From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method

Technion57 Still, there can be an exponential number of chord- free simple cycles… Solution: make the graph ‘chordal’ by adding edges. …. From Equality to Propositional Logic Bryant & Velev CAV’00 – the Sparse method

Technion58 Basic notions Equality Path: a path made of equalities. we write x =* z Disequality Path: a path made of equalities and exactly one disequality. We write x  * y Contradictory Cycle: two nodes x and y, s.t. x= * y and x  * y form a contradictory cycle x y z

Technion59 Basic notions Thm-4: Every contradictory cycle is either simple or contains a simple contradictory cycle