first order logic - syntax and...

98
Outline First Order Logic - Syntax and Semantics K. Subramani 1 1 Lane Department of Computer Science and Electrical Engineering West Virginia University 30 January, 4 February, 6 February 2013 Subramani First Order Logic

Upload: others

Post on 13-Jan-2020

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

Outline

First Order Logic - Syntax and Semantics

K. Subramani1

1Lane Department of Computer Science and Electrical EngineeringWest Virginia University

30 January, 4 February, 6 February 2013

Subramani First Order Logic

Page 2: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

Outline

Outline

1 Motivation

Subramani First Order Logic

Page 3: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

Outline

Outline

1 Motivation

2 SyntaxTranslation

Subramani First Order Logic

Page 4: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

Outline

Outline

1 Motivation

2 SyntaxTranslation

3 Semantics

Subramani First Order Logic

Page 5: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Subramani First Order Logic

Page 6: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Limitations of Propositional Logic

Subramani First Order Logic

Page 7: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Limitations of Propositional Logic

Propositional Logic has limited expressiveness.

Subramani First Order Logic

Page 8: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Limitations of Propositional Logic

Propositional Logic has limited expressiveness. For instance, how would you capturethe assertion, “Property P is true of every positive number”?

Subramani First Order Logic

Page 9: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Limitations of Propositional Logic

Propositional Logic has limited expressiveness. For instance, how would you capturethe assertion, “Property P is true of every positive number”? P1 ∧ P2 . . . P∞ is neithercompact nor useful.

Subramani First Order Logic

Page 10: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

First Order Logic

Limitations of Propositional Logic

Propositional Logic has limited expressiveness. For instance, how would you capturethe assertion, “Property P is true of every positive number”? P1 ∧ P2 . . . P∞ is neithercompact nor useful.First-order Logic (FOL) extends Propositional Logic (PL) with predicates, functions andquantifiers.

Subramani First Order Logic

Page 11: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Subramani First Order Logic

Page 12: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

Subramani First Order Logic

Page 13: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

Subramani First Order Logic

Page 14: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

Subramani First Order Logic

Page 15: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

(iii) The existential quantifier (∃x)P(x) indicates that property P holds for some x insome domain.

Subramani First Order Logic

Page 16: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

(iii) The existential quantifier (∃x)P(x) indicates that property P holds for some x insome domain.

(iv) A function is a mapping from the domain of interest to a range.

Subramani First Order Logic

Page 17: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

(iii) The existential quantifier (∃x)P(x) indicates that property P holds for some x insome domain.

(iv) A function is a mapping from the domain of interest to a range.

(v) Variables are used as placeholders (0-ary predicates).

Subramani First Order Logic

Page 18: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

(iii) The existential quantifier (∃x)P(x) indicates that property P holds for some x insome domain.

(iv) A function is a mapping from the domain of interest to a range.

(v) Variables are used as placeholders (0-ary predicates).

(vi) Constants are used to represent values that do not change.

Subramani First Order Logic

Page 19: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Syntax of FOL

Basics

(i) Predicates are used to describe properties of objects. e.g., P(x) could stand forthe property that x is divisible by 3.

(ii) The universal quantifier (∀x)P(x) indicates that property P holds for all x in somedomain.

(iii) The existential quantifier (∃x)P(x) indicates that property P holds for some x insome domain.

(iv) A function is a mapping from the domain of interest to a range.

(v) Variables are used as placeholders (0-ary predicates).

(vi) Constants are used to represent values that do not change.

(vii) Terms, atom, literal, formula.

Subramani First Order Logic

Page 20: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Subramani First Order Logic

Page 21: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Subramani First Order Logic

Page 22: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

Subramani First Order Logic

Page 23: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier.

Subramani First Order Logic

Page 24: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier.

Subramani First Order Logic

Page 25: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies.

Subramani First Order Logic

Page 26: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Subramani First Order Logic

Page 27: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

Subramani First Order Logic

Page 28: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

(i) Existential closure.

Subramani First Order Logic

Page 29: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

(i) Existential closure.

(ii) Universal closure.

Subramani First Order Logic

Page 30: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

(i) Existential closure.

(ii) Universal closure.

Subformulas and Subterms

Subramani First Order Logic

Page 31: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

(i) Existential closure.

(ii) Universal closure.

Subformulas and Subterms

1 Subformulas and strict subformulas.

Subramani First Order Logic

Page 32: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Scope

Bound and Free variables

Consider the expression:

(∀x)[Q(x, y) → (∃y)R(x, y)]

The x occurrences are bound to the (∀x) quantifier. The first y is said to be a freevariable, since it is not bound to any quantifier. The scope of a quantifier is the portionof the predicate formula to which it applies. A formula F is closed if it has no freevariables.

Closures

(i) Existential closure.

(ii) Universal closure.

Subformulas and Subterms

1 Subformulas and strict subformulas.2 Subterms and strict subterms.

Subramani First Order Logic

Page 33: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Outline

1 Motivation

2 SyntaxTranslation

3 Semantics

Subramani First Order Logic

Page 34: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Subramani First Order Logic

Page 35: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task!

Subramani First Order Logic

Page 36: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous).

Subramani First Order Logic

Page 37: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Subramani First Order Logic

Page 38: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

Subramani First Order Logic

Page 39: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly.

Subramani First Order Logic

Page 40: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

Subramani First Order Logic

Page 41: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly.

Subramani First Order Logic

Page 42: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly. (∃x)[P(x) ∧ U(x)].

Subramani First Order Logic

Page 43: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly. (∃x)[P(x) ∧ U(x)].

(iii) All dogs chase all rabbits.

Subramani First Order Logic

Page 44: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly. (∃x)[P(x) ∧ U(x)].

(iii) All dogs chase all rabbits. (∀x)[D(x) → (∀y)[R(y) → C(x, y)]].

Subramani First Order Logic

Page 45: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly. (∃x)[P(x) ∧ U(x)].

(iii) All dogs chase all rabbits. (∀x)[D(x) → (∀y)[R(y) → C(x, y)]].

(iv) Some dogs chase all rabbits.

Subramani First Order Logic

Page 46: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Converting English to Predicate Logic

Note

Not an easy task! More than one result possible, depending on semantics of Englishlanguage (which is not unambiguous). “Hang him not, let him free” and “Hang him, notlet him free”!

Example

(i) All parrots are ugly. (∀x)[P(x) → U(x)].

(ii) Some parrots are ugly. (∃x)[P(x) ∧ U(x)].

(iii) All dogs chase all rabbits. (∀x)[D(x) → (∀y)[R(y) → C(x, y)]].

(iv) Some dogs chase all rabbits. (∃x)[D(x) ∧ (∀y)[R(y) → C(x, y)]].

Subramani First Order Logic

Page 47: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Exercise

Exercise

Let S(x) denote “x is a student”, I(x) denote “x is intelligent” and M(x) denote “x likesmusic”.

Subramani First Order Logic

Page 48: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Exercise

Exercise

Let S(x) denote “x is a student”, I(x) denote “x is intelligent” and M(x) denote “x likesmusic”. Give predicate wffs for:

(i) All students are intelligent.

(ii) Some intelligent students like music.

(iii) Only intelligent students like music.

Subramani First Order Logic

Page 49: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Exercise

Exercise

Let S(x) denote “x is a student”, I(x) denote “x is intelligent” and M(x) denote “x likesmusic”. Give predicate wffs for:

(i) All students are intelligent.

(ii) Some intelligent students like music.

(iii) Only intelligent students like music.

Solution

(i) (∀x)[S(x) → I(x)].

Subramani First Order Logic

Page 50: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Exercise

Exercise

Let S(x) denote “x is a student”, I(x) denote “x is intelligent” and M(x) denote “x likesmusic”. Give predicate wffs for:

(i) All students are intelligent.

(ii) Some intelligent students like music.

(iii) Only intelligent students like music.

Solution

(i) (∀x)[S(x) → I(x)].

(ii) (∃x)[S(x) ∧ I(x) ∧ M(x)].

Subramani First Order Logic

Page 51: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

Exercise

Exercise

Let S(x) denote “x is a student”, I(x) denote “x is intelligent” and M(x) denote “x likesmusic”. Give predicate wffs for:

(i) All students are intelligent.

(ii) Some intelligent students like music.

(iii) Only intelligent students like music.

Solution

(i) (∀x)[S(x) → I(x)].

(ii) (∃x)[S(x) ∧ I(x) ∧ M(x)].

(iii) (∀x)[M(x) → [S(x) ∧ I(x)]].

Subramani First Order Logic

Page 52: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

FOL in mathematics

Subramani First Order Logic

Page 53: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

FOL in mathematics

Example

Subramani First Order Logic

Page 54: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

FOL in mathematics

Example

(i) The length of one side of a triangle is less than the sum of the lengths of the othertwo sides.

Subramani First Order Logic

Page 55: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

SemanticsTranslation

FOL in mathematics

Example

(i) The length of one side of a triangle is less than the sum of the lengths of the othertwo sides.

(ii) Fermat’s last theorem.

Subramani First Order Logic

Page 56: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Subramani First Order Logic

Page 57: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

Subramani First Order Logic

Page 58: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

Subramani First Order Logic

Page 59: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

Subramani First Order Logic

Page 60: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I,

Subramani First Order Logic

Page 61: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function.

Subramani First Order Logic

Page 62: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain,

Subramani First Order Logic

Page 63: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain,

Subramani First Order Logic

Page 64: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain,

Subramani First Order Logic

Page 65: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Subramani First Order Logic

Page 66: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

Subramani First Order Logic

Page 67: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

Subramani First Order Logic

Page 68: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

(ii) G : (∀x) P(x, a)?

Subramani First Order Logic

Page 69: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

(ii) G : (∀x) P(x, a)?

These questions are meaningless without the interpretation! Consider the followinginterpretation for G:

Subramani First Order Logic

Page 70: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

(ii) G : (∀x) P(x, a)?

These questions are meaningless without the interpretation! Consider the followinginterpretation for G: The domain is the set of natural numbers N = {0, 1, ...,}, P(x, y)stands for x ≥ y and a is 0.

Subramani First Order Logic

Page 71: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

(ii) G : (∀x) P(x, a)?

These questions are meaningless without the interpretation! Consider the followinginterpretation for G: The domain is the set of natural numbers N = {0, 1, ...,}, P(x, y)stands for x ≥ y and a is 0. Clearly, in this interpretation, the expression is true.

Subramani First Order Logic

Page 72: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Semantics

Main Points

(i) As with propositional logic, a FOL formula evaluates to true or false.

(ii) Terms of a FOL formula evaluate to values from a specified domain.

(iii) A first order interpretation I, is a 2-tuple (DI , αI), where DI is a non-empty setcalled the domain of interpretation and αI is an assignment function. Theassignment function maps constants and variables in the expression to objects inthe domain, predicates in the domain to properties of objects in the domain, andfunctions in the expression to functions over the domain, respecting arity.

Example

What is the truth-value of

(i) F : x + y ≥ z → y ≥ z − x?

(ii) G : (∀x) P(x, a)?

These questions are meaningless without the interpretation! Consider the followinginterpretation for G: The domain is the set of natural numbers N = {0, 1, ...,}, P(x, y)stands for x ≥ y and a is 0. Clearly, in this interpretation, the expression is true. Canyou think of an interpretation in which G is false?

Subramani First Order Logic

Page 73: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Subramani First Order Logic

Page 74: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Subramani First Order Logic

Page 75: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

Subramani First Order Logic

Page 76: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

Subramani First Order Logic

Page 77: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Subramani First Order Logic

Page 78: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Subramani First Order Logic

Page 79: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms.

Subramani First Order Logic

Page 80: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

Subramani First Order Logic

Page 81: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] =

Subramani First Order Logic

Page 82: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] = αI [f (αI [t1], αI [t2], . . . αI [tn]].

Subramani First Order Logic

Page 83: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] = αI [f (αI [t1], αI [t2], . . . αI [tn]].

(ii) αI [p(t1, t2, . . . tn)] =

Subramani First Order Logic

Page 84: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] = αI [f (αI [t1], αI [t2], . . . αI [tn]].

(ii) αI [p(t1, t2, . . . tn)] = αI [p(αI [t1], αI [t2], . . . αI [tn]].

Subramani First Order Logic

Page 85: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] = αI [f (αI [t1], αI [t2], . . . αI [tn]].

(ii) αI [p(t1, t2, . . . tn)] = αI [p(αI [t1], αI [t2], . . . αI [tn]].

ThenI |= p(t1, t2, . . . tn) iff

Subramani First Order Logic

Page 86: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Inductive definition of semantics

Goal

Given a FOL formula F and an interpretation I : (DI , αI), we want to compute if Fevaluates to true, under that interpretation.

Truth Symbols

(i) I |= ⊤.

(ii) I 6|=⊥.

Atoms

Use the assignment function αI to recursively evaluate arbitrary terms and arbitraryatoms. For instance,

(i) αI [f (t1, t2, . . . tn)] = αI [f (αI [t1], αI [t2], . . . αI [tn]].

(ii) αI [p(t1, t2, . . . tn)] = αI [p(αI [t1], αI [t2], . . . αI [tn]].

ThenI |= p(t1, t2, . . . tn) iff αI [p(αI [t1], αI [t2], . . . αI [tn]] = true.

Subramani First Order Logic

Page 87: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

Subramani First Order Logic

Page 88: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

Subramani First Order Logic

Page 89: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

Subramani First Order Logic

Page 90: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

Subramani First Order Logic

Page 91: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

Subramani First Order Logic

Page 92: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Subramani First Order Logic

Page 93: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

Subramani First Order Logic

Page 94: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

(i) I |= (∀x) F if and only if for every v ∈ D, I ⊳ {x 7→ v} |= F .

Subramani First Order Logic

Page 95: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

(i) I |= (∀x) F if and only if for every v ∈ D, I ⊳ {x 7→ v} |= F .

(ii) I |= (∃x) F if and only if there exists some v ∈ D, I ⊳ {x 7→ v} |= F .

Subramani First Order Logic

Page 96: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

(i) I |= (∀x) F if and only if for every v ∈ D, I ⊳ {x 7→ v} |= F .

(ii) I |= (∃x) F if and only if there exists some v ∈ D, I ⊳ {x 7→ v} |= F .

Example

Consider the formula F : x + y > z → y > z − x .

Subramani First Order Logic

Page 97: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

(i) I |= (∀x) F if and only if for every v ∈ D, I ⊳ {x 7→ v} |= F .

(ii) I |= (∃x) F if and only if there exists some v ∈ D, I ⊳ {x 7→ v} |= F .

Example

Consider the formula F : x + y > z → y > z − x . Is F true

Subramani First Order Logic

Page 98: First Order Logic - Syntax and Semanticscommunity.wvu.edu/~krsubramani/courses/sp13/dm2/lecnotes/fol/fol-synsym.pdfMotivation Syntax Semantics Translation Syntax of FOL Basics (i)

MotivationSyntax

Semantics

Completing the induction

General unquantified FOL formulas

(i) I |= ¬F iff I 6|= F .

(ii) I |= F1 ∧ F2 iff I |= F1 and I |= F2.

(iii) I |= F1 ∨ F2 iff I |= F1 or I |= F2.

(iv) I |= F1 → F2 iff if I |= F1, then I |= F2.

Quantified Formulas

(i) I |= (∀x) F if and only if for every v ∈ D, I ⊳ {x 7→ v} |= F .

(ii) I |= (∃x) F if and only if there exists some v ∈ D, I ⊳ {x 7→ v} |= F .

Example

Consider the formula F : x + y > z → y > z − x . Is F true under the interpretationI : (Z, αI), where αI : {+ 7→ +Z,− 7→ −Z, > 7→ >Z, x 7→ 13Z, y 7→ 42Z, z 7→ 1Z}?

Subramani First Order Logic