Presentation is loading. Please wait.

# Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.

## Presentation on theme: "Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic."— Presentation transcript:

Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic

Decision Procedures An algorithmic point of view2 Part III – Decision Procedures for Equality Logic and Uninterpreted Functions Algorithm I – From Equality to Propositional Logic  Adding transitivity constraints  Making the graph chordal  An improved procedure: consider polarity Algorithm II – Range-Allocation  What is the small-model property?  Finding a small adequate range (domain) to each variable  Reducing to Propositional Logic

Decision Procedures An algorithmic point of view3 We will first investigate methods that solve Equality Logic. Uninterpreted functions are eliminated with one of the reduction schemes. Our starting point: the E-Graph G E (  E ) Recall: G E (  E ) represents an abstraction of  E: It represents ALL equality formulas with the same set of equality predicates as  E Decision Procedures for Equality Logic

Decision Procedures An algorithmic point of view4 From Equality to Propositional Logic Bryant & Velev 2000: the Sparse method  E = x 1 = x 2 Æ x 2 = x 3 Æ x 1  x 3  enc = e 1 Æ e 2 Æ : e 3 Encode all edges with Boolean variables  (note: for now, ignore polarity)  This is an abstraction  Transitivity of equality is lost!  Must add transitivity constraints! e3e3 e2e2 e1e1

Decision Procedures An algorithmic point of view5 From Equality to Propositional Logic  E = x 1 = x 2 Æ x 2 = x 3 Æ x 1  x 3  enc = e 1 Æ e 2 Æ : e 3 For each cycle add a transitivity constraint  trans = ( e 1 Æ e 2 ! e 3 ) Æ ( e 1 Æ e 3 ! e 2 ) Æ ( e 3 Æ e 2 ! e 1 ) Check:  enc Æ  trans e3e3 e2e2 e1e1

Decision Procedures An algorithmic point of view6 From Equality to Propositional Logic There can be an exponential number of cycles, so let’s try to make it better. Thm: it is sufficient to constrain simple cycles only e1e1 e2e2 e3e3 e4e4 e5e5 e6e6 T TT TT F

Decision Procedures An algorithmic point of view7 From Equality to Propositional Logic Still, there is an exponential number of simple cycles. Thm [Bryant & Velev]: It is sufficient to constrain chord-free simple cycles e1e1 e2e2 e3e3 e4e4 e5e5 T T F T F T

Decision Procedures An algorithmic point of view8 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

Decision Procedures An algorithmic point of view9 From Equality to Propositional Logic 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.

Decision Procedures An algorithmic point of view10 From Equality to Propositional Logic Once the graph is chordal, we can constrain only the triangles. Note that this procedure adds not more than a polynomial # of edges, and results in a polynomial no. of constraints. T T T T F TT Contradiction!

Decision Procedures An algorithmic point of view11 Improvement So far we did not consider the polarity of the edges. Claim: in the following graph  trans = e 3 Æ e 2 ! e 1 is sufficient This is only true because of monotonicity of NNF e1e1 e2e2 e3e3

Decision Procedures An algorithmic point of view12 Definitions Dfn: A contradictory Cycle C is constrained under T if T does not allow this assignment C = F T T T T

Decision Procedures An algorithmic point of view13 Main theorem If T R constrains all simple contradictory cycles, and For every assignment  S,  S ² T S !  S ² T R then  E is satisfiable iff B Æ T R is satisfiable The Equality Formula From the Sparse method

Decision Procedures An algorithmic point of view14 Transitivity: 5 constraints RTC: 0 constraints Transitivity: 5 constraints RTC: 1 constraint F T T T T

Decision Procedures An algorithmic point of view15 Proof of the main theorem (  )  E is satisfiable  BÆT S is satisfiable  BÆT R is satisfiable (  ) Proof strategy:  Let  R be a satisfying assignment to B Æ T R  We will construct  S that satisfies B Æ T S  From this we will conclude that  E is satisfiable Skip proof

Decision Procedures An algorithmic point of view16 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

Decision Procedures An algorithmic point of view17 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

Decision Procedures An algorithmic point of view18 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

Decision Procedures An algorithmic point of view19 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

Decision Procedures An algorithmic point of view20 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

Decision Procedures An algorithmic point of view21 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

Decision Procedures An algorithmic point of view22 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

Decision Procedures An algorithmic point of view23 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

Decision Procedures An algorithmic point of view24 Applying RTC How can we use the theorem without enumerating contradictory cycles ? Answer:  Consider the chordal graph.  Constrain triangles if they are part of a (simple) contradictory cycle  How?

Decision Procedures An algorithmic point of view25 The RTC algorithm Bi-Connected Component (BCC) – maximal set of edges s.t. any two edges in the set lie on a common simple cycle. Find all BCC-s with one solid edge. Add solid chords from the graph, and auxiliary dashed chords to make the BCC chordal.

Decision Procedures An algorithmic point of view26 Should we constrain this triangle? In which direction ? Is this constraint necessary ?

Decision Procedures An algorithmic point of view27 Decomposing the graph Focus on Bi-connected dashed components built on top of a solid edge  Includes all contradictory cycles involving this edge

Decision Procedures An algorithmic point of view28 Make the component chordal  Chordal-ity guarantees: every cycle contains a simplicial vertex, i.e. a vertex that its neighbors are connected.

Decision Procedures An algorithmic point of view29 The RTC algorithm Constraints cache:  e 2 Æ e 3 ! e 1  e 4 Æ e 7 ! e 2  e 5 Æ e 8 ! e 4 1 23 4 5 6 8 9 12 11 7

Decision Procedures An algorithmic point of view30 Constrains all contradictory cycles Constraints cache:  e 2 Æ e 3 ! e 1  e 4 Æ e 7 ! e 2  e 6 Æ e 3 ! e 4 1 2 3 4 5 6 8 9 12 11 7

Decision Procedures An algorithmic point of view31 Results – random graphs V=200, E=800, 16 random topologies

Decision Procedures An algorithmic point of view32 Random graphs (Satisfiable)

Download ppt "Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic."

Similar presentations

Ads by Google