on the use of automata techniques to decide satisfiability mia minnes may 3, 2005

26
On the Use of Automata Techniques to Decide Satisfiability Mia Minnes May 3, 2005

Post on 19-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

On the Use of Automata Techniques to Decide

Satisfiability

Mia MinnesMay 3, 2005

Motivation• We’ve seen how useful ILP formulations can be.

• Often, the main question is whether such a system (of linear equations and inequalities) has a solution, and if so, what it is.

• Omega is nice, but can we do better?

• Moreover, can we have a general framework for solving such systems which is amenable to extension?

– E.g. to Mixed Integer Linear Programming

– E.g. to more general systems (with quantifiers).

Motivation

One possible such framework is Finite Automata.

Why are we interested in it?

• It worked before…MONA (model checking for LTL).

• Automata are amenable to algorithmic manipulation.

• It often has a compact representation.

Goal• Given a system of linear equations and inequalities,

construct an automaton which accepts exactly those

vectors which are solutions to the system.

• In order to get there, we’ll need to

1. Define the systems of equations / inequalities

2. Define automata

3. Formulate algorithm.

1. The Systems• Presburger Arithmetic is the first order theory

(sentences involving , , Boolean combinations) of

• Atomic (basic) formulas are of the form:

or

1. The Systems• A formula (x1,…, xn) in Presburger Arithmetic is SATISFIABLE if

there are integers c1,…, cn such that (c1,…, cn) is true.

2x1 + 3x2 =12

8x1 + 4 x2 = 7

• Examples:

3x1 − 5x2 ≤10

• Presburger (1927) gave decision method.

ILP Problem ?

2. Automata• A finite state AUTOMATON is a “machine” which reads input

bit-by-bit and changes state according to the current state and input.

• It has designated initial and accepting states, and a transition function which gives the rule for moving between states.

• Example:

0

0,1

1

si sm

sf

01100

00011 10011

Sample Input:

3. Algorithm1. Given , a formula in Presburger Arithmetic

2. Construct A, the automaton accepting exactly those words satisfying

3. Check if the set of words accepted by A is empty

4. If yes, is not satisfiable; if no, it is.

Observe: The hardest part of this algorithm is (2). Why?

Cf. (Wolper, Boigelot ‘02, extending Boudet, Comon ‘96)

3. AlgorithmTo tackle the translation of formulas to automata:

1. First construct A for atomic

2. Then define automata corresponding to Boolean op’ns

3. Finally, define automata for quantified formulas.

(Note that the third step is not important for ILP problems.)

3. Algorithm: Equations

Some implementation details:

1. Integers encoded in 2’s complement binary notation.

2. Read numbers MSB first.

3. States represent current value of sum. Hence,

γ→b −a ⋅b,

2γ + a ⋅b

⎧ ⎨ ⎩

a1x1 +L + an xn = c

3. Algorithm: Forward Construction

si

-1

0

-2 -3 -4

1 2 43

Inputs (b):----- 01----- 10----- 00,11

x-y=2a = (1,-1)

3. Algorithm: Pruning Construction

si

-1

0

-2 -3 -4

1 2 43

----- 01----- 10----- 00,11----- 00,01,10,11

x-y=2

sb

Note: this is not yet minimal!

3. Algorithm: Backward Construction

si 0

1 2

----- 01----- 10----- 00,11----- 00,01,10,11

x-y=2

H={si,2}L={2}

γ=(γ0+a.b)/2

Z?

γ=-a.b?

γ0 γ via b

H={si,2,1,0}L={0}H={si,2,1,0}L= emptyH={si,2,1}L={1}

Note: this is minimal!

3. Algorithm: Inequalities

1. For forward construction: include all states representing numbers less than RHS as accepting (plus modify bad states).

2. For backward construction, add transitions for all

γ0 =γ − a ⋅b

2

⎢ ⎣ ⎢

⎥ ⎦ ⎥

a1x1 +L + an xn ≤ c

si

-1

0

-2

1 2

----- 01----- 10----- 00,11----- 00,01,10,11

x-y <= 2

sb

Also need to add transitions!

sg

3. Algorithm: Inequalities

3. Algorithm: General Formulas

1. We’ve taken care of any atomic formula .

2. For negation, conjunction, and disjunction of formulas, use the standard techniques for complementation, intersection, and union of finite automata.

• Complementation: switch accepting / non-accepting states

• Intersection: run both automata simultaneously

• Union: run the automata side by side

3. To eliminate quantifiers, use the projection operation on automata.

Q1x1L Qn xn ϕ (x i1,K , x im

)∧L ∨ψ (x j1,L ,x j p

)( )

Complexity ResultsIf is a quantifier free formula, then the minimal

automaton for has at most 1+(+)|| states, where || is the number of terms in , and depend on the absolute values of the coefficients in the linear terms.

If is an arbitrary formula of length , the minimal automaton for has at most

states. Moreover, there is an example requiring this many states, so the bound is tight.

Cf. (Klaedtke ‘03)€

O 222cλ ⎛ ⎝ ⎜ ⎞

⎠ ⎟

Evaluation of Aut. Decision Proc.

• Relatively simple algorithm.

• Handles general case well (Pres. Arithmetic).

• Uses graph theoretic simplifications.

• Exhibits solution if one exists.

• Doesn’t use native arithmetic so will spend more time on computation.

• Calculates a lot of data that may not be necessary for specific question.

Experimental Results: Quant. Free

• Satisfiability problem for quantifier free Presburger Arithmetic is NP complete, so experiments were designed to determine which classes of formulas were handled well by each technique (LASH vs. ILP vs. Omega)

• 25 runs with parameters:

• # atomic formulas

• # variables

• LASH was able to complete nearly all test runs, and do so correctly. ILP, Omega were faster when they worked but were prone to error / failure.

Cf. (Ganesh, Berezin, Dill ‘02)

Extension: Mixed Integers and Reals

• Hybrid systems and timed systems require systems of equations in which some of the variables have real values and some have integer values.

• To use the automata techniques in this case we have two challenges:

1. How to encode real numbers as binary input to automata?

2. How to design automata which accept particular sets of reals?

• A nice feature of the design which follows is that the set of integers is automata recognizable.

Cf. (Boigelot, Bronne, Rassart ‘97Boigelot, Jodogne, Wolper ‘01Boigelot, Wolper ‘02)

Encoding Real Numbers• Given a real number, we encode it in binary with MSB first,

using 2’s complement for negative numbers.

• Result is an infinite word

= I * F

where I encodes the integer part of as a finite binary word,

and F encodes the fractional part of as an infinite binary word.

Automata Accepting Real Numbers

• Decompose the problem as follows:

• Using a finite automaton (as before) to accept the integer part of the real number

• Concatenating with a special automaton which only accepts *

• And then appending a new kind of automaton which will have to be able to accept the fractional (infinite) part of the real number.

Finite Automaton Buchi Automaton

*

Automata Accepting Real Numbers

• What is a Buchi Automaton?

• A finite state automaton where the notion of “accepting a word” is different: The automaton accepts a word if, on reading , the automaton enters an accepting state infinitely many times.

• By the Buchi characterization theorem, the set of words accepted by a Buchi automaton is nonempty exactly if there is a “lasso” path in the underlying directed graph from an initial state to an accepting state and then looping back to the accepting state.

smsf

si0

0,1

1Accepts e.g. 011111…

Automata Accepting Real Numbers

• Now the satisfiability question is:

• Does the integer part automaton accept a non-empty set of words? And,

• Does the fractional part automaton accept a non-empty set of words?

• Since both of these are answerable (in linear time) by graph algorithms, we’re in good shape.

Future Directions & Open Questions

• Further, more extensive, comparative studies

• For general formulas (with quantifiers)

• In the mixed case (compare to Fourier-Motzkin approach)

• Explore different encoding schemes

• LSB vs. MSB first

• Expand/ optimize existing toolsets.

References• Boigelot, Bronne, Rassart (CAV ‘97) “An Improved Reachability Analysis

for Strongly Linear Hybrid Systems”.

• Wolper, Boigelot (TACAS ‘00) “On the Construction of Automata from Linear Arithmetic Constraints”.

• Boigelot, Jodogne, Wolper (IJCAR ‘01) “On the Use of Weak Automata for Deciding Linear Arithmetic with Integer and Real Variables”.

• Boigelot, Wolper (ICLP ‘02) “Representing Arithmetic Constraints with Automata: An Overview”.

• Ganesh, Berezin, Dill (FMCAD ‘02) “Deciding Presburger Arithmetic by Model Checking and Comparison with Other Methods”.

• Klaedtke (Technical Report, ‘03; LICS ‘04) “On the Automata Size for Presburger Arithmetic”.