0% found this document useful (0 votes)
102 views13 pages

HD24.Gilmores Algorithm

This document describes Gilmore's algorithm for testing the validity of first-order sentences. [1] The algorithm works by translating a first-order sentence ψ into propositional logic and then checking for satisfiability. [2] It generates propositional wffs from the translation and checks if any finite subset is unsatisfiable. [3] If an unsatisfiable subset is found, ψ is valid. However, the algorithm is inefficient as it depends on the ordering of wffs generated.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views13 pages

HD24.Gilmores Algorithm

This document describes Gilmore's algorithm for testing the validity of first-order sentences. [1] The algorithm works by translating a first-order sentence ψ into propositional logic and then checking for satisfiability. [2] It generates propositional wffs from the translation and checks if any finite subset is unsatisfiable. [3] If an unsatisfiable subset is found, ψ is valid. However, the algorithm is inefficient as it depends on the ordering of wffs generated.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

CS 511, Fall 2019, Lecture Slides 24

Gilmore’s Algorithm

Assaf Kfoury

October 16, 2019


(adjusted: October 17, 2019)

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 1 of 13


review and reminders (run simultaneously with an example on the board)

From lecture notes From Compactness to Completeness (click here ),


.
in 4, 5, . . . , 12 below, assume ϕ does not mention equality symbol ‘=’ for simplicity :

1. If ϕ is a first-order sentence, then Θpr,sk (ϕ) is its Skolem form.

2. In particular, Θpr,sk (ϕ) is a universal first-order sentence, i.e., it is in prenex normal


form and all the quantifiers in its prenex are universal.

3. ϕ and Θpr,sk (ϕ) are equisatisfiable


(Lemma 21 in From Compactness to Completeness).

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 2 of 13


review and reminders (run simultaneously with an example on the board)

From lecture notes From Compactness to Completeness (click here ),


.
in 4, 5, . . . , 12 below, assume ϕ does not mention equality symbol ‘=’ for simplicity :

1. If ϕ is a first-order sentence, then Θpr,sk (ϕ) is its Skolem form.

2. In particular, Θpr,sk (ϕ) is a universal first-order sentence, i.e., it is in prenex normal


form and all the quantifiers in its prenex are universal.

3. ϕ and Θpr,sk (ϕ) are equisatisfiable


(Lemma 21 in From Compactness to Completeness).

4. Gr Expansion Θpr,sk (ϕ) is obtained by deleting the prefix of Θpr,sk (ϕ) and
substituting ground terms for variables in the matrix of Θpr,sk (ϕ).

5. ϕ and Gr Expansion Θpr,sk (ϕ) are equisatisfiable
(Lemma 33 in From Compactness to Completeness).

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 3 of 13


review and reminders (run simultaneously with an example on the board)

From lecture notes From Compactness to Completeness (click here ),


.
in 4, 5, . . . , 12 below, assume ϕ does not mention equality symbol ‘=’ for simplicity :

1. If ϕ is a first-order sentence, then Θpr,sk (ϕ) is its Skolem form.

2. In particular, Θpr,sk (ϕ) is a universal first-order sentence, i.e., it is in prenex normal


form and all the quantifiers in its prenex are universal.

3. ϕ and Θpr,sk (ϕ) are equisatisfiable


(Lemma 21 in From Compactness to Completeness).

4. Gr Expansion Θpr,sk (ϕ) is obtained by deleting the prefix of Θpr,sk (ϕ) and
substituting ground terms for variables in the matrix of Θpr,sk (ϕ).

5. ϕ and Gr Expansion Θpr,sk (ϕ) are equisatisfiable
(Lemma 33 in From Compactness to Completeness).

6. X Gr Expansion Θpr,sk (ϕ)
 is obtained by replacing every ground atom α in
Gr Expansion Θpr,sk (ϕ) by a propositional variable Xα .

ϕ is satisfiable (in first-order


logic) iff
7.
X Gr Expansion Θpr,sk (ϕ) is satisfiable (in propositional logic).
(Theorem 37 in From Compactness to Completeness).
Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 4 of 13
review and reminders (run simultaneously with an example on the board)

ϕ is satisfiable (in first-order


logic) iff
8.
X Gr Expansion Θpr,sk (ϕ) is finitely satisfiable (in prop logic).
(Theorem 2 in From Compactness To Completeness)

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 5 of 13


review and reminders (run simultaneously with an example on the board)

ϕ is satisfiable (in first-order


logic) iff
8.
X Gr Expansion Θpr,sk (ϕ) is finitely satisfiable (in prop logic).
(Theorem 2 in From Compactness To Completeness)

9. Contrapositively:
ϕ is not satisfiable (in first-order logic) iff 
there is a finite subset of X Gr Expansion Θpr,sk (ϕ) which is
not satisfiable (in propositional logic).

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 6 of 13


review and reminders (run simultaneously with an example on the board)

ϕ is satisfiable (in first-order


logic) iff
8.
X Gr Expansion Θpr,sk (ϕ) is finitely satisfiable (in prop logic).
(Theorem 2 in From Compactness To Completeness)

9. Contrapositively:
ϕ is not satisfiable (in first-order logic) iff 
there is a finite subset of X Gr Expansion Θpr,sk (ϕ) which is
not satisfiable (in propositional logic).

10. Recall that a first-order sentence ψ is valid iff ¬ψ is not satisfiable .

11. Suppose we want to test whether a first-order sentence ψ is valid. Let



X Gr Expansion Θpr,sk ( ¬ ψ) = {θ1 , θ2 , θ3 , . . .}

Note the inserted logical negation “¬”. All the θi ’s are propositional WFF’s.

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 7 of 13


review and reminders (run simultaneously with an example on the board)

ϕ is satisfiable (in first-order


logic) iff
8.
X Gr Expansion Θpr,sk (ϕ) is finitely satisfiable (in prop logic).
(Theorem 2 in From Compactness To Completeness)

9. Contrapositively:
ϕ is not satisfiable (in first-order logic) iff 
there is a finite subset of X Gr Expansion Θpr,sk (ϕ) which is
not satisfiable (in propositional logic).

10. Recall that a first-order sentence ψ is valid iff ¬ψ is not satisfiable .

11. Suppose we want to test whether a first-order sentence ψ is valid. Let



X Gr Expansion Θpr,sk ( ¬ ψ) = {θ1 , θ2 , θ3 , . . .}

Note the inserted logical negation “¬”. All the θi ’s are propositional WFF’s.

ψ is valid (in first-order logic) iff


12. there is a finite subset of {θ1 , θ2 , θ3 , . . .} which is not satisfiable
(in propositional logic).

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 8 of 13


Gilmore’s algorithm
.
Assume equality symbol ‘=’ does not occur in ψ for simplicity .
.
Details for how to proceed when ‘=’ occurs are in From Compactness To Completeness.
1. input: first-order sentence ψ to be tested for validity ;
2. k := 0;
3. repeat k := k + 1 
V first k wff’s {θ1 , . . . , θk } in X Gr Expansion Θpr,sk ( ¬ ψ)
generate
until 16i6k θi is unsatisfiable;
4. output: ψ is valid;

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 9 of 13


Gilmore’s algorithm
.
Assume equality symbol ‘=’ does not occur in ψ for simplicity .
.
Details for how to proceed when ‘=’ occurs are in From Compactness To Completeness.
1. input: first-order sentence ψ to be tested for validity ;
2. k := 0;
3. repeat k := k + 1 
V first k wff’s {θ1 , . . . , θk } in X Gr Expansion Θpr,sk ( ¬ ψ)
generate
until 16i6k θi is unsatisfiable;
4. output: ψ is valid;

I Fact: Gilmore’s algorithm terminates iff the input sentence ψ is valid.


I Major Drawback: Gilmore’s algorithm is highly inefficient, its performance
depends on the order in which the θi ’s are generated.

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 10 of 13


Gilmore’s algorithm
.
Assume equality symbol ‘=’ does not occur in ψ for simplicity .
.
Details for how to proceed when ‘=’ occurs are in From Compactness To Completeness.
1. input: first-order sentence ψ to be tested for validity ;
2. k := 0;
3. repeat k := k + 1 
V first k wff’s {θ1 , . . . , θk } in X Gr Expansion Θpr,sk ( ¬ ψ)
generate
until 16i6k θi is unsatisfiable;
4. output: ψ is valid;

I Fact: Gilmore’s algorithm terminates iff the input sentence ψ is valid.


I Major Drawback: Gilmore’s algorithm is highly inefficient, its performance
depends on the order in which the θi ’s are generated.

Exercise: Let ϕ1 , . . . , ϕn and ψ be first-order sentences.


Define an algorithm based on Gilmore’s algorithm which terminates iff the semantic
entailment ϕ1 , . . . , ϕn |= ψ holds.

Problem: Can you define an algorithm A which, given a first-order sentence ψ , always
terminates and decides whether ψ is valid or not valid? Hint: No.

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 11 of 13


Gilmore’s algorithm

I Gilmore’s algorithm is said to be a semi-decision procedure , because it


terminates only if the input ψ is valid.
I Gilmore’s algorithm was invented in the late 1950’s and it was the best
semi-decision procedure for first-order validity until the mid-1960’s, when
more efficient early versions of the tableaux and resolution methods
were first introduced.

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 12 of 13


( THIS PAGE INTENTIONALLY LEFT BLANK )

Assaf Kfoury, CS 511, Fall 2019, Lecture Slides 24 page 13 of 13

You might also like