in irst Order Logic for Equality Logic Part III for Equality Logic and Uninterpreted unctions Algorithm I rom 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? inding a small adequate range (domain) to each variable Reducing to Propositional Logic Daniel Kroening and Ofer Strichman 1 An algorithmic point of view 2 for Equality Logic We will first investigate methods that solve Equality Logic. Uninterpreted functions are eliminated with one of the reduction schemes. rom 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 e 3 e 2 e1 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 An algorithmic point of view 3 Encode all edges with Boolean variables (note: for now, ignore polarity) his is an abstraction ransitivity of equality is lost! Must add transitivity constraints! An algorithmic point of view 4 1
rom Equality to Propositional Logic rom Equality to Propositional Logic φ E = (x 1 = x 2 x 2 = x 3 x 1 x 3 φ enc = e 1 e 2 e 3 e 3 e 2 e1 here can be an exponential number of cycles, so let s try to make it better. hm: it suffices to constrain simple cycles only. or 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 ) e 1 e 2 e 3 e4 e 6? e 5 Check: φ enc φ trans An algorithmic point of view 5 An algorithmic point of view 6 rom Equality to Propositional Logic rom Equality to Propositional Logic Still, there is an exponential number of simple cycles. hm [Bryant & Velev]: It suffices to constrain chordfree simple cycles Still, there can be an exponential number of chordfree simple cycles.? e 1 e 2 e 5 e 3 e 4. An algorithmic point of view 7 An algorithmic point of view 8 2
rom Equality to Propositional Logic rom Equality to Propositional Logic Still, there can be an exponential number of chordfree simple cycles Still, there can be an exponential number of chordfree simple cycles... An algorithmic point of view 9 An algorithmic point of view 10 rom Equality to Propositional Logic rom Equality to Propositional Logic Still, there can be an exponential number of chordfree simple cycles Still, there can be an exponential number of chordfree simple cycles.. Solution: make the graph chordal by adding edges. An algorithmic point of view 11 An algorithmic point of view 12 3
rom Equality to Propositional Logic rom 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. Once the graph is chordal, we can constrain only the triangles.? An algorithmic point of view 13 Note that this procedure adds not more than a polynomial # of edges, and results in a polynomial number of constraints. An algorithmic point of view 14 Improvement So far we did not consider the polarity of the edges. Claim: in the following graph φ rtc = e 3 e 2 e 1 is sufficient Skipping rest of this set of slides. Left here for completeness (but they need work). e 3 e 1 e 2 his is only true because of monotonicity of NN An algorithmic point of view 15 An algorithmic point of view 16 4
Definitions Dfn: A contradictory Cycle C is constrained under formula if does not allow this assignment Main theorem If R constrains all simple contradictory cycles, and or every assignment α S, α S - S α S - R C = then rom the Sparse method φ E is satisfiable iff B R is satisfiable An algorithmic point of view 17 he Equality ormula An algorithmic point of view 18 ransitivity: 5 constraints RC: 0 constraints Proof of the main theorem ( ) φ E is satisfiable B S is satisfiable B R is satisfiable ransitivity: 5 constraints RC: 1 constraint ( ) Proof strategy: Let α R be a satisfying assignment to B R We will construct α S that satisfies B S rom this we will conclude that φe is satisfiable An algorithmic point of view 19 Skip proof An algorithmic point of view 20 5
Definitions for the proof A Violating cycle under an assignment α R : 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 under α. Denote: e e 1 Either dashed or solid e 2 his assignment violates S but not necessarily R v 1 v2 An algorithmic point of view 21 An algorithmic point of view 22 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: v 1 v2 Proof Observation 1: he combination is impossible if α= α R (recall: α R ² R) Observation 2: if (v 1, ) is solid, then v 1 v2 An algorithmic point of view 23 An algorithmic point of view 24 6
ReConstructing α S ReConstructing α S ype 1: It is not the case that ype 2: Otherwise it is not the case that Starting from α R, repeat until convergence: α(e ) := in all ype 1 cycles α(e ) := in all ype 2 cycles v 1 v2 v 1 v 2 All ype 1 and ype 2 triangles now satisfy S B is still satisfied (monotonicity of NN) Left to prove: all contradictory cycles are still satisfied Assign α S (e 23 ) = Assign α (e 13 ) = In all other cases α S = α R An algorithmic point of view 25 An algorithmic point of view 26 Proof Invariant: contradictory cycles are not violating throughout the reconstruction. Proof Invariant: contradictory cycles are not violating throughout the reconstruction. v 1 v 2 contradicts the precondition to make this assignment An algorithmic point of view 27 v 1 v 2 contradicts the precondition to make this assignment An algorithmic point of view 28 7
Applying RC 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? he RC algorithm Bi-Connected Component (BCC) maximal set of edges s.t. any two edges in the set lie on a common simple cycle. ind all BCC-s with one solid edge. Add solid chords from the graph, and auxiliary dashed chords to make the BCC chordal. An algorithmic point of view 29 An algorithmic point of view 30 Should we constrain this triangle? In which direction? Is this constraint necessary? Decomposing the graph ocus on Bi-connected dashed components built on top of a solid edge Includes all contradictory cycles involving this edge An algorithmic point of view 31 An algorithmic point of view 32 8
Make the component chordal Chordal-ity guarantees: every cycle contains a simplicial vertex, i.e. a vertex that its neighbors are connected. he RC algorithm Constraints cache: e 2 e 3 e 1 e 4 e 7 e 2 e 5 e 8 e 4 5 8 4 9 6 3 1 2 7 11 12 An algorithmic point of view 33 An algorithmic point of view 34 Constrains all contradictory cycles Constraints cache: Results random graphs e 2 e 3 e 1 e 4 e 7 e 2 e 6 e 3 e 4 5 8 4 9 6 3 1 2 7 11 12 V=200, E=800, 16 random topologies An algorithmic point of view 35 An algorithmic point of view 36 9
Random graphs (Satisfiable) An algorithmic point of view 37 10