using existential graphs for automated theorem proving

49
Using Existential Graphs for Automated Theorem Proving Bram van Heuveln March 13, 2002

Upload: glenna-murray

Post on 31-Dec-2015

58 views

Category:

Documents


2 download

DESCRIPTION

Using Existential Graphs for Automated Theorem Proving. Bram van Heuveln March 13, 2002. Overview. Automated Theorem Proving What is it? ATP procedures Existential Graphs Quick Overview Using EG for ATP. Automated Theorem Proving. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Using Existential Graphs for Automated Theorem Proving

Using Existential Graphs for Automated Theorem Proving

Bram van Heuveln

March 13, 2002

Page 2: Using Existential Graphs for Automated Theorem Proving

Overview

• Automated Theorem Proving– What is it?– ATP procedures

• Existential Graphs– Quick Overview– Using EG for ATP

Page 3: Using Existential Graphs for Automated Theorem Proving

Automated Theorem Proving

• In ATP, one tries to come up with procedures that check whether some statement (the conclusion, or theorem) logically follows from (is logically entailed by; is a logical consequence of) a set of statements = {1 , , n} (the premises, or axioms).

• In this definition, ‘logically’ means ‘according to some system of logic’. This talk, we will restrict ourselves to the system of truth-functional logic. I will assume the audience to be familiar with the formal syntax and formal semantics of truth-functional logic.

Page 4: Using Existential Graphs for Automated Theorem Proving

Decision Procedures

• A procedure P that checks for logical entailment is called a decision procedure if and only if for any statement and any set of statements :– (P is a positive test) P declares that is logically entailed by

if and only if is indeed logically entailed by , and– (P is a negative test) P declares that is not logically

entailed by if and only if is indeed not logically entailed by

(these two properties are crucially different, since not declaring that something is the case is not the same as declaring that something is not the case. E.g. consider P going into an infinite loop)

Page 5: Using Existential Graphs for Automated Theorem Proving

Logical Entailment and Logical Consistency

• Logical Entailment: – A statement is a logical consequence of a set of statements = {1, …,

n} if and only if it is impossible for to be false while each i is true. We write this as |=

• Logical Consistency: – A set of statements = {1, …, n} is logically consistent if and only if it

is possible for each i to be true.

• So, a statement is logically entailed by a set of statements {1, …, n} if and only if the set {1, …, n, } is logically inconsistent.

• Therefore, a decision procedure for logical entailment can be used as a decision procedure for logical consistency, and vice versa. We will see both main types of decision procedures in this talk.

Page 6: Using Existential Graphs for Automated Theorem Proving

Procedures for checking logical entailment or logical consistency

• Derivations

• Truth Tables

• Short Truth Tables

• Truth Trees

• Resolution

• Davis-Putnam

• Non-Clausal Davis-Putnam

Page 7: Using Existential Graphs for Automated Theorem Proving

Running Problems

Is {(X Y), (X Y), (X Y), (X Y)} consistent?

U (V W)

U W

V

K (L M)

M

M L

(P Q)

(Q R)

P R

A (B C)(A B) (D E)

AE

C D

Page 8: Using Existential Graphs for Automated Theorem Proving

Derivations

• Systems of derivation define a finite number of rules of inference that allow one to infer (derive) a statement from other statements.

• A formal proof is a sequence of statements, where each statement is either an assumption, or is derived from any of the previous statements using some rule of inference.

• If there is a formal proof with 1, …, n as initial assumptions, and with as the last statement, then we write {1, …, n } |-

Page 9: Using Existential Graphs for Automated Theorem Proving

Derivation Example

A (B C)(A B) (D E)

AE

C D

B CBCA BD ED

1.

3.4.5.6.7.8.9.10.11.

2.AssumptionAssumption

AssumptionAssumptionDS 1,4Simp 5Simp 5Add 6MP 2,8DS 3,9Conj 7,10

Page 10: Using Existential Graphs for Automated Theorem Proving

The Good, the Bad, and the Ugly

• The good news is that there exist systems of derivation (e.g. Fitch) for which it holds that for any statement and any set of statements :– (Soundness) If |- then |= , and– (Completeness) If |= then |-

• The bad news is that the systems do not tell us how to construct a formal proof.

• The ugly news is that the systems are unable to tell us that is not logically entailed by .– With some effort, a decision procedure can be based on

derivational systems, but it is going to be inefficient.

Page 11: Using Existential Graphs for Automated Theorem Proving

Truth Tables

• Truth tables systematically exhaust all possible truth-value assignments.

• The good news is that this will provide us with a decision procedure.

• The bad news is that it is a very inefficient procedure.

Page 12: Using Existential Graphs for Automated Theorem Proving

Truth Table Example

U V W U (V W) U W V

T T T T T F

T T F F F F

T F T T T T

T F F T F T

F T T T F F

F T F T T F

F F T T F T

F F F T T T

Page 13: Using Existential Graphs for Automated Theorem Proving

A More Focused Search

K (L M)

M

M L

• We are interested in whether all premises can be true and the conclusion false:– In order for the conclusion to be false, M must be false.– In order for the second premise to be true while M is false, L must

be false.– In order for the first premise to be true while L and M are both false,

K must be false.

Page 14: Using Existential Graphs for Automated Theorem Proving

The Short Truth Table Method

• The Short Truth Table Method assigns truth values to the involved complex statements, and sees if that can be made to work out:

K (L M) MM LT FT FF T FF FF

/

A (B C) (A B) (D E) AE C D/TT T TTTT TT FFF FF FF FF?

works out invalid

does not work out valid

Page 15: Using Existential Graphs for Automated Theorem Proving

Drawback of the Short Truth Table Method

• A drawback of the short truth table method is that you are not always forced to assign any further truth values:

• At this point, you can choose to assign certain truth values, but if your choice does not lead to the kind of row you are looking for, then you need to try a different option, and the short truth table method has no tools to do go through all of your options in a systematic way.

U (V W) U WTT

VFTT

Page 16: Using Existential Graphs for Automated Theorem Proving

Truth Trees

• The obvious solution to the drawback of the short truth table method is to incorporate tools to systematically keep track of multiple options.

• One method that does so is the truth tree method:– The truth tree method tries to systematically derive a

contradiction from the assumption that certain statements are all true.

– Like the short table method, it infers which other statements are forced to be true under this assumption.

– When nothing is forced, then the tree branches into the possible options.

Page 17: Using Existential Graphs for Automated Theorem Proving

Truth Tree Example

U (V W)

U W

V

V

U V W

V W

UW

UW

UW

UW

Page 18: Using Existential Graphs for Automated Theorem Proving

Decomposition Rules for Truth Trees

PQ

PQ PQ

PQ

P

(PQ)

(PQ)

(PQ)

(PQ)

P

PP

P

P P

Q

Q

Q

Q

Q

P

P P P

P

Q QQ

Q

Q

Page 19: Using Existential Graphs for Automated Theorem Proving

Rules of KE CalculusP Q

P Q P Q P Q

P (P Q)

(P Q) (P Q)

(P Q)

P PP

P

P P

Q QQ

Q

Q

P

P

P P

P

Q

Q

Q

Q

Q

P Q

P

Q

(P Q)

P Q

DN

EtaBeta

BranchAlpha

Page 20: Using Existential Graphs for Automated Theorem Proving

Truth Trees as Decision Procedures

• The truth tree method can easily be made into a decision procedure.

• Efficiency can be increased by strategically choosing sentences to be decomposed.

Page 21: Using Existential Graphs for Automated Theorem Proving

Resolution

• Resolution is, like the tree method, a method to check for the logical consistency of a set of statements.

• Resolution requires all sentences to be put into CNF.

• A set of sentences in CNF is made into a clause set: a set of clauses, where a clause is a set of literals.

• Clauses are resolved using the resolution rule, and the resulting clause (the resolvent) is added to the clause set:

L C1

L’ C2

CNEW = C1/L C2/L’

Page 22: Using Existential Graphs for Automated Theorem Proving

Putting into CNF

(P Q)

((P Q) (Q P))

((P Q) (Q P))

(P Q) (Q P)

(P Q) (Q P)

((P Q) Q) ((P Q) P)

(P Q) (Q Q) (P P) (Q P)

(Equiv)

(Impl)

(DeM)

(DeM, DN)

(Dist)

(Dist)

Page 23: Using Existential Graphs for Automated Theorem Proving

Resolution Graph

(P Q) (Q R) (P R)

(P Q) (P Q) (Q R) (Q R) (P R) (P R)

{P, Q}{P, Q} {Q, R} {Q, R} {P, R} {P, R}

{P, R}

{P}{P}

{}

{P, Q}

Page 24: Using Existential Graphs for Automated Theorem Proving

Soundness and Completeness of Resolution

• A clause is satisfied by a truth-value assignment if and only if that assignment makes at least one literal in that clause true.

• A clause set is satisfiable if and only if there is a truth-value assignment that satisfies all clauses in that clause set.

• A set of sentences is inconsistent if and only if the corresponding clause set is unsatisfiable.

• It can be shown that a clause set is unsatisfiable if and only if the empty clause (which is a generalized disjunction of 0 disjuncts, which is a contradiction) can be resolved from that clause set.

Page 25: Using Existential Graphs for Automated Theorem Proving

Resolutions as Derivations{A, B}

{A, C}

{A, D, E}

{B, D, E}

{E}

{A}

{C, D}

{B}

{C}

{D, E}

{D}

{D}

{}

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

A (B C)

(A B) (D E)

A

E

(C D)

(A B) (A C)

C D

(A B) (D E) (A B) (D E)

(A D E) (B D E)

1,6

2,6

4,8

5,10

7,9

11,12

Page 26: Using Existential Graphs for Automated Theorem Proving

Resolutions as Decision Procedures

• Resolution can be made into a decision procedure by systematically exhausting all possible resolvents (of which there are finitely many).

• This will not be very efficient unless we add some resolution strategies.

Page 27: Using Existential Graphs for Automated Theorem Proving

Resolution Strategies

• Clause Elimination Strategies– Tautology Elimination

– Subsumption Elimination

– Pure Literal Elimination

• Resolving Strategies– Unit Preference Resolution

– Linear Resolution

– Ordered Resolution

– Etc.

Page 28: Using Existential Graphs for Automated Theorem Proving

Tautology Elimination

• A tautologous clause is a clause that contains an atomic statement as well as the negation of that atomic statement.

• Obviously, for any tautologous clause C, any truth-value assignment is going to satisfy C.

• Hence, with S any clause set, and with S’ the clause set S with all tautologous clauses removed: S is satisfiable if and only if S’ is satisfiable.

Page 29: Using Existential Graphs for Automated Theorem Proving

Subsumption Elimination

• A clause C1 subsumes a clause C2 if and only if every literal contained in C1 is contained in C1, i.e. C1 C2.

• Obviously, if C1 subsumes C2 , then any truth-value assignment that satisfies C1 will satisfy C2.

• Hence, with S any clause set, and S’ the clause set S with all subsumed clauses removed: S is satisfiable if and only if S’ is satisfiable.

Page 30: Using Existential Graphs for Automated Theorem Proving

Pure Literal Elimination

• A literal L is pure with regard to a clause set S if and only if L is contained in at least one clause in S, but L’ is not.

• A clause is pure with regard to a clause set S if and only if it contains a pure literal.

• Obviously, with S any clause set, and with S’ the clause set S with all pure clauses removed: S is satisfiable if and only if S’ is satisfiable.

Page 31: Using Existential Graphs for Automated Theorem Proving

Unit Preference Resolution

• A unit clause is a clause that contains one literal.

• Unit preference resolution tries to resolve using unit clauses first.

Page 32: Using Existential Graphs for Automated Theorem Proving

Unit Literal Deletion and Splitting

• For any clause set S, SL is the clause set that is generated from S as follows:– Remove all clauses from S that contain L.– Remove all instances of L’ from all other clauses

• Obviously, with C = {L} S, S is satisfiable if and only if SL is satisfiable.

• It is also easy to see that for any clause set S, and any literal L: S is satisfiable if and only if SL is satisfiable or SL’ is satisfiable.

• The last observation suggests a splitting strategy that forms the basis of Davis-Putnam.

Page 33: Using Existential Graphs for Automated Theorem Proving

Davis-Putnam

• Recursive routine Satisfiable(S) returns true iff S is satisfiable:

boolean Satisfiable(S)

beginif S = {} return true;

if S = {{}} return false;

select L lit(S);

return Satisfiable(SL) || Satisfiable(SL’);

end

Page 34: Using Existential Graphs for Automated Theorem Proving

Making Davis-Putnam Efficient: Adding Bells and Whistles

• The routine on the previous slide is not very efficient. However, we can easily make it more efficient:– return false as soon as {}S– add the unit rule: if {L}S return Satisfiable(SL)– strategically add deletion strategies– strategically choose the literal on which to split

• As far as I have gathered from the ATP literature, such efficient Davis-Putnam routines are credited to do well in comparison to other ATP routines.

Page 35: Using Existential Graphs for Automated Theorem Proving

Davis-Putnam as Trees

{P, Q}{P, Q}

{P, Q}{P, Q}

(P) (P)

{Q}{Q}

(Q)

{}

(Q)

{}

{Q}{Q}

(Q)

{}

(Q)

{}

Page 36: Using Existential Graphs for Automated Theorem Proving

EG and ATP

• I will present 2 routines:– 1. A decision procedure to decide on consistency

(satisfiability): this routine can be seen as a generalized Davis-Putnam routine.

– 2. A routine to systematically derive a conclusion from a set of premises, assuming that the conclusion is logically entailed by the premises (if not, the routine will stop, so you know that the conclusion is not logically entailed). This routine is an extension of the first routine.

Page 37: Using Existential Graphs for Automated Theorem Proving

Symbolization in EG

P

~

P

Symbolization in EGExpression in PL

Page 38: Using Existential Graphs for Automated Theorem Proving

Inference Rules in EG

Double Cut

(De)Iteration

Erasure

Insertion

12k

12k

12k+1

12k+1

Page 39: Using Existential Graphs for Automated Theorem Proving

Unit Rule for EG

• Where L is a literal graph, and any graph, the procedure Unit(L, ), returns the graph with all occurrences of L removed, and with all complements of L replaced with the empty cut. Again, we’ll write this as L.

Page 40: Using Existential Graphs for Automated Theorem Proving

Gaining Efficiency by Avoiding Clauses

A B C A

A B

A

A C

B

C

B C B C

B CDE (2x!) DC (2x!)

DE DC

Clausifying

NoClausifying!

Page 41: Using Existential Graphs for Automated Theorem Proving

Satisfiability Decision Procedure for EG

boolean Satisfiable(G)

begin

if G =

if G =

Satisfiable(end

if G =

return true;

return false;

return Satisfiable(L);L

if G = 1 2

) || Satisfiable(1 );2

if G = return Satisfiable( );

if G = return Satisfiable( );

return

Page 42: Using Existential Graphs for Automated Theorem Proving

Satisfiability Example

A

D E

E

C DB C

A B

D

C D

B C

B

A

DC D ) = Sat(

Sat( ) = Sat( ) =

Sat( D ) = Sat( B

B C

) = FalseD

Page 43: Using Existential Graphs for Automated Theorem Proving

Adding Bells and Whistles

• Again, this procedure can be made a lot more efficient by dealing with empty cuts, double cuts, and duplicates more efficiently, by various other deletion strategies, and by strategically picking the subgraph on which to split.

Page 44: Using Existential Graphs for Automated Theorem Proving

Satisfaction Graph

• A model is a list of literals where for each literal in the list, its complement is not in the list.

• A satisfaction graph is a graph of the following form:

M

M1 Mn

for n = 1:

for n = 0:

Page 45: Using Existential Graphs for Automated Theorem Proving

Routine for Transforming any Graph into a Satisfaction Graph

graph Transform(G)

begin

if G =

Transform(

end

if G =

return G;

return Paste(L, Transform(L);L

if G = 1 n

Transform(1 )n

return

or

)

// when applicable, remove DC’s and duplicates

Page 46: Using Existential Graphs for Automated Theorem Proving

V WU

U W

W U

VTrans( ) =

Trans( V WU U W W U V ) =

W U W UV Trans(

V WU V WU

Trans(U ) W ) =

WU WU =V

Page 47: Using Existential Graphs for Automated Theorem Proving

Routine for Systematic Derivations in EG

• Given any graphs and , if |= , then the following routine systematically transforms into , using the inference rules from EG:

DC

IN

IT(2x)

Trans

DC

DC

E

Page 48: Using Existential Graphs for Automated Theorem Proving

Sat(

Sat(

X Y

X Y X Y

X Y

X Y

XX Y

X Y X Y

Y X Y

X Y

Sat() )

) =

=X

Sat( Y Y X XSat() ) =

=

| |

Sat( Sat() ) False False False=| || |

| |

Page 49: Using Existential Graphs for Automated Theorem Proving

Trans(

Trans(

X Y

X Y X Y

X Y

X Y

XX Y

X Y X Y

Y X Y

X Y

Trans() )

) =

=X

Trans(XX Y Y XY XTrans() ) =

=