Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

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

2 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    

3 Decision Procedures An algorithmic point of view3 Range allocation The small model property Range Allocation

4 Decision Procedures An algorithmic point of view4 To a formula with uninterpreted functions Uninterpreted functions From a general formula:

5 Decision Procedures An algorithmic point of view5 From a formula with uninterpreted functions: To a formula in the theory of equality Ackerman’s reduction

6 Decision Procedures An algorithmic point of view6 The Small Model Property Equality Logic enjoys the Small Model Property This means that if a formula in this logic is satisfiable, then there is a finite, bounded in size, model that satisfies it. It gets better: in Equality Logic we can compute this bound, which suggests a decision procedure. What is this bound?

7 Decision Procedures An algorithmic point of view7 The Small Model Property Claim: the range 1.. n is adequate, where n is the number of variables in  Proof:  Every satisfying assignment defines a partition of the variables  Every assignment that results in the same partitioning also satisfies the formula  The range 1.. n allows all partitionings

8 Decision Procedures An algorithmic point of view8 Complexity We need log n variables to encode the range 1… n For n variables we need n log n bits. This is already better than the worst-case O( n 2 ) bits required by the Boolean encoding method …

9 Decision Procedures An algorithmic point of view9 Instead of giving the range [1..11], analyze connectivity: x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 x 1, y 1, x 2, y 2 :{0-1} u 1, f 1, f 2, u 2 : {0-3}g 1, g 2, z: {0-2} The state-space: from 11 11 to ~10 5 Finite Instantiations revisited

10 Decision Procedures An algorithmic point of view10 Or even better: x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 x 1, y 1, g 1, u 1 : {0} {0}{0}{0-1} An Upper-bound: State-space  n! x 2, y 2, g 2, f 1 : {0-1} u 2 : {0-3} f 2, z: {0-2} The state-space: from ~10 5 to 576

11 Decision Procedures An algorithmic point of view11 Choosing a minimal range for the integer variables 0. a,b,c,d,e : { 1 } ( 1 )(normal) 1.a,b,c,d,e : {1..5} (3125)(1..n) 2. a,b,c: {1..3}(connectivity d,e: {1..2} (108) analysis) 3. a: {1}, b:{1-2}, c: {1-3}(factorial d: {1}, e: {1-2} (12) reduction) 4..........  E : : (( a = b ) Ç : ( b = c )) ! (( d  e ))

12 Decision Procedures An algorithmic point of view12 Before and after, in SMV

13 Decision Procedures An algorithmic point of view13 The Range-Minimization Problem Given an Equality formula  E, find in polynomial time a small domain D* sufficient to preserve its satisfiability In other words: find D* such that  E is satisfiable under an infinite domain D !  E is satisfiable under the finite domain D*

14 Decision Procedures An algorithmic point of view14 The strategy 1. Determine a range allocation R, mapping each variable x i  E into a small set of integers, s.t.  E is satisfiable iff it is satisfiable over some R -interpretation. 2. Encode each variable x i as an enumerated type over R ( x i ), and use a standard satisfiability checker as a decision procedure.

15 Decision Procedures An algorithmic point of view15 What range is adequate ? Recall that a subgraph of an E-Graph G E (  E ) is unsatisfiable iff it contains a contradictory cycle. Dfn: A Range Allocation R is adequate for G E (  E ) if every satisfiable subgraph can be satisfied under R. Now we need an algorithm to find adequate ranges

16 Decision Procedures An algorithmic point of view16 Examples: The price of a polynomial procedure: The predicates of  E hold less information than  E.

17 Decision Procedures An algorithmic point of view17 x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 Building the E-Graph E  : E = : Note: 1. Inconsistent subsets appear as contradictory cycles 2. Some of the vertices are mixed

18 Decision Procedures An algorithmic point of view18 The Range-Allocation Algorithm A. Remove all solid edges not belonging to contradictory cycles. B. Add a single unique value to singleton vertices, and remove them from the graph. x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 {0}{0}{1}{1}{3}{3}{2}{2} Step I - pre-processing:

19 Decision Procedures An algorithmic point of view19 Step II - Set construction: A. For each mixed vertex x i : 1. Add a unique value u i to R ( x i ) 2. Broadcast u i on G = 3. Remove x i from the graph B. Add a unique value to each remaining G = component g1g1 g2g2 z {4}{4} {4}{4} {4}{4} g1g1 z {4, } g1g1 g2g2 z {4}{4} 1.2.

20 Decision Procedures An algorithmic point of view20 u1u1 f1f1 f2f2 u2u2 {6}{6}{6}{6}{6}{6} {6}{6} f1f1 f2f2 u2u2 {6,7}{6,7} {6,7}{6,7} {6,7}{6,7} u2u2 {6,7, } u1u1 f1f1 f2f2 u2u2 {6}{6}{6,7}{6,7} 1. 2. 3. f1f1 {6,7, }

21 Decision Procedures An algorithmic point of view21 x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 {3}{3}{2}{2} {4}{4} {4, } {6}{6}{6,7}{6,7} {6,7, } {1}{1} {0}{0} Is the allocated range adequate? We have to satisfy every consistent subset B :  For all x  B, assign the smallest value allocated in step A to a mixed vertex which is G = (B) connected to x.  If there isn’t any, choose the value given in step B.

22 Decision Procedures An algorithmic point of view22 Further optimizations The order in which mixed vertices are eliminated has a strong effect. Not all mixed vertices need to start from a unique value. An analysis that involves solving a coloring problem can help here… … (see lecture notes)

23 Decision Procedures An algorithmic point of view23 x1x1 x2x2 y1y1 y2y2 g1g1 g2g2 zu1u1 f1f1 f2f2 u2u2 {3}{3}{2}{2} {4}{4} {4,5}{4,5} {4,5}{4,5} {6,7}{6,7} {6}{6}{6}{6}{6,8}{6,8} {1}{1} {0}{0} A state-space story 11 11! 16 1..n1..ibasic ordercolor 4872? 576 connectivity


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

Similar presentations


Ads by Google