Combining Data Structures with Arithmetic Constraints C. Ringeissen - - PowerPoint PPT Presentation

combining data structures with arithmetic constraints
SMART_READER_LITE
LIVE PREVIEW

Combining Data Structures with Arithmetic Constraints C. Ringeissen - - PowerPoint PPT Presentation

Combining Data Structures with Arithmetic Constraints C. Ringeissen j.w.w. Enrica Nicolini and Michal Rusinowitch LORIA & INRIA Nancy Grand Est Sophia, June 2010 inrialoria-logo C. Ringeissen (LORIA & INRIA Nancy) Combining Data


slide-1
SLIDE 1

inrialoria-logo

Combining Data Structures with Arithmetic Constraints

  • C. Ringeissen

j.w.w. Enrica Nicolini and Michaël Rusinowitch

LORIA & INRIA Nancy Grand Est

Sophia, June 2010

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 1 / 23

slide-2
SLIDE 2

inrialoria-logo

Outline

1

Introduction

2

Applications (unions of theories)

3

Superpositions

4

Combinations

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 2 / 23

slide-3
SLIDE 3

inrialoria-logo Introduction

Outline

1

Introduction

2

Applications (unions of theories)

3

Superpositions

4

Combinations

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 3 / 23

slide-4
SLIDE 4

inrialoria-logo Introduction

Building Decision Procedures

Two approaches to obtain decision procedures in a uniform way: Rewrite based techniques

◮ successful when formalizing data-structures ◮ not directly applicable to Arithmetic

Combination techniques

◮ the Nelson-Oppen method is currently implemented in many state

  • f the art SMT tools
  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 4 / 23

slide-5
SLIDE 5

inrialoria-logo Introduction

Building Decision Procedures

Two approaches to obtain decision procedures in a uniform way: Rewrite based techniques

◮ successful when formalizing data-structures ◮ not directly applicable to Arithmetic

Combination techniques

◮ the Nelson-Oppen method is currently implemented in many state

  • f the art SMT tools

◮ limitation: the theories should be over disjoint signatures ❀

restricted expressiveness when writing constraints involving, e.g., both data-structures and arithmetical properties

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 4 / 23

slide-6
SLIDE 6

inrialoria-logo Introduction

Building Decision Procedures

Two approaches to obtain decision procedures in a uniform way: Rewrite based techniques

◮ successful when formalizing data-structures ◮ not directly applicable to Arithmetic

Combination techniques

◮ the Nelson-Oppen method is currently implemented in many state

  • f the art SMT tools

◮ limitation: the theories should be over disjoint signatures ❀ cannot

deal with axioms like ℓ(cons(x, y)) = ℓ(y) + 1

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 4 / 23

slide-7
SLIDE 7

inrialoria-logo Introduction

Our approach

Aim: to design decision procedures for data structures endowed with arithmetic constraints A superposition calculus modulo arithmetic axioms is turned into a rewrite-based decision procedure for interesting theories The calculus is plugged into a non-disjoint combination framework to enrich the expressiveness of the constraints to be checked

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 5 / 23

slide-8
SLIDE 8

inrialoria-logo Applications (unions of theories)

Outline

1

Introduction

2

Applications (unions of theories)

3

Superpositions

4

Combinations

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 6 / 23

slide-9
SLIDE 9

inrialoria-logo Applications (unions of theories)

(Unions of) Theories

Data structures: lists, arrays, records, ... augmented with additional functions defined via arithmetic

  • perators:

1

incrementation

2

addition

Theories of arithmetic

1

Linear arithmetic

2

Non-linear arithmetic

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 7 / 23

slide-10
SLIDE 10

inrialoria-logo Applications (unions of theories)

Recursively defined data structures

nil : DS, cons : ELEM × DS × · · · × DS → DS, car : DS → ELEM, cdri : DS → DS

car(cons(E, D1, . . . , Dn)) = E cdri(cons(E, D1, . . . , Dn)) = Di Additional functions: Length: ℓi : DS → NUM ℓi(nil) = 0 ℓi(cons(E, D1, . . . , Dn)) = s(ℓi(Di)) Increment: inc : DS → DS if ELEM = NUM inc(cons(E, D1, . . . , Dn)) = cons(s(E), inc(D1), . . . , inc(Dn)) Size: size : DS → NUM size(nil) = 0 size(cons(E, D1, . . . , Dn)) = size(D1)+ . . . +size(Dn)+1 0 = 1

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 8 / 23

slide-11
SLIDE 11

inrialoria-logo Applications (unions of theories)

Possible shared theories

Operators: s : NUM → NUM + : NUM × NUM → NUM Axioms: (Inj) ∀x, y s(x) = s(y) → x = y (Acy) ∀x x = sn(x) for all n ∈ N+ (S0) ∀x s(x) = 0 Theories:

1

Theory of Integer Offsets [NRR09c]: TI = {Inj, Acy, S0}

2

Theory of Increment [NRR09b]: TS = {Inj, Acy}

3

Theory of Abelian Groups [NRR09a]: AG = AC(+) ∪ {x + (−x) = 0, x + 0 = x}

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 9 / 23

slide-12
SLIDE 12

inrialoria-logo Superpositions

Outline

1

Introduction

2

Applications (unions of theories)

3

Superpositions

4

Combinations

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 10 / 23

slide-13
SLIDE 13

inrialoria-logo Superpositions

Superposition Calculus as a Decision Procedure

SP: an inference system to saturate a set of equational clauses Intuition: Abstract Congruence Closure Modulo ➼ The core of equational theorem provers: E, SPASS, Vampire, . . .

A refutation-based semi-decision procedure

SP is refutation complete [NR01]: If the input is unsatisfiable, then SP generates the empty clause. Otherwise, possible non-termination...

Theorem [ARR03]

SP is a satisfiability procedure for some (theories of) data structures ➼ termination for the theory of equality EUF , Lists, Arrays, . . .

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 11 / 23

slide-14
SLIDE 14

inrialoria-logo Superpositions

Superposition Calculus

Superposition l[u′] = r u = t (l[t] = r)σ (i), (ii), (iii), (iv) Paramodulation l[u′] = r u = t (l[t] = r)σ (i), (ii), (iii), (iv) Reflection u′ = u ✷ (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.

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 12 / 23

slide-15
SLIDE 15

inrialoria-logo Superpositions

Superposition Calculus Modulo Counting Arithmetic

Ad hoc rules to be applied to ground terms:

R1 (for Inj) s(u) = s(v) u = v R2 (for Inj) s(u) = t, s(v) = t s(v) = t, u = v if s(u) ≻ t, s(v) ≻ t and u ≻ v C1 (for Acy) sn(t) = t ✷ if n ∈ N C2 (for S0) s(t) = 0 ✷

where ✷ is the empty clause

Figure: Ground reduction Inference Rules.

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 13 / 23

slide-16
SLIDE 16

inrialoria-logo Superpositions

AG-Superposition Calculus

Direct AG-superposition l = r D[t1 + t2]p (D[r + t2]p)µi Inverse AG-superposition l = r D[t1 + t2]p (D[r + t2]p)µi Reflection u′ = u ✷ where:

a) ✷ stands for the empty clause b) u =?

AG u′ has a solution

c) µi is a most general solution of l =?

AG t1

d) l = r is a direct orientation and t1 + t2 is a splitting in the Direct AG-superposition rule e) l = r is an inverse orientation and t1 + t2 is an inverse splitting in the Inverse AG-superposition rule

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 14 / 23

slide-17
SLIDE 17

inrialoria-logo Superpositions

AG-Superposition: A Bit of Intuition

Let a, b, c be constants and ≻ an ordering s.t. a ≻ b ≻ c Direct AG-superposition Ex: 3a + c = 0 and 5a + 3b + 2c = 0 3a = −c 3a + 2a + 3b + 2c = 0 ? Inverse AG-superposition Ex: 3a + c = 0 and f(−a + 3b + 2c) = 0 −a = 2a + c f(−a + 3b + 2c) = 0 ?

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 15 / 23

slide-18
SLIDE 18

inrialoria-logo Superpositions

AG-Superposition: A Bit of Intuition

Let a, b, c be constants and ≻ an ordering s.t. a ≻ b ≻ c Direct AG-superposition Ex: 3a + c = 0 and 5a + 3b + 2c = 0 3a

  • l

= −c

  • r

3a

  • t1

+ 2a + 3b + 2c

  • t2

= 0 −c

  • r

+ 2a + 3b + 2c

  • t2

= 0 Inverse AG-superposition Ex: 3a + c = 0 and f(−a + 3b + 2c) = 0 −a

  • l

= 2a + c

r

f( −a

  • t1

+ 3b + 2c

  • t2

) = 0 f(2a + c

r

+ 3b + 2c

  • t2

) = 0

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 15 / 23

slide-19
SLIDE 19

inrialoria-logo Superpositions

Superposition-based Decision Procedures: Summary

Our superposition calculi are refutation complete, and terminating with inputs of the form Ax(T) ∪ G such that Ax(T) is the set of axioms of T (including only unit clauses) G is a set of ground literals for some (useful) theories T: Superposition modulo TI or TS ➼ data structures such as Lists, Trees, Records with Length, Increment Superposition modulo AG ➼ data structures such as Lists, Trees, Records with Length, Increment, Size

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 16 / 23

slide-20
SLIDE 20

inrialoria-logo Combinations

Outline

1

Introduction

2

Applications (unions of theories)

3

Superpositions

4

Combinations

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 17 / 23

slide-21
SLIDE 21

inrialoria-logo Combinations

Non-disjoint Combination Method (à la Nelson-Oppen)

NO1 rules (NO2 rules obtained by symmetry): Contradiction1 Φ1; Φ2 false if Φ1 is T1-unsatisfiable Deduction1 Φ1; Φ2 Φ1; Φ2 ∪ {eq} if            Φ1 is T1-satisfiable Φ2 is T2-satisfiable T1 | = Φ1 ⇒ eq T2 | = Φ2 ⇒ eq eq ∈ T0-basisT1(Φ1) where T0-basisT(Φ) := B such that T | = Φ ⇒ eq for any eq ∈ B T | = Φ ⇒ eq iff T0 | = B ⇒ eq

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 18 / 23

slide-22
SLIDE 22

inrialoria-logo Combinations

Applying the Combination Method: Roadmap

1

How to obtain the T0-bases? ➼ Computability of T0-bases (extends deduction completeness)

2

How to guarantee the termination of the exchange loop? ➼ Noetherianity of T0

3

How to ensure its completeness? ➼ T0-compatibility (extends stable infiniteness) Our work: how to face these issues when T0 = TI, TS, AG, . . . (i) data structures ➼ our superposition calculi compute T0-bases (ii) theories of arithmetic ➼ Examples: linear arithmetic (TQ), non-linear arithmetic (TQ−alg)

◮ TQ: a satisfiability procedure by using Fourier-Motzkin and Gauss ◮ TQ−alg: a satisfiability procedure by using Groebner bases

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 19 / 23

slide-23
SLIDE 23

inrialoria-logo Combinations

Applying the Combination Method: Roadmap

1

How to obtain the T0-bases? ➼ Computability of T0-bases (extends deduction completeness)

2

How to guarantee the termination of the exchange loop? ➼ Noetherianity of T0

3

How to ensure its completeness? ➼ T0-compatibility (extends stable infiniteness) Our work: how to face these issues when T0 = TI, TS, AG, . . . (i) data structures ➼ our superposition calculi compute T0-bases (ii) theories of arithmetic ➼ Examples: linear arithmetic (TQ), non-linear arithmetic (TQ−alg)

◮ TQ: a satisfiability procedure by using Fourier-Motzkin and Gauss ◮ TQ−alg: a satisfiability procedure by using Groebner bases

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 19 / 23

slide-24
SLIDE 24

inrialoria-logo Combinations

Applying the Combination Method: Roadmap

1

How to obtain the T0-bases? ➼ Computability of T0-bases (extends deduction completeness)

2

How to guarantee the termination of the exchange loop? ➼ Noetherianity of T0

3

How to ensure its completeness? ➼ T0-compatibility (extends stable infiniteness) Our work: how to face these issues when T0 = TI, TS, AG, . . . (i) data structures ➼ our superposition calculi compute T0-bases (ii) theories of arithmetic ➼ Examples: linear arithmetic (TQ), non-linear arithmetic (TQ−alg)

◮ TQ: a satisfiability procedure by using Fourier-Motzkin and Gauss ◮ TQ−alg: a satisfiability procedure by using Groebner bases

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 19 / 23

slide-25
SLIDE 25

inrialoria-logo Combinations

Computation of bases for data structures

Result

In case of satisfiability, our Superposition Calculi compute T0-bases for T0 = TI, TS, AG. How to compute T0-bases: collect all the shared equalities in a saturation not containing ✷.

Example (Theory of Lists)

The saturation of ℓ(cons(E, L)) = s(ℓ(L))

  • Axiom of Length

b = cons(e, a) y = ℓ(a) x = ℓ(b) contains ℓ(b) = s(ℓ(a)) y = ℓ(a) ℓ(b) = s(y) x = ℓ(b) x = s(y)

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 20 / 23

slide-26
SLIDE 26

inrialoria-logo Combinations

Example: Union of Theories sharing AG

Consider the constraint: size(bin(a, b)) = ℓ(cons(c, d)) ∧ size(a) = n + 1 ∧ size(b) = 1 ∧ ℓ(d) = n The purification leads to size(bin(a, b)) = h ℓ(cons(c, d)) = k size(a) = n + u ℓ(d) = n size(b) = u k = h u = 1 The AG-saturation under of the “tree-part” contains h = size(a)+size(b) h = n + u+size(b) h = n + u + u Receiving h = n + u + u, the AG-saturation of the “list-part” produces k = ℓ(d)+1 k = n+1 h = n+1 n + u + u = n+1 u + u = 1 1 + 1 = 1 1 = 0 = 0 ✷

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 21 / 23

slide-27
SLIDE 27

inrialoria-logo Combinations

Example: Union of Theories sharing AG

Consider the constraint: size(bin(a, b)) = ℓ(cons(c, d)) ∧ size(a) = n + 1 ∧ size(b) = 1 ∧ ℓ(d) = n The purification leads to size(bin(a, b)) = h ℓ(cons(c, d)) = k size(a) = n + u ℓ(d) = n size(b) = u k = h u = 1 The AG-saturation under of the “tree-part” contains h = size(a)+size(b) h = n + u+size(b) h = n + u + u Receiving h = n + u + u, the AG-saturation of the “list-part” produces k = ℓ(d)+1 k = n+1 h = n+1 n + u + u = n+1 u + u = 1 1 + 1 = 1 1 = 0 = 0 ✷

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 21 / 23

slide-28
SLIDE 28

inrialoria-logo Combinations

Example: Union of Theories sharing AG

Consider the constraint: size(bin(a, b)) = ℓ(cons(c, d)) ∧ size(a) = n + 1 ∧ size(b) = 1 ∧ ℓ(d) = n The purification leads to size(bin(a, b)) = h ℓ(cons(c, d)) = k size(a) = n + u ℓ(d) = n size(b) = u k = h u = 1 The AG-saturation under of the “tree-part” contains h = size(a)+size(b) h = n + u+size(b) h = n + u + u Receiving h = n + u + u, the AG-saturation of the “list-part” produces k = ℓ(d)+1 k = n+1 h = n+1 n + u + u = n+1 u + u = 1 1 + 1 = 1 1 = 0 = 0 ✷

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 21 / 23

slide-29
SLIDE 29

inrialoria-logo Combinations

Example: Union of Theories sharing AG

Consider the constraint: size(bin(a, b)) = ℓ(cons(c, d)) ∧ size(a) = n + 1 ∧ size(b) = 1 ∧ ℓ(d) = n The purification leads to size(bin(a, b)) = h ℓ(cons(c, d)) = k size(a) = n + u ℓ(d) = n size(b) = u k = h u = 1 The AG-saturation under of the “tree-part” contains h = size(a)+size(b) h = n + u+size(b) h = n + u + u Receiving h = n + u + u, the AG-saturation of the “list-part” produces k = ℓ(d)+1 k = n+1 h = n+1 n + u + u = n+1 u + u = 1 1 + 1 = 1 1 = 0 = 0 ✷

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 21 / 23

slide-30
SLIDE 30

inrialoria-logo Combinations

Proof-Producing Combinations

Context: Master thesis of Jean-Baptiste Bontemps (2009/10) Starting point: proof-producing combination for disjoint & convex theories [TRRK10] ➼ Explanation Graph as an entailment proof (A ⇒ I) ➼ Quasi-Conflict Set as an unsatisfiability proof (B ∧ I ⇒ ⊥) How to use these explanations for non-disjoint/non-convex theories? Non-disjoint theories Use of weighted directed edges, to encode the succession relation Non-convex theories Use of ordered edges, to distinguish all the cases/paths generated by the combination procedure How to compute the entailed (shared) disjunctions of equalities? By deduction, via superposition By (Boolean) enumeration, via a procedure à la DPLL (see Delayed Theory Combination [BBC+06] and Splitting on Demand [BNOT06])

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 22 / 23

slide-31
SLIDE 31

inrialoria-logo Combinations

D4 Report

D3 = report on new combination methods for (fragments of) arithmetics and non stably-infinite theories D4 = report on new combination methods for data structures and resource functions So D4 = D3’ with focus on superposition calculi and proof-producing combinations: data structures with bridging functions extensions of our combination-oriented explanation technique related work

◮ Sofronie-Stokkermans [SS09]: extensions of theories with bridging

functions

◮ Suter, Dotta, Kuncak [SDK10]: algebraic data types with

abstractions

◮ Zhang, Sipma, Manna [ZSM06]: recursive data structures with

integer constraints

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 23 / 23

slide-32
SLIDE 32

inrialoria-logo Combinations

References

Alessandro Armando, Silvio Ranise, and Michaël Rusinowitch. A rewriting approach to satisfiability procedures. Information and Computation, 183(2):140–164, 2003. Marco Bozzano, Roberto Bruttomesso, Alessandro Cimatti, Tommi A. Junttila, Silvio Ranise, Peter van Rossum, and Roberto Sebastiani. Efficient theory combination via boolean search. Journal of Information and Computation, 204(10):1493–1525, 2006. Clark Barrett, Robert Nieuwenhuis, Albert Oliveras, and Cesare Tinelli. Splitting on demand in sat modulo theories. In M. Hermann and A. Voronkov, editors, Proceedings of the 13th International Conference

  • n Logic for Programming, Artificial Intelligence and Reasoning (LPAR’06), Phnom Penh,

Cambodia, volume 4246 of Lecture Notes in Computer Science, pages 512–526. Springer, 2006.

  • R. Nieuwenhuis and A. Rubio.

Paramodulation-based theorem proving. In A. Robinson and A. Voronkov, editors, Handbook of Automated Reasoning, volume I, chapter 7, pages 371–443. Elsevier Science, 2001. Enrica Nicolini, Christophe Ringeissen, and Michaël Rusinowitch. Combinable extensions of abelian groups. In Proc. of CADE’09, volume 5663 of LNAI, pages 51–66. Springer, 2009. Enrica Nicolini, Christophe Ringeissen, and Michaël Rusinowitch.

  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 23 / 23

slide-33
SLIDE 33

inrialoria-logo Combinations

Data structures with arithmetic constraints: a non-disjoint combination. In Proc. of FroCoS’09, LNCS. Springer, 2009. Enrica Nicolini, Christophe Ringeissen, and Michaël Rusinowitch. Satisfiability procedures for combination of theories sharing integer offsets. In Proc. of TACAS’09, volume 5505 of LNCS, pages 428–442. Springer, 2009. Philippe Suter, Mirco Dotta, and Viktor Kuncak. Decision procedures for algebraic data types with abstractions. In Manuel V. Hermenegildo and Jens Palsberg, editors, Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, pages 199–210. ACM, 2010. Viorica Sofronie-Stokkermans. Locality results for certain extensions of theories with bridging functions. In R. Schmidt, editor, Proc. of 22nd International Conference on Automated Deduction, (CADE’09), volume 5663 of LNAI, pages 67–83, Montreal (Canada), 2009. Springer. Duc-Khanh Tran, Christophe Ringeissen, Silvio Ranise, and Hélène Kirchner. Combination of Convex Theories: Modularity, Deduction Completeness, and Explanation. Journal of Symbolic Computation, 45:261–286, 2010. Special issue on Automated Deduction: Decidability, Complexity, Tractability. Ting Zhang, Henny B. Sipma, and Zohar Manna. Decision procedures for term algebras with integer constraints.

  • Inf. Comput., 204(10):1526–1574, 2006.
  • C. Ringeissen (LORIA & INRIA Nancy)

Combining Data Structures Sophia, June 2010 23 / 23