Outline

First Order - Substitution and Normal Forms

K. Subramani1

1Lane Department of Computer Science and Electrical Engineering West Virginia University

13 February, 15 February 2013

Subramani First Order Logic Outline Outline

1 Substitution Safe Substitution Schema Substitution

Subramani First Order Logic Outline Outline

1 Substitution Safe Substitution Schema Substitution

2 Normal Forms

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Substitution

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Substitution

Main issue The purpose of substitution in FOL is the same as in propositional logic, i.e., to facilitate theorem proving.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Substitution

Main issue The purpose of substitution in FOL is the same as in propositional logic, i.e., to facilitate theorem proving. However, unlike propositional logic, substitution in FOL is complex and requires a lot of care.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Substitution

Main issue The purpose of substitution in FOL is the same as in propositional logic, i.e., to facilitate theorem proving. However, unlike propositional logic, substitution in FOL is complex and requires a lot of care.

Definition Renaming the variable x to a fresh variable x′ in the fomula Qx F[x] produces the equivalent formula Qx′ F[x′], where x′ is any variable that does not occur in F.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Substitution

Main issue The purpose of substitution in FOL is the same as in propositional logic, i.e., to facilitate theorem proving. However, unlike propositional logic, substitution in FOL is complex and requires a lot of care.

Definition Renaming the variable x to a fresh variable x′ in the fomula Qx F[x] produces the equivalent formula Qx′ F[x′], where x′ is any variable that does not occur in F.

Example Rename the bound variable x to x′ in: F : P(x) ∧ (∀x) Q(x, y).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

The replacements are simultaneous.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

The replacements are simultaneous. If both Fi and Fj are in in the domain of σ and Fi is a strict subformula of Fj , then replace Fj by Gj .

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

The replacements are simultaneous. If both Fi and Fj are in in the domain of σ and Fi is a strict subformula of Fj , then replace Fj by Gj .

Example

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Fundamentals

Definition A substitution is a map from FOL formulae to FOL formulae of the form:

σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

The replacements are simultaneous. If both Fi and Fj are in in the domain of σ and Fi is a strict subformula of Fj , then replace Fj by Gj .

Example Perform the substitution σ : {x 7→ G(x), y 7→ F(x), Q((F(y), x) 7→ (∃x) H(x, y)}, over the formula F : (∀x) P(x, y) → Q(F(y), x).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Outline

1 Substitution Safe Substitution Schema Substitution

2 Normal Forms

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}. Let Vσ = ∪i ((free(Fi ) ∪ free(Gi )).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}. Let Vσ = ∪i ((free(Fi ) ∪ free(Gi )).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}. Let Vσ = ∪i ((free(Fi ) ∪ free(Gi )). (i) For each quantified variable x in F, such that x ∈ Vσ, rename x to a fresh variable x′ to produce F ′.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}. Let Vσ = ∪i ((free(Fi ) ∪ free(Gi )). (i) For each quantified variable x in F, such that x ∈ Vσ, rename x to a fresh variable x′ to produce F ′. (ii) Compute F ′σ.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Safe Substitution

Issue There exists a restricted form of substitution called Safe Substitution that preserves formula equivalence.

Technique

Consider a substitution σ of the form: {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}. Let Vσ = ∪i ((free(Fi ) ∪ free(Gi )). (i) For each quantified variable x in F, such that x ∈ Vσ, rename x to a fresh variable x′ to produce F ′. (ii) Compute F ′σ.

Example Given F : (∀x) P(x, y) → Q(F(y), x) and σ : {x 7→ G(x), y 7→ F(x), Q(F(y), x) 7→ (∃x) H(x, y)}, perform the safe substitution Fσ.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Property of Safe Substitutions

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Property of Safe Substitutions

Proposition

Consider a substitution σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}, such that for each i, Fi ⇔ Gi .

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Property of Safe Substitutions

Proposition

Consider a substitution σ : {F1 7→ G1, F2 7→ G2,... Fn 7→ Gn}, such that for each i, Fi ⇔ Gi . Then, F ⇔ Fσ, when Fσ is computed in a safe substitution.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Outline

1 Substitution Safe Substitution Schema Substitution

2 Normal Forms

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution!

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)). You first prove the validity of the schema:

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)). You first prove the validity of the schema: H : (∀x) F → (¬(∃x) ¬F).

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)). You first prove the validity of the schema: H : (∀x) F → (¬(∃x) ¬F). Then use the substitution σ : {F 7→ (∃y)Q(x, y)}.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)). You first prove the validity of the schema: H : (∀x) F → (¬(∃x) ¬F). Then use the substitution σ : {F 7→ (∃y)Q(x, y)}.

A formula schema H is said to be valid, if Hσ is valid, for every schema substitution σ that respects the side conditions of H.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Schema Substitution

Main Idea Rather than painstakingly prove the validity of individual FOL formulae, prove the validity of a general “schema” and obtain the validity of a particular formula, using substitution! Formula schema and formula substitutions provide the desired generality. Typically, a schema has side conditions, which must be respected during a substitution. For instance, suppose you want to prove the validity of G : (∀x)(∃y)Q(x, y) → (¬(∃x)¬(∃y)Q(x, y)). You first prove the validity of the schema: H : (∀x) F → (¬(∃x) ¬F). Then use the substitution σ : {F 7→ (∃y)Q(x, y)}.

A formula schema H is said to be valid, if Hσ is valid, for every schema substitution σ that respects the side conditions of H. The key point is that the validity of the schema itself can be proved by the semantic argument method.

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Example of proving schema validity

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Example of proving schema validity

Example Prove the validity of

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Example of proving schema validity

Example Prove the validity of

H : (∀x) (F1 ∧ F2) → (∀x) F1 ∧ F2, provided x 6∈ free(F2)

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Application of schema substitution

Subramani First Order Logic Substitution Safe Substitution Normal Forms Schema Substitution Application of schema substitution

Proposition If H is a valid formula schema and σ is a substitution that respects H's side conditions, then Hσ is also valid.

Subramani First Order Logic Substitution Normal Forms Normal Forms

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types (i) NNF.

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types (i) NNF. (ii) PNF.

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types (i) NNF. (ii) PNF. (iii) CNF.

Subramani First Order Logic Substitution Normal Forms Normal Forms

Types (i) NNF. (ii) PNF. (iii) CNF. (iv) DNF.

Subramani First Order Logic Substitution Normal Forms NNF

Subramani First Order Logic Substitution Normal Forms NNF

Technique

Subramani First Order Logic Substitution Normal Forms NNF

Technique

Subramani First Order Logic Substitution Normal Forms NNF

Technique (i) ¬(∀x) F[x] ⇔ (∃x) ¬F[x].

Subramani First Order Logic Substitution Normal Forms NNF

Technique (i) ¬(∀x) F[x] ⇔ (∃x) ¬F[x]. (ii) ¬(∃x) F[x] ⇔ (∀x) ¬F[x].

Subramani First Order Logic Substitution Normal Forms NNF

Technique (i) ¬(∀x) F[x] ⇔ (∃x) ¬F[x]. (ii) ¬(∃x) F[x] ⇔ (∀x) ¬F[x].

Example Let G : (∀x)((∃y) P(x, y) ∧ P(x, z)) → (∃w) P(x, w).

Subramani First Order Logic Substitution Normal Forms NNF

Technique (i) ¬(∀x) F[x] ⇔ (∃x) ¬F[x]. (ii) ¬(∃x) F[x] ⇔ (∀x) ¬F[x].

Example Let G : (∀x)((∃y) P(x, y) ∧ P(x, z)) → (∃w) P(x, w). Put G in NNF.

Subramani First Order Logic Substitution Normal Forms PNF

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1.

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different .

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different name. Call the resultant formula F2.

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different name. Call the resultant formula F2.

(iii) Remove all quantifiers from F2 to produce a quantifier-free formula F3.

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different name. Call the resultant formula F2.

(iii) Remove all quantifiers from F2 to produce a quantifier-free formula F3.

(iv) Add the quantifiers before F3 to get a formula F4, respecting scope rules.

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different name. Call the resultant formula F2.

(iii) Remove all quantifiers from F2 to produce a quantifier-free formula F3.

(iv) Add the quantifiers before F3 to get a formula F4, respecting scope rules. Let F4 be Q1x1Q2x2 ... QnxnF3. If Qj is in the scope of Qi in F1, then we must have i < j.

Subramani First Order Logic Substitution Normal Forms PNF

Definition A formula is in Prenex Normal Form (PNF), if all of its quantifiers appear at the beginning of the formula (e.g. Q1x1Q2x2 ... Qnxn F[x1, x2,..., xn]).

Conversion technique

(i) Convert F into NNF formula F1. (ii) Use renaming with fresh variables to ensure that each quantified variable has a different name. Call the resultant formula F2.

(iii) Remove all quantifiers from F2 to produce a quantifier-free formula F3.

(iv) Add the quantifiers before F3 to get a formula F4, respecting scope rules. Let F4 be Q1x1Q2x2 ... QnxnF3. If Qj is in the scope of Qi in F1, then we must have i < j.

Example Convert the following formula to PNF:

F : (∀x)[¬((∃y) (P(x, y) ∧ P(x, z))) ∨ (∃y) P(x, y)].

Subramani First Order Logic Substitution Normal Forms CNF and DNF

Subramani First Order Logic Substitution Normal Forms CNF and DNF

Definition

Subramani First Order Logic Substitution Normal Forms CNF and DNF

Definition A formula is said to be in CNF (respectively DNF), if it is in PNF, and its quantifier-free subformula is in CNF (respectively DNF).

Subramani First Order Logic