Automated Reasoning Decision procedures for various small theories, - - PowerPoint PPT Presentation

automated reasoning
SMART_READER_LITE
LIVE PREVIEW

Automated Reasoning Decision procedures for various small theories, - - PowerPoint PPT Presentation

Decision Procedures in Theorem Proving Automated Reasoning Decision procedures for various small theories, e.g., - propositional


slide-1
SLIDE 1

Decision Procedures in Theorem Proving

  • Decision procedures for various small theories, e.g.,
  • propositional logic: truth tables; binary decision diagrams. DP method...
  • some flavours of equational logic
  • logic without function symbols and existential quantifiers
  • cf. earlier lecture
  • some flavours of arithmetic: linear arithmetic
  • Given formula of a theory, decision procedure says whether it is provable or not
  • Advantage: a black box does all the work
  • Terminates but may be very inefficient

e.g. decision procedure for elementary geometry (Tarski) by definition

Linear Arithmetic

First order theory of real (or rational) numbers with:

,

,

,and

,but not

✝ ✞

,and

✟ ✁

note that can be expressed using < and =

  • nly multiplication by a constant is allowed

e.g.

X

3 X

X

X

which can be thought of as

Essentially theory of dense ordered Abelian groups without endpoints

there is a number between any two different numbers e.g. the reals or the rationals

Commonly used to reason about time, loops in programs, etc.

Want a special-purpose way (rather than resolution) of dealing with such problems

Linear Arithmetic is decidable e.g. trivial for ground formulae (e.g. 2 + 3 < 6)

Decision procedure works by reducing a quantified conjecture to an equivalent formula which does not contain quantifiers or variables i.e. a ground formula

Applies sequence of normal forming transformations

Automated Reasoning

Decision Procedure for linear arithmetic Jacques Fleuriot

Lecture XIII

Decidability

Decidable There is a decision procedure e.g. tautology checking, linear arithmetic, elementary geometry Undecidable The problem is not decidable: there is no decision procedure e.g. termination of a set of rewrite rules, inductive theorem proving ... Semi-decidable Special class of undecidable problems: there is a procedure which will terminate if the answer is yes. e.g. - the halting problem: can run the program

  • first order theorem proving: enumerate all proofs
slide-2
SLIDE 2

Step II: Disjunctive Normal Form (DNF)

DNF: disjunction of conjunction of literals A formula of the form D1

  • Dn where

each Di is of the form Ci1

✂ ✁ ✂

Cim How to achieve DNF:

Remove all logical connectives except ¬,

and

use def.of

and .

Move ¬ inwards

Move

inside

☎ ✄

Move

inside

View this process as

reorganisation within levels so that existential variable can be easily solved and eliminated

an exhaustive application of rewrite rules

Stratification

A

B

D

E

F

Example:

Step II: Removing and

Removal of P Q

P

Q

Q

P P Q

¬P

Q

¬Q

P alternatively:

no need to unfold

Note: formula doubles in size P

Q

¬P

Q

Removal of

Exercise: Are these rules terminating? clearly size is not decreasing!

Example of Decision Procedure Application

Choose to eliminate Y in the conjecture:

X.

  • Y. ¬

2

X

1

Y

¬ Y

X

1

Put in disjunctive normal form:

X.

Y. 2

X

1

Y

Y

X

1

Solve for Y:

Eliminate Y: ( no longer appears)

  • X. 2

X

1

1

X

X.

Y. Y

2

X

1

Y

1

X

Y

  • Simplify. Repeat process, eliminate X:
  • X. X

2

Solve for X, and we are done. The conjecture is true

Each step preserves truth

Step I: Choosing a Variable to Eliminate

universally quantify any free variables appearing in conjecture (closure)

  • Y. 2

Y

1

X

For example, becomes

X.

  • Y. 2

Y

1

X

choose with no quantifiers in its scope: the innermost

✵ ✵ ✶

X.

  • Y. 2

Y

1

X

e.g. choose Y in:

if no then create one:

✵ ✻
  • X. P

¬

  • X. ¬P

stop if there are no variables or quantifiers left

eliminate this variable then recurse

recall: is a rewrite rule

lhs

rhs

slide-3
SLIDE 3

Example of Disjunctive Normal Form

Conjecture:

  • X.

P

Q

¬R

S Removal of

:

  • X.

¬ P

Q

¬ R

S Stratification of ¬:

  • X.

¬P

¬Q

¬¬ R

S Stratification of

:

  • X.

¬P

¬Q

¬P

¬¬ R

S Stratification of

  • :
  • X. ¬P

¬Q

  • X. ¬P

¬¬ R

  • X. S

Reorganisation:

  • X. ¬P

¬Q

  • X. ¬P

R

  • X. S

note: use of associativity rule

Note: transformation into DNF is potentially inefficient

Elimination of Quantifiers

Make each argument of ∧ into an equation or inequality need to remove defined predicate symbols (e.g. ≤ in terms

  • f < and =)

Solve each equation and inequality for chosen existential variable

Thereby eliminate variable from conjunction

Existential quantifier becomes redundant since that variable no longer appears in the formula

Stratification

✆✞✝✠✟

¬ atomic formulae We have a formula in which

and have to be removed Need to stratify: arrange remaining connectives into layers

Having exhaustively applied these stratification rules, we are in DNF But, it is worth doing a little more normalization (tidying up)

Stratify ¬: De Morgan's laws ¬ P

Q

¬P

¬Q ¬ P

Q

¬P

¬Q Stratify

: P

Q

R

P

Q

P

R Q

R

P

Q

P

R

P Stratify

:

X. P

Q

☞ ✍
  • X. P
☛ ✍
  • X. Q

Rewrite rules

top bottom

Reorganisation

Right associativity

P

Q

R

P

Q

R P

Q

R

P

Q

R

Thinning

¬¬P

P

Reorganisation makes subsequent steps a little easier

Note: this is sometimes done as negation is pushed in during stratification

slide-4
SLIDE 4

Eliminating Variables

Now we can exploit the solutions for the chosen variable

  • Substitution of solutions: use an equality X = T to replace all the other
  • ccurrences of X with the term T

X

T

P X

P T

Si

X

X

T j

✞ ✟

i

j

i j

Si

T j

  • Un-interpolation:

all possible combinations

S

X

X

T

S

T

special case:

  • Drop redundant quantifier
  • X. P

P where P does not contain X a

b

k

b

b

c

b

d

Exercise:

Eliminating Variables

Now we can exploit the solutions for the chosen variable

  • Substitution of solutions: use an equality X = T to replace all the other
  • ccurrences of X with the term T

Si

X

X

T j

Si

T j

  • Un-interpolation:

all possible combinations

S

X

X

T

S

T

special case:

  • Drop redundant quantifier
  • X. P

P where P does not contain X a

b

k

b

b

c

b

d

Exercise:

Example of Elimination of Quantifiers

Conjecture:

Y

Z

X. Z

X

1

Y

X

Z

2

X

Y Removal of

:

Y

Z

X. Z

X

1

X

Z

Y

2

X

Y Inequality solving:

Y

Z

X. Z

1

X

X

Y

Z

X

1

2

Y Un-interpolation

Y

Z

X. Z

1

Y

Z

Z

1

1

2

Y Drop redundant

:

Y

  • Z. Z

1

Y

Z

Z

1

1

2

Y Solve for Y and Z ...

X has been chosen and formula is in DNF Next:

Removal of Defined Symbols

Removal of >, ≤ , ≥ X

Y

Y

X X

Y

¬ X

Y X

Y

¬ Y

X ¬ X

Y

X

Y

Y

X ¬ X

Y

X

Y

Y

X

Removal of ¬ relies on linearity: X < Y or X = Y or X > Y for any X and Y Note: this must be done within the DNF procedure, since the presence of ¬ makes a difference A

¬ X

Y

A

X

Y

X

Y e.g. if not then need to redo DNF Note: unnegated equalities are untouched

Equation and Inequality Solving

bring together occurrences of variables being solved

X

Y

X

Y

X

Y

X

Y

X

Z

Y

X

Y

Z

Attraction

A

X

B

X

A

B

X A

X

B

X

A

B

X

Collection

e.g. 3

X

Y

X

?

Note: A and B must be constants for linear arithmetic, so A + B and A

B must evaluate to a number

X

Y

Z

X

Z

Y X

Y

Z

X

Z

Y X

Y

Z

X

Z

Y X

Y

Z

X

Z

Y A

❀ ❁

A

X

Z

X

1

A

Z

A

A

X

Z

X

1

A

Z A

✿ ❁

A

X

Z

1

A

Z

X

Isolation: isolate the chosen (quantified) variable onto one side of every equality or inequality

conditional rules that make coefficient

  • f the chosen variable +1

X is chosen variable in each case A is constant (since linear arith)

slide-5
SLIDE 5

Interleaving of Normal Form and Elimination

  • 1. Remove ↔,→ , >, ≥ , and ≤
  • 2. For each quantifier, starting with innermost:

a) turn ∀ into ∃ b) stratify ¬ , thin multiple occurrences and remove c) continue and complete disjunctive normal form process d) For each disjunct:

  • i. solve equations/inequalities
  • ii. substitute and un-interpolate to eliminate variable
  • iii. remove redundant ∃
  • 3. Use arithmetic and propositional decision procedure to decide

Final Algorithm: There are other more efficient algorithms

¬ X

  • Y

X

Y

Y

  • X

e.g.

Summary

Some theories are decidable

Decision procedures can provide practical theorem provers

Common decision procedure uses normal forming and quantifier elimination

Procedure steps can be realised as rewriting

Removal, stratification and reorganisation are common patterns

Recommended Reading: Paper by Bundy available from AR pages