Data structures with arithmetic constraints: non-disjoint combinations E. Nicolini, C. Ringeissen, and M. Rusinowitch LORIA & INRIA-Lorraine ADDCT-UNIF 09 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 1 / 25
Outline Introduction 1 Data Structures 2 Arithmetic 3 Background on Combination 4 Conclusion 5 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 2 / 25
Introduction Outline Introduction 1 Data Structures 2 Arithmetic 3 Background on Combination 4 Conclusion 5 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 3 / 25
Introduction Building Decision Procedures The most investigated approaches: Rewriting techniques ◮ use a superposition calculus for FOL with Equality and prove its termination for useful cases in verification ➼ Application to data structures [ARR03, ABRS09, BE07, dMB08] Combination techniques ◮ use procedures available for individual theories and try to build a procedure for the union of theories ➼ Application to the union of data structures and fragments of arithmetic [KRRT05] Our approach: blend both the approaches to combine data structures sharing some arithmetic operators ➼ Application of the combination method proposed by Ghilardi-Nicolini-Zucchelli [GNZ08]: a combination method à la inrialoria-logo Nelson-Oppen [NO79] for non-disjoint unions of theories E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 4 / 25
Data Structures Outline Introduction 1 Data Structures 2 Arithmetic 3 Background on Combination 4 Conclusion 5 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 5 / 25
Data Structures Data structures using arithmetic operators Lists : nil : LISTS , cons : ELEM × LISTS → LISTS , ℓ : LISTS → NUM ℓ ( nil ) = 0 ℓ ( cons ( x , y )) = s ( ℓ ( y )) Trees : bin : ELEM × TREES × TREES → TREES , null : TREES , size : TREES → NUM size ( null ) = 0 size ( bin ( e , t 1 , t 2 )) = size ( t 1 )+ size ( t 2 )+ 1 0 � = 1 Records : sel i : RECS → NUM , inc : RECS → RECS sel i ( inc ( r )) = s ( sel i ( r )) for any index i of sort NUM . inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 6 / 25
Data Structures Possible shared theories (Inj) ∀ x , y s ( x ) = s ( y ) → x = y ∀ x x � = s n ( x ) for all n ∈ N + (Acy) (S0) ∀ x s ( x ) � = 0 Theory of Integer Offsets [NRR09c]: T I = { Inj , Acy , S 0 } 1 Theory of Increment [NRR09b]: T S = { Inj , Acy } 2 Theory of Abelian Groups [NRR09a]: 3 AG = AC (+) ∪ { x + ( − x ) = 0 , x + 0 = x } inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 7 / 25
Data Structures Superposition Calculus l [ u ′ ] = r u = t Superposition ( i ) , ( ii ) , ( iii ) , ( iv ) ( l [ t ] = r ) σ l [ u ′ ] � = r u = t Paramodulation ( i ) , ( ii ) , ( iii ) , ( iv ) ( l [ t ] � = r ) σ u ′ � = u Reflection ( i ) ⊥ where (i) σ is the most general unifier of u and u ′ , (ii) u ′ is not a variable , (iii) u σ �� t σ , (iv) l [ u ′ ] σ �� r σ . Figure: Expansion Inference Rules. inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 8 / 25
Data Structures Superposition Calculus (for a successor function) Ad hoc rules to be applied to ground terms: S ∪ { s ( u ) = s ( v ) } R1 (for Inj) S ∪ { u = v } S ∪ { s ( u ) = t , s ( v ) = t } if s ( u ) ≻ t , s ( v ) ≻ t and u ≻ v R2 (for Inj) S ∪ { s ( v ) = t , u = v } S ∪ { s n ( t ) = t } C1 (for Acy) if n ∈ N S ∪ { s n ( t ) = t } ∪ ⊥ S ∪ { s ( t ) = 0 } C2 (for S 0 ) S ∪ { s ( t ) = 0 } ∪ ⊥ where S is a set of literals and ⊥ is the symbol for the inconsistency. Figure: Ground reduction Inference Rules. inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 9 / 25
Data Structures Superposition Calculi as Decision Procedures Result ([NRR09c, NRR09b]) An appropriate Superposition Calculus leads to a decision procedure for a class of theories modelling data-structures with the unary successor function. ➼ Examples: Lists with length, Records with increment Result ([NRR09a]) A Superposition Calculus modulo AG leads to a decision procedure for a class of theories modelling data-structures with the binary addition function. ➼ Examples: previous ones + Trees with size. Proof ( AG case): A many-sorted and unconstrained version the Superposition Calculus 1 modulo AG developed by Godoy-Nieuwenhuis [GN04] Use of AG -unification with free symbols 2 inrialoria-logo Considered theories: unit clauses with no variable of sort AG 3 E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 10 / 25
Arithmetic Outline Introduction 1 Data Structures 2 Arithmetic 3 Background on Combination 4 Conclusion 5 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 11 / 25
Arithmetic Linear Arithmetic Σ Q := { 0 , 1 , + , − , { f q } q ∈ Q , s , < } , where 0 , 1 are constants, − , f q , s are unary function symbols. Let T Q be the set of all the Σ Q -sentences that are true in Q . Fact A T Q -satisfiability procedure can be obtained by using Fourier-Motzkin Elimination (for inequalities) 1 ➼ to detect unsatisfiability or to compute implicit equalities Gauss Elimination (for equalities) 2 ➼ a function solve to compute the solved form of a set of equalities Disequality Handler 3 ➼ a function canon over arithmetic expressions to check whether an disequality can be canonized into an unsatisfiable disequality u � = u . inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 12 / 25
Arithmetic Non-Linear Arithmetic: The Theory of Q -Algebras T Q − alg is AC (+) ∪ AC ( × ) ∪ U (+ , 0 ) ∪ U ( × , 1 ) plus ∀ x x + ( − x ) = 0 (1) 0 � = 1 (2) ∀ x s ( x ) = x + 1 (3) ∀ x , y , z ( x + y ) z = xz + yz (4) ∀ x , y q ( x + y ) = qx + qy (5) ∀ x ( q 1 ⊕ q 2 ) x = q 1 x + q 2 x (6) ∀ x ( q 1 · q 2 ) x = q 1 ( q 2 x ) (7) ∀ x 1 Q x = x (8) ∀ x , y q ( xy ) = x ( qy ) (9) Fact A T Q − alg -satisfiability procedure can be obtained by using the inrialoria-logo Buchberger algorithm for the computation of Groebner bases. E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 13 / 25
Background on Combination Outline Introduction 1 Data Structures 2 Arithmetic 3 Background on Combination 4 Conclusion 5 inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 14 / 25
Background on Combination A combination problem y = ℓ ( a ) Γ 1 = b = cons ( e , a ) x = ℓ ( b ) � u ≥ 0 � Γ 2 = x + u = y Satisfiability of Γ 1 ∪ Γ 2 ? Γ 1 ∪ Γ 2 is unsatisfiable since Γ 1 → x = s ( y ) Γ 2 ∪ { x = s ( y ) } is T 2 -unsatisfiable: Γ 2 ∪ { x = s ( y ) } ↔ { u ≥ 0 , u = − 1 } inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 15 / 25
Background on Combination A combination problem y = ℓ ( a ) Γ 1 = b = cons ( e , a ) x = ℓ ( b ) � u ≥ 0 � Γ 2 = x + u = y Satisfiability of Γ 1 ∪ Γ 2 ? Γ 1 ∪ Γ 2 is unsatisfiable since Γ 1 → x = s ( y ) Γ 2 ∪ { x = s ( y ) } is T 2 -unsatisfiable: Γ 2 ∪ { x = s ( y ) } ↔ { u ≥ 0 , u = − 1 } inrialoria-logo E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 15 / 25
Background on Combination Non-disjoint combination method (à la Nelson-Oppen) Combination method developed by Ghilardi-Nicolini-Zucchelli [GNZ08]: Let T 0 = T 1 ∩ T 2 and Σ 0 = Σ 1 ∩ Σ 2 Purification Given a set of T 1 ∪ T 2 -constraints Γ , produce an equisatisfiable set of pure constraints Γ 1 ∪ Γ 2 ; Propagation the T 1 -constraint solving procedure and the T 2 -constraint solving procedure fairly exchange shared positive Σ 0 -clauses that are entailed by T 1 ∪ Γ 1 and by T 2 ∪ Γ 2 Until an inconsistency is detected or a saturation state is reached. Pseudo-code: 1. If T 0 -basis T i (Γ i ) = ∆ i and ⊥ / ∈ ∆ i for each i ∈ { 1 , 2 } , then 1.1. For each D ∈ ∆ i such that T j ∪ Γ j �| = D , ( i � = j ), add D to Γ j 1.2. If Γ 1 or Γ 2 has been changed in 1.1 , then rerun 1. Else return Unsatisfiable inrialoria-logo 2. Return Satisfiable . E. Nicolini et al. (LORIA & INRIA-Lorraine) Data structures with arithmetic constraints ADDCT-UNIF 09 16 / 25
Recommend
More recommend