Sie sind auf Seite 1von 96

Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Decision Procedures for Recursive Data Structures

Andreas Sander

Decision Procedures for Logical Theories, SS 2010

16.06.2010
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Motivation

Intuition
A recursive data structure is (partially) composed of smaller or
simpler instances of the same structure.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Motivation

Intuition
A recursive data structure is (partially) composed of smaller or
simpler instances of the same structure.

Example: cons(1,cons(2,cons(3,nil)))
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Motivation

Intuition
A recursive data structure is (partially) composed of smaller or
simpler instances of the same structure.

Example: cons(1,cons(2,cons(3,nil)))
Main Goal
The main goal is to define decision procedures for recursive data
structures.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Motivation

Intuition
A recursive data structure is (partially) composed of smaller or
simpler instances of the same structure.

Example: cons(1,cons(2,cons(3,nil)))
Main Goal
The main goal is to define decision procedures for recursive data
structures.
Whats about:
|cons(1,cons(2,cons(3,nil)))| > 3 ?
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
What we have and what we want

Theory of recursive data structures Th(A )


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
What we have and what we want

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
What we have and what we want

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )

Length Function
|.| : Z
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
What we have and what we want

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )

Length Function
|.| : Z

Goal
Get a decision procedure for the combination of Th( A ), Th(AZ )
and |.| : Z
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
Applicability of Nelson & Oppen

We want to combine this with Nelsons and Oppens method:

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
Applicability of Nelson & Oppen

We want to combine this with Nelsons and Oppens method:

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )

Length Function
|.| : Z
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
Applicability of Nelson & Oppen

We want can not combine this with Nelsons and Oppens method:

Theory of recursive data structures Th(A )

Presburger Arithmetic Th(AZ )

Length Function
|.| : Z
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
The Solution

Solution
Extension of Nelsons and Oppens original method!
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
The Solution

Solution
Extension of Nelsons and Oppens original method!

Overview of this talk:


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
The Solution

Solution
Extension of Nelsons and Oppens original method!

Overview of this talk:

Presburger Arithmetic
Decision Procedure
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
The Solution

Solution
Extension of Nelsons and Oppens original method!

Overview of this talk:

Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem-Outline
The Solution

Solution
Extension of Nelsons and Oppens original method!

Overview of this talk:

Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Extension of Nelsons and Oppens method in the presence of
length |.|
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
s : a successor function
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
s : a successor function
+ : binary function addition
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
s : a successor function
+ : binary function addition
: binary function subtraction
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
s : a successor function
+ : binary function addition
: binary function subtraction
< : predicate smaller relation
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Presburger Arithmetic

first-order theory
corresponding structure AZ : hZ; 0, s, +, , <i
Z : Integer domain
0 : a constant
s : a successor function
+ : binary function addition
: binary function subtraction
< : predicate smaller relation

A decision procedure was presented in the seminar.


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of

a data domain
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of

a data domain

a set of atoms A (e.g. A = {a, b, c, ...})


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of

a data domain

a set of atoms A (e.g. A = {a, b, c, ...})

a finite set of constructors C (e.g. C = {, , , ...})


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of

a data domain

a set of atoms A (e.g. A = {a, b, c, ...})

a finite set of constructors C (e.g. C = {, , , ...})

a finite set of selectors S (e.g. if has arity k > 0:


{s1 , ..., sk } S)
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Recursive Data Structures

A : h; A, C, S, T i consists of

a data domain

a set of atoms A (e.g. A = {a, b, c, ...})

a finite set of constructors C (e.g. C = {, , , ...})

a finite set of selectors S (e.g. if has arity k > 0:


{s1 , ..., sk } S)

a finite set of testers T (e.g. Is (x) is true iff x is an -term.)


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList
t(x) 6= x cons(x, y ) 6= x
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList

a 6= (x1 , ..., xar () ) a 6= cons(x, y )


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList

(x1 , ..., xar () ) = (y1 , ..., yar () ) cons(x, y ) = cons(z, t)


V
1iar () xi = yi x =z y =t
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList

V
IsA (x) C Is (x) IsA (x) Iscons (x)
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Axiomatization of A = AList (LISP list structure)

A Example AList

si (x) = y
z ((z ) = x y = zi ) cdr (cons(x, y )) = y
(z ((z ) 6= x) x = y ) IsA (x) {car , cdr }+ (x) = x
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Goal
Check satisfiability of

q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl

in Th(A ).
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Goal
Check satisfiability of

q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl

in Th(A ).

Idea
Use a Directed Acyclic Graph (DAG) for those formulae.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Term-Representation

Term t can be represented by a tree Tt , s.t.


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Term-Representation

Term t can be represented by a tree Tt , s.t.

1 If t is a constant, Tt is a leaf vertex (labeld by t)


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Term-Representation

Term t can be represented by a tree Tt , s.t.

1 If t is a constant, Tt is a leaf vertex (labeld by t)

2 If t = (t1 , ..., tk ), then Tt is a tree (root labeled by t),


having Tt1 , ..., Ttk as its subtrees (ordered).
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Term-Representation

Term t can be represented by a tree Tt , s.t.

1 If t is a constant, Tt is a leaf vertex (labeld by t)

2 If t = (t1 , ..., tk ), then Tt is a tree (root labeled by t),


having Tt1 , ..., Ttk as its subtrees (ordered).

A directed acyclic graph (DAG) Gt of t obtained from Tt by


factoring out common subtrees.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Goal
Check satisfiability of

q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl

in Th(A ).
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Goal
Check satisfiability of

q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl

in Th(A ).

Idea
Use a Directed Acyclic Graph (DAG) for those formulae.
1 Add (qi , ri )(i {1, ...k}) to an equivalence relation R on
vertices
2 Close R under congruences and unification.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Groundwork

G = (V , E ) a DAG (with ordered edges).


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Groundwork

G = (V , E ) a DAG (with ordered edges).

Let be u V
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Groundwork

G = (V , E ) a DAG (with ordered edges).

Let be u V
outdegree (u)
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Groundwork

G = (V , E ) a DAG (with ordered edges).

Let be u V
outdegree (u)
the ith successor u[i] (i [0; (u)])
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Groundwork

G = (V , E ) a DAG (with ordered edges).

Let be u V
outdegree (u)
the ith successor u[i] (i [0; (u)])

R is an equivalence relation on the vertices of G.


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Bidirectional Closure vs. Congruence Closure

Bidirectional Closure instead of Congruence Closure [Oppen 1980]


For the following decision procedures we will use the bidirectional
closure, instead of the congruence closure!
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Bidirectional Closure vs. Congruence Closure

Bidirectional Closure instead of Congruence Closure [Oppen 1980]


For the following decision procedures we will use the bidirectional
closure, instead of the congruence closure!

Idea
cons(x, y ) = cons(z, t) x = z y = t
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Congruence Closure R

R is the unique minimal extension of R with the following


properties:

R is an equivalence relation

Two vertices u,v with equal (nonzero) outdegree:

(u, v ) R

(u[i], v [i]) R i [1; (u)]
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Unification Closure R

R is the unique minimal extension of R with the following


properties:

R is an equivalence relation

Two vertices u,v with equal (nonzero) outdegree:

(u, v ) R

(u[i], v [i]) R i [1; (u)]
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Bidirectional Closure Rl

Theorem [Oppen 1980]


Rl is the unique minimal extension of R with the following
properties:

Rl is an equivalence relation

Two vertices u,v with equal (nonzero) outdegree:

(u, v ) Rl
m
(u[i], v [i]) Rl i [1; (u)]
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for acyclic A

Input: : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for acyclic A

Input: : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of

Algorithm 1
1 Step 1: Construct the DAG G of
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for acyclic A

Input: : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of

Algorithm 1
1 Step 1: Construct the DAG G of
2 Step 2: Compute Rl of R = {(qi , ri )|1 i k}.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for acyclic A

Input: : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of

Algorithm 1
1 Step 1: Construct the DAG G of
2 Step 2: Compute Rl of R = {(qi , ri )|1 i k}.
3 Return UNSATISFIABLE if i(si , ti ) Rl;
Return SATISFIABLE otherwise.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem for Cyclic Data Structures

In our setting

If x is NOT an -term, then si (x) = x


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem for Cyclic Data Structures

In our setting

If x is NOT an -term, then si (x) = x

Complication
We dont know a priori wether s(x) is a proper subterm of x.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Problem for Cyclic Data Structures

In our setting

If x is NOT an -term, then si (x) = x

Complication
We dont know a priori wether s(x) is a proper subterm of x.

Solution for Complication


We have to guess the type of all terms occuring inside an selector
function before applying the algorithm.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for cyclic A

Input : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for cyclic A

Input : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of

Algorithm 2
0
1 Step 1:Guess a type completion of and simplify selector
terms accordingly.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Oppens Decision Procedure for cyclic A

Input : q1 = r1 ... qk = rk s1 6= t1 ... sl 6= tl


Task: Check satisfiability of

Algorithm 2
0
1 Step 1:Guess a type completion of and simplify selector
terms accordingly.
0
2 Step 2: Call Algorithm 1 on
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Example Application of Algorithm 2

Example
cons(y,z) = cons(cdr(x),z) cons(car(x),y) 6= x

Unification Closure
(u, v ) R

(u[i], v [i]) Ri [1; (u)]
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Extension of Nelsons and Oppens method in the presence of
length |.|
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Extension of Nelsons and Oppens method in the presence of
length |.|

The Structure of the Integrated Theory


B = (A ; AZ ; |.| : Z)
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Extension of Nelsons and Oppens method in the presence of
length |.|

The Structure of the Integrated Theory


B = (A ; AZ ; |.| : Z)

For any atom a, |a| = 1


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

The Structure B

Overview - Where Are We Now?


Presburger Arithmetic
Decision Procedure
Theory of recursive data structure
Decision Procedure
Extension of Nelsons and Oppens method in the presence of
length |.|

The Structure of the Integrated Theory


B = (A ; AZ ; |.| : Z)

For any atom a, |a| = 1


Pk
For a term (t1 , ..., tk ), |(t1 , ..., tk )| = i=1 |ti |.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Why not Nelson & Oppen?

Why?
We want can not combine this with Nelsons and Oppens method
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Why not Nelson & Oppen?

Why?
We want can not combine this with Nelsons and Oppens method

Consider BList ,
: x = cons(car(y),y) and Z :|x|<2|car(x)|
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Why not Nelson & Oppen?

Why?
We want can not combine this with Nelsons and Oppens method

Consider BList ,
: x = cons(car(y),y) and Z :|x|<2|car(x)|
Observation
Constraints of data structures impose hidden constraints on the
lenghts of those structures.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Induced Length Constraint

Idea
Explicitly compute the hidden constraints!

Length constraint :
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Induced Length Constraint

Idea
Explicitly compute the hidden constraints!

Length constraint :

is sound, if satisfying of , | | is a satisfying


assignment for .
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Induced Length Constraint

Idea
Explicitly compute the hidden constraints!

Length constraint :

is complete, if whenever is satisfiable, for any satisfying


assignment of there exists a satisfying assignment
of s.t. | | = .
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Induced Length Constraint

Idea
Explicitly compute the hidden constraints!

Length constraint :

is induced by , if is sound & complete.


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Satisfiability of B

Main Theorem
Let be in the form Z . Let be the induced length
constraint with respect to .

is satisfiable in B

Z is satisfiable in AZ and is satisfiable in A
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Predicates based on the DAG

How to compute the induced length constraints?

Tree(t) : x1 , ..., xn 0 (|t| = ( ni=1 (di 1)xi ) + 1)


P
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Predicates based on the DAG

How to compute the induced length constraints?

Tree(t) : x1 , ..., xn 0 (|t| = ( ni=1 (di 1)xi ) + 1)


P

P()
Node (t, t ) : |t| = i=1 |ti |
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Predicates based on the DAG

How to compute the induced length constraints?

Tree(t) : x1 , ..., xn 0 (|t| = ( ni=1 (di 1)xi ) + 1)


P

P()
Node (t, t ) : |t| = i=1 |ti |
V()
Tree (t) : t (Node (t, t ) i=1 Tree(ti ))
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
|t| = 1 if t is an atom
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
|t| = 1 if t is an atom
|t| = |s|, if (t, s) Rl
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
|t| = 1 if t is an atom
|t| = |s|, if (t, s) Rl
Tree(t) if t is an untyped leaf vertex.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
|t| = 1 if t is an atom
|t| = |s|, if (t, s) Rl
Tree(t) if t is an untyped leaf vertex.
Node (t, t ) if t is an -typed vertex with children t
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Constructing Length Constraint

Algorithm 3 (Construction of in B )
Let be (type-complete) data constraint. G the DAG of and
Rl bidirectional closure.
From initial state = add the following
|t| = 1 if t is an atom
|t| = |s|, if (t, s) Rl
Tree(t) if t is an untyped leaf vertex.
Node (t, t ) if t is an -typed vertex with children t
Tree (t) if t is an -typed leaf vertex.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Some Deductions

Proposition 2
obtained by Algorithm 3 is expressible in a quantifier-free
Presburger formula linear in the size of .

Theorem 1
obtained by Algorithm 3 is the induced length constraint of .
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Decision Procedure for a Quantifier-Free B

Input: Z .
0
1 Guess a type completion of .
0
2 Call Algorithm 1 on .
0
Return FAIL if is unsatisfiable; continue otherwise.
0
3 Construct from G using Algorithm 3.
Return SUCCESS if is satisfiable and Z is satisifiable.
Return FAIL otherwise.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Example Application of Algorithm 4

Example
x = cons(car(y),y) |cons(car(y),y)| < 2|car(x)|.
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Some Final Remarks

In Theories were quantifiers (,) occurs, we can use


quantifier-elimination to get rid of the quantifiers!

Application on theories with finite number of atoms is also


possible, but its far more complicated!
Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Thank you for your attention!


Motivation Problem-Outline The structures Recursive Data Structures The Integrated Theory

Literature

Zhang, T.; Sipma H.B.; Manna,Z.:


Decision Procedures for Recursive Data Structures with

Integer Constraints.
Springer-Verlag, 2004.
Oppen,D.C:
Reasoning About Recursively Defined Data Structures.

Journal of the Association for Computing Machinery (Vol. 27),
1980
Nelson,G; Oppen, D.C:
Fast Decision Procedures Based on Congruence

Closure.
Journal of the Association for Computing Machinery (Vol. 27),
1980

Das könnte Ihnen auch gefallen