Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic - - PowerPoint PPT Presentation

logic as a tool chapter 4 deductive reasoning in first
SMART_READER_LITE
LIVE PREVIEW

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic - - PowerPoint PPT Presentation

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.2 Semantic Tableaux for First-Order Logic Valentin Goranko Stockholm University December 2020 Goranko First-order Semantic Tableau: introduction The system of semantic


slide-1
SLIDE 1

Goranko

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.2 Semantic Tableaux for First-Order Logic

Valentin Goranko Stockholm University December 2020

slide-2
SLIDE 2

Goranko

First-order Semantic Tableau: introduction

The system of semantic tableau (ST) for first-order logic extends the semantic tableau for propositional logic with additional rules for the quantifiers. It is used to derive logical consequences in first-order logic, based on the same idea, i.e. in order to test the logical consequence A1, . . . , An | = B the system ST tries to falsify it by searching systematically for a counter-model, i.e., a structure and a variable assignment where all A1, . . . , An are true while B is false. If that search fails, i.e. all branches of the tableau close, then the logical consequence is proved by ST, denoted A1, . . . , An ⊢ST B. It can be proved that the system of semantic tableau introduced here is sound and complete for first-order logic, i.e.: A1, . . . , An ⊢ST B iff A1, . . . , An | = B.

slide-3
SLIDE 3

Goranko

Quantifier rules for Semantic Tableau

(∀T) ∀xA(x) : T ↓ A[t/x] : T for any term t free for x in A (∃T) ∃xA(x) : T ↓ A[c/x] : T for a new constant symbol c not yet occurring on this branch. (∃F) ∃xA(x) : F ↓ A[t/x] : F for any term t free for x in A (∀F) ∀xA(x) : F ↓ A[c/x] : F for a new constant symbol c not yet occurring on this branch.

slide-4
SLIDE 4

Goranko

Additional restrictions and strategies

  • 1. In order to avoid unnecessary repeated applications of the rules (∃T) and

(∀F), we impose the following restriction: On any given branch of the tableau, none of the rules (∃T) and (∀F) may be applied more than once to the same formula.

  • 2. Likewise, in order to avoid unnecessary applications of the rules (∀T) and

(∃F) that can prevent termination in cases when the tableau should close, one can impose the following restriction: On any given branch of the tableau, apply the instantiation rules (∀T) and (∃F)

  • nly with terms that can be unified with terms already appearing on that branch.

(Two terms s and t can be unified when there is a uniform substitution of terms for variables in s and t that makes them identical.) It can be shown that if a tableau closes without these restrictions applied to it, it can still close when the restrictions are applied. A good strategy is on any given branch of the tableau to first apply the rules (∃T) and (∀F) and then the rules (∀T) and (∃F).

slide-5
SLIDE 5

Goranko

Notational convention

When A = A(x) and t is free for substitution for x in A then we will sometimes write A(t) instead of A[t/x].

slide-6
SLIDE 6

Goranko

First-order Semantic Tableau: Example 1

Check if ∀x(Q → P(x)) Q → ∀xP(x), where x does not occur free in Q. ∀x(Q → P(x)) : T, Q → ∀xP(x) : F ↓ Q : T, ∀xP(x) : F ↓ P(c) : F ↓ Q → P(c) : T ւ ց Q : F P(c) : T × × The tableau closes, therefore the logical consequence holds.

slide-7
SLIDE 7

Goranko

First-order Semantic Tableau: Example 2

Check if ∃x(P(x) → Q(x)), ∃xP(x) ∃xQ(x). ∃x(P(x) → Q(x)) : T, ∃xP(x) : T, ∃xQ(x) : F ↓ P(c1) → Q(c1) : T ↓ P(c2) : T ↓ Q(c1) : F ↓ Q(c2) : F ւ ց P(c1) : F Q(c1) : T

  • ×

Countermodel over a set {a1, a2}, where c1 is interpreted as a1, c2 is interpreted as a2, P = {a2} and Q = ∅.

slide-8
SLIDE 8

Goranko

Example 3: Check if ∀x∃yP(x, y) ∃xP(x, c0). ∀x∃yP(x, y) : T, ∃xP(x, c0) : F ↓ P(c0, c0) : F ↓ ∃yP(c0, y) : T ↓ P(c0, c1) : T ↓ P(c1, c0) : F ↓ ∃yP(c1, y) : T ↓ P(c1, c2) : T ↓ P(c2, c0) : F . . . The tableau never closes, hence a countermodel exists.

slide-9
SLIDE 9

Goranko

Algorithmic unsolvability of the logical consequence in first-order logic

Unlike the propositional case, none of the deductive systems and methods for checking logical consequence in first order logic is guaranteed to terminate its search for a derivation, even if such a derivation exists. This happens, for instance, when a first-order logical consequence fails, but the countermodel must be infinite. In fact, it was proved by Alonso Church in 1936 that the problem whether a given first-order sentence is valid (and consequently, if a given logical consequence holds) is not algorithmically solvable. Therefore, no sound and complete deductive system for first order logic with always terminating proof search procedure can be designed.

slide-10
SLIDE 10

Goranko

Semantic Tableaux for FOL with equality

slide-11
SLIDE 11

Goranko

Semantic Tableaux for first-order logic with equality: rules

(=T)

A[t/x] : T A[s/x] : T

for any terms s, t free for x in A such that s = t : T or t = s : T occurs on the branch (=F)

A[t/x] : F A[s/x] : F

for any terms s, t free for x in A such that s = t : T or t = s : T occurs on the branch Besides these rules, an additional condition for closing a branch: if for some term t the signed formula t = t : F occurs on the branch.

slide-12
SLIDE 12

Goranko

Semantic Tableaux for FOL with equality: example 1

Using Semantic Tableaux with equality, check whether ∀x(P(x) ↔ x = c) | = P(c), for a constant symbol c. Here is the tableau construction, where we use a rule for A ↔ B : T based on the equivalence A ↔ B := (A ∧ B) ∨ (¬A ∧ ¬B): ∀x(P(x) ↔ x = c) : T, P(c) : F P(c) ↔ c = c : T P(c) : T, c = c : T × P(c) : F, c = c : F × Note that the right-hand branch closes due to the new closure rule.

slide-13
SLIDE 13

Goranko

Semantic Tableaux for FOL with equality: example 2

Check the validity ∀x∀y(x = y → (P(f (x)) ↔ P(f (y)))), where P is a unary predicate symbol and f is a unary function symbol:

∀x∀y(x = y → (P(f (x)) ↔ P(f (y)))) : F ∀y(c = y → (P(f (c)) ↔ P(f (y)))) : F (c = d → (P(f (c)) ↔ P(f (d)))) : F c = d : T, (P(f (c)) ↔ P(f (d)))) : F c = d : T, P(f (c)) → P(f (d)) : F c = d : T, P(f (c)) : T, P(f (d)) : F P(f (d)) : T =T c = d : T, P(f (d)) → P(f (c)) : F c = d : T, P(f (d)) : T, P(f (c)) : F P(f (d)) : F =F

slide-14
SLIDE 14

Goranko

Here is the tableau again:

∀x∀y(x = y → (P(f (x)) ↔ P(f (y)))) : F ∀y(c = y → (P(f (c)) ↔ P(f (y)))) : F (c = d → (P(f (c)) ↔ P(f (d)))) : F c = d : T, (P(f (c)) ↔ P(f (d)))) : F c = d : T, P(f (c)) → P(f (d)) : F c = d : T, P(f (c)) : T, P(f (d)) : F P(f (d)) : T

=T

× c = d : T, P(f (d)) → P(f (c)) : F c = d : T, P(f (d)) : T, P(f (c)) : F P(f (d)) : F

=F

× The tableaux closes. The applications of the equality rules are indicated. In both cases there is a choice to apply either of these rules.

slide-15
SLIDE 15

Goranko

Semantic Tableaux for FOL with equality: example 3

First, let us formalise in FOL the old jazz song’s line: ”Everybody Loves My Baby, but My Baby Don’t Love Nobody but Me” ∀xL(x, MyBaby) ∧ ∀y(¬y = Me → ¬L(MyBaby, y)) Now, using Semantic Tableaux with equality, prove that ”Everybody Loves My Baby, but My Baby Don’t Love Nobody but Me” implies that “I am my baby”, i.e. ∀xL(x, MyBaby) ∧ ∀y(¬y = Me → ¬L(MyBaby, y)) ⊢ST MyBaby = Me

slide-16
SLIDE 16

Goranko

Semantic Tableaux for FOL with equality: example 3 (cont)

∀xL(x,MyBaby)∧∀y(¬y=Me→¬L(MyBaby,y)):T, MyBaby=Me:F ∀xL(x,MyBaby):T,∀y(¬y=Me→¬L(MyBaby,y)):T, MyBaby=Me:F L(MyBaby,MyBaby):T, ∀y(¬y=Me→¬L(MyBaby,y)):T, MyBaby=Me:F L(MyBaby,MyBaby):T, ¬MyBaby=Me→¬L(MyBaby,MyBaby):T, MyBaby=Me:F L(MyBaby,MyBaby):T, ¬MyBaby=Me:F, MyBaby=Me:F L(MyBaby,MyBaby):T, MyBaby=Me:T, MyBaby=Me:F

×

L(MyBaby,MyBaby):T, ¬L(MyBaby,MyBaby):T, MyBaby=Me:F L(MyBaby,MyBaby):T, L(MyBaby,MyBaby):F, MyBaby=Me:F

×

slide-17
SLIDE 17

Goranko

Semantic Tableaux for FOL: soundness and completeness

Theorem (Soundness and Completeness of ST)

Each of the Semantic Tableaux systems ST for FOL, with and without equality, is sound and complete, i.e., for every first-order formulae A1, . . . , An, C of the respective (with or without equality) language: A1, . . . , An, ⊢ST C iff A1, . . . , An, | = C.

slide-18
SLIDE 18

Goranko

Discussion on the quantifier rules and on termination

  • 1. If the language has at least one constant and one functional symbol there are

infinitely many ground terms that can be instantiated in the rules (∀T) and (∃F). All but finitely many of these instantiations would be ‘useless’ for the closure of the branch of the tableau. So, the rules as they stand appear to be ‘wasteful’. This could lead to unnecessary non-termination but will not affect the soundness and completeness of the system.

  • 2. On the other hand, these rules can be strengthened by allowing instantiation

with any term t that is free for x in A. The resulting rules would still be sound, however even more ‘wasteful’ in sense of allowing “useless” applications.

  • 3. The problem of identifying and preventing ‘useless’ applications of the rules

(∀T) and (∃F), is very non-trivial, as the termination problem is algorithmically unsolvable for any sound and complete version of Semantic Tableaux. Intuitively, it may seem sufficient to only apply these rules for terms that have already appeared on the branch, if contradiction is to be reached on that branch. However, such restriction would be too strong and can prevent the tableau from closing, e.g. for the unsatisfiable input formula ∀x∀y(P(x) ∧ ¬P(f (y))).

slide-19
SLIDE 19

Goranko

Addendum: Free Variable Tableaux, informal description

The Free Variable Tableaux version defers the term instantiations applied with the rules (∀T) and (∃F) to a later stage, where it may become clear exactly what instantiations are needed in order to close the branch, if possible. The idea is to modify the rules (∀T) and (∃F) to instantiate not with ground terms but with new free variables and also to modify the rules (∀F) and (∃T) to instantiate not with a new constant, but with a term f (v1, . . . , vk), where f is a new functional symbol and v1, . . . , vk are the free variables on the branch that have appeared there by applications of the rules (∀T) and (∃F). The technique behind this modification of the rules is called Skolemization (cf. Section 4.4 of the book). In the case when there are no such free variables, the rules act like the current ones, by instantiating with new constant symbols. For example, the introduction of the arbitrary constant symbol in the 2nd step Example 128 in the book would be avoided in the Free Variable Tableaux version by instantiating x with a new free variable v1, then instantiating y with another free variable v2 and finally instantiating v1 with f (v2). This is a simple case of the term unification technique (cf. Section 4.5). For more on Free Variable Tableaux, see Section 7.4 in Fitting’s book ”First-Order Logic and Automated Theorem Proving”.