the model evolution calculus with built-in theories

22
The Model Evolution Calculus with Built-in Theories Peter Baumgartner MPI Informatik, Saarbrücken www.mpi-sb.mpg.de/~baumgart/

Upload: kostya

Post on 07-Jan-2016

30 views

Category:

Documents


3 download

DESCRIPTION

The Model Evolution Calculus with Built-in Theories. Peter Baumgartner MPI Informatik, Saarbr ü cken www.mpi-sb.mpg.de/~baumgart/. Problem. The Model Evolution Calculus is a sound and refutationally complete calculus for first-order clause logic - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculuswith Built-in Theories

Peter Baumgartner

MPI Informatik, Saarbrücken

www.mpi-sb.mpg.de/~baumgart/

Page 2: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 2

Problem

• The Model Evolution Calculus is a sound and refutationally complete calculus for first-order clause logic

• Can we extend it with built-in theory handling?That is, „plug in“ an (efficient) reasoner for a special domain

• Examples for interesting theories

– Equality

– Real arithmetic

– Theories axiomatized by logic programs

• Can existing theory reasoners be plugged in (to Darwin)?

– Equality: Waldmeister

– Real arithmetic: quantifier elimination

– Logic programs: logic program interpreter

Page 3: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 3

Model Evolution – Idea (1)

A :A

B :B

C :C

DPLL: Davis-Putnam-Logemann-Loveland Procedure (1960-63)Basis of some of the SAT solvers (Chaff, …)

Input: Propositional clause setOutput: Model or „unsatisfiable”

No, split on C

Algorithm components: - Simplification - Split - Backtracking

Page 4: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 4

Model Evolution – Idea (2)

:

:

¼ First Order DPLL [Joint Work with Cesare Tinelli]

No, split on

: Procedure components: - Simplification - Split - Backtracking

Input: First-order clause setOutput: Model or „unsatisfiable”

if termination

Page 5: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 5

• Sequent Style Calculus

• Simplified Calculus (for the purpose of talk)

– No simplification inference rules to modify

– No simplification inference rules to modify

– No „universal“ variables, only „parametric“ ones

Calculus

Context: A set of literals (same as branch on previous slide)

Initially: { :v }

Current Clause Set: Initally: input clauses

Page 6: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 6

Derivation Rules (1)

Split

if

(1) is a context unifier of C Ç L against (2) neither L nor : L is contraditory with

- is a context unifier: is a most general simultaneous unifier of the

clause literals and context literals with opposite sign (pairwise)

- L is contradictory with : contains a variant of :L

Clause: : Ç : Context:

Clause : : Ç :

= { !!!! }

contradictory not contradictory

: is admissible for Split

Page 7: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 7

Derivation Rules (2)

Close

if (1) ; or C ? (2) there is a context unifier of C against such that each literal of C is contraditory with

Clause: : Ç : Context:

Clause : : Ç :

= { !!! }

contradictory contradictory

Close is applicable

- is a context unifier: is a most general simultaneous unifier of the

clause literals and context literals with opposite sign (pairwise)

- L is contradictory with : contains a variant of :L

Page 8: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 8

Model Evolution – Further Ingredients

• Derivation

– Start with sequent : ` „Input Clause Set“

– Apply Split and Close derivation rules (gives tree over sequents)

• Refutation: Every branch ends in sequent of the form ` ?

• Fairness

– Consider a derivation with limit context 1 = i>0 i

– Close is not applicable to any i

– Roughly: if some ground instance C of an input clause is falsified by i

then there is a j>i such that j satisfies C(this can always be achieved by applying the split rule)

• Completeness

– Assume a fair derivation with limit context

– Show that 1 constitutes a model for the input clause set

Page 9: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 9

Theories – Basic Definitions

• A Theory T is a consistent set of sentences

• Consider here universal theories (no existential quantifier in prenex normal form)

• Def: Clause set is T-unsatisfiable iff [ T is unsatisfiable

• Def: Let K be a set of literals and L be a literal

K ²T L

iff K [ T ² L

iff for every structure A and every valuation v:

A,v ² K [ T implies A,v ² L

Examples

{ } ²E holds

{ } ²E does not hold

Page 10: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 10

ME(T) – Derivation Rules (1)

T -Split

if

(1) is a T -context unifier of C Ç L against with key set K [ { L } (2) K 2 :K (3) neither K nor :K is T -contraditory with

is a T -context unifier of clause L Ç … Ç L

iff there are sets K1,…,Kn of variants of literals from s.th. Ki ²T :Li

Each set Ki [ { Li } is called a key set

Clause: : Context:

= { !!! }

Key set: { : }

T -Split on :

Page 11: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 11

ME(T) – Derivation Rules (1)

T -Split

if

(1) is a T -context unifier of C Ç L against with key set K [ { L } (2) K 2 :K (3) neither K nor :K is T -contraditory with

Kis T –contradictory with iff there is a set K of variants of literals from s.th. K ²T :Ki

K: : Context: K = { }

Example for T –contradictory:

Page 12: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 12

ME(T) – Derivation Rules (2)

T -Repair

if

(1) is a T -context unifier of C Ç L against with key set K [ { L } (2) K 2 :K (3) K is not T –contradictory with , but :K is T -contraditory with (4) does not contain a variant of K

Clause: : Context: :

T -Repair with :

- T –Repair is the one-armed, disjoint variant of T –Split

- T –Repair is not applicable if T is the „empty“ theory

Page 13: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 13

ME(T) – Derivation Rules (3)

T -Close

if (1) ; or C ? (2) there is a T -context unifier of C against such that each literal of C is T -contraditory with

Note: Condition (2) must be decidable!

Page 14: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 14

Interpretation Associated to a Context

• Crucial to understand the working of the calculus

• Basis of the completeness proof

• Basis of feasible instantiation with theory reasonersE.g. Waldmeister for the theory of equality

Page 15: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 15

Interpretation Associated to a Context

Literal set K T –produces a literal L in

Literal set K: { K1 … Kn } No literals Li 2 such that Ki ¶ :Li & Ki

Theory Reasoning: { K1 … Kn } ²T L

Interpretation Associated to

A ground atom A is assigned true in via K

iff some set K of variants of literals from T –produces A

Instances: { K1 … Kn }„Ki produces Ki in “

Page 16: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 16

Interpretation Associated to a Context

Context T –produces a literal L

Literal set K (as above): K1 … Kn

Instances: K1 … Kn

No literals Li 2 such that Ki ¶ :Li & Ki

Theory Reasoning: K1 … Kn ²T L

Examples

{ : } does not E-produce

=> P(f(a)) is assigned false in associated E-interpretation

{ : } E-produces and :

=> P(f(a)) is assigned true in associated E-interpretation

Page 17: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 17

ME(T) Calculus – Theory Reasoner RT

• A lifting lemma cannot be proven „once and for all“, replace it by admissibility condition of theory reasoner RT

• Theory reasoner RT

– Input: a context and a clause C = L1 Ç … Ç Ln

– Output: a n+1 -tuple (K1,…,Kn,) or undefinedwhere Ki is a set of variants of literals from and is a substitution

• RT is sound iff Ki ²T :Li (i.e. is a T –context unifier)

• RT is complete iff the following holds:

For every ground instance C and all sets K1,...,Kn (as above):

If C is assigned false in via K1,...,Kn

then RT(,C) = (K1,…,Kn,) for some substitution &

• RT is admissible iff it is sound and complete

Page 18: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 18

Consequences and Properties

• Associated interpretation should be total: easy, context contains :v

• Associated interpretation should be a T –interpretationNeed further restrictions on allowed theories to guarantee this:

– Non-negative theories: ²T 9 (A1 Æ … Æ An)T = { :A } is not allowed

– Theory must be ground convex: ²T B ! A1 Ç … Ç An implies ²T B ! Ai for some i (B conjunction of ground atoms, A ground atom) T = { A Ç B } is not allowed

• PropertyIf limit context 1 assigns false to a (ground) clause C via K1,…,Kn then there is an i such that for all j > i j assigns false to C via K1,…,Kn

• CompletenessFairness + admissible theory reasoner will detect this situation eventually and invalidate it

Page 19: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 19

Equality and Waldmeister

• ProblemWaldmeister is a theorem prover for unit clauses{ n: }

How to match it to contexts and arbitrary clauses?:Ç … Ç:Çm+1m+1Ç … Çnn

• Context Problem

= { ::: }Clause :Waldmeister has to discover instances Solution (?)

Convert context to equivalent set of atoms

E.g. for signature {} obtain

= { }Resulting set can be infinite in case of non-linear literals!

Page 20: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 20

Equality and Waldmeister

• ProblemWaldmeister is a theorem prover for unit clauses{ n: }

How to match it to contexts and arbitrary clauses:Ç … Ç:Çm+1m+1Ç … Çnn

• Arbitrary Clauses Problem

From definition of associated interpretation it follows:

Context falsifies a positive literal A

iff some negative literal :B 2 produces :A in Consequently:

Can resolve away positive clause literals against context literals

Leaves only rest clause (:Ç … Ç:

Page 21: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 21

Equality and Waldmeister

• ProblemWaldmeister is a theorem prover for unit clauses{ n: }

How to match it to contexts and arbitrary clauses:Ç … Ç:Çm+1m+1Ç … Çnn

• Arbitrary Clauses Problem

How to treat rest clause (:Ç … Ç: ?

Solution

Code it as a negative unit clause (due to Thomas Hillenbrand):

:(m

m

Can easily query Waldmeister with many clauses simultaneously

• Thus have transformation for Waldmeister now

But Waldmeister still has to be modifed to compute „all“ solutions!

Page 22: The Model Evolution Calculus with Built-in Theories

The Model Evolution Calculus with Built-in Theories 22

Conclusion

• Presented simplified calculus, without universal variablese.g. \forall x P(x,u)

– Universal variables crucial for performance

• calculus instantiates to postive hyper-resolution for Horn case

• One call to Waldmeister for unit theories

– Should work out without greater difficulties

• Is this all feasible?

• Difference to Ganzinger/Korovin Calculus wrt.\ theory reasoning

– Works for arbitrary universal non-negative convex theories

– Does not need a term orderingBut using term orderings might be advantageous…