Syntax of Predicate Logic: Understanding Terms, Formulas, and Substitution, Summaries of Logic

An in-depth exploration of the syntax of predicate logic, focusing on terms, formulas, and substitution. It covers the definitions of terms and formulas, the difference between free and bound variables, and the process of substitution. The document also includes examples to illustrate the concepts.

Typology: Summaries

2021/2022

Uploaded on 09/27/2022

aramix
aramix ๐Ÿ‡ฌ๐Ÿ‡ง

4.5

(29)

367 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Syntax of Predicate Logic
Syntax of Predicate Logic 1/25
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Syntax of Predicate Logic: Understanding Terms, Formulas, and Substitution and more Summaries Logic in PDF only on Docsity!

Syntax of Predicate Logic

Syntax of Predicate Logic 1/

The Language of Predicate Logic

  • Domain: a non-empty set of objects
  • (^) Constants: concrete objects in the domain
  • Variables: placeholders for concrete objects in the domain
  • (^) Functions: takes objects in the domain as arguments and returns an object of the domain.
  • Predicates: takes objects in the domain as arguments and returns true or false. They describe properties of objects or relationships between objects.
  • (^) Quantifiers: for how many objects in the domain is the statement true?

Syntax of Predicate Logic 2/

Functions

Using functions allows us to avoid ugly/inelegant predicate logic formulas.

Try translating the following sentence with and without functions.

โ€œAndy and Paul have the same maternal grandmother.โ€

Syntax of Predicate Logic 4/

The Language of Predicate Logic

The seven kinds of symbols:

  1. Constant symbols. Usually ๐‘, ๐‘‘, ๐‘ 1 , ๐‘ 2 , โ€ฆ , ๐‘‘ 1 , ๐‘‘ 2 โ€ฆ
  2. Variables. Usually ๐‘ฅ, ๐‘ฆ, ๐‘ง, โ€ฆ ๐‘ฅ 1 , ๐‘ฅ 2 , โ€ฆ , ๐‘ฆ 1 , ๐‘ฆ 2 โ€ฆ
  3. Function symbols. Usually ๐‘“, ๐‘”, โ„Ž, โ€ฆ ๐‘“ 1 , ๐‘“ 2 , โ€ฆ , ๐‘” 1 , ๐‘” 2 , โ€ฆ
  4. Predicate symbols. ๐‘ƒ , ๐‘„, โ€ฆ๐‘ƒ 1 , ๐‘ƒ 2 , โ€ฆ, ๐‘„ 1 , ๐‘„ 2 , โ€ฆ
  5. Connectives: ยฌ, โˆง, โˆจ, โ†’, and โ†”
  6. Quantifiers: โˆ€ and โˆƒ
  7. Punctuation: โ€˜(โ€™, โ€˜)โ€™, and โ€˜,โ€™

Function symbols and predicate symbols have an assigned arity โ€”the number of arguments required. For example,

  • (^) ๐‘“(1): ๐‘“ is a unary function.
  • ๐‘ƒ (2): ๐‘ƒ is a binary predicate.

Syntax of Predicate Logic Symbols 5/

Terms

Each term refers to an object of the domain.

We define the set of terms inductively as follows.

  1. Each constant symbol is an atomic term.
  2. Each variable is an atomic term.
  3. ๐‘“(๐‘ก 1 , โ€ฆ , ๐‘ก๐‘›) is a term if ๐‘ก 1 , โ€ฆ , ๐‘ก๐‘› are terms and ๐‘“ is an ๐‘›-ary function symbol. (If ๐‘“ is a binary function symbol, then we may write (๐‘ก 1 ๐‘“ ๐‘ก 2 ) instead of ๐‘“(๐‘ก 1 , ๐‘ก 2 ).)
  4. Nothing else is a term.

Syntax of Predicate Logic Terms and Formulas 7/

Which expressions are terms?

A term refers to an object of the domain.

Which of the following expressions is a term?

a. ๐‘”(๐‘‘, ๐‘‘)

b. ๐‘ƒ (๐‘“(๐‘ฅ, ๐‘ฆ), ๐‘‘)

c. ๐‘“(๐‘ฅ, ๐‘”(๐‘ฆ, ๐‘ง), ๐‘‘)

d. ๐‘”(๐‘ฅ, ๐‘“(๐‘ฆ, ๐‘ง), ๐‘‘)

Let ๐‘‘ be a constant symbol. Let ๐‘ƒ be a predicate symbol with 2 arguments. Let ๐‘“ be a function symbol with 2 arguments and ๐‘” be a function symbol with 3 arguments. Let ๐‘ฅ, ๐‘ฆ, and ๐‘ง be variable symbols.

Syntax of Predicate Logic Terms and Formulas 8/

Well-Formed Predicate Logic Formulas

We define the set of well-formed formulas of predicate logic inductively as follows.

  1. ๐‘ƒ (๐‘ก 1 , โ€ฆ , ๐‘ก๐‘›) is an atomic formula if ๐‘ƒ is an ๐‘›-ary predicate symbol and each ๐‘ก๐‘– is a term (1 โ‰ค ๐‘– โ‰ค ๐‘›).
  2. (ยฌ๐›ผ) is a formula if ๐›ผ is a formula.
  3. (๐›ผ โ‹† ๐›ฝ) is a formula if ๐›ผ and ๐›ฝ are formulas and โ‹† is a binary connective symbol.
  4. Each of (โˆ€๐‘ฅ ๐›ผ) and (โˆƒ๐‘ฅ ๐›ผ) is a formula if ๐›ผ is a formula and ๐‘ฅ is a variable.
  5. Nothing else is a formula.

Syntax of Predicate Logic Terms and Formulas 10/

Determine whether a formula is well-formed

๐‘š is a constant and ๐‘ฅ and ๐‘ฆ are variables. ๐‘ƒ (2)^ and ๐‘„(2)^ are binary predicates. ๐‘“(1)^ is a unary function.

Which of the following is a well-formed predicate logic formula?

a. (๐‘“(๐‘ฅ) โ†’ ๐‘ƒ (๐‘ฅ, ๐‘ฆ))

b. โˆ€๐‘ฆ ๐‘ƒ (๐‘š, ๐‘“(๐‘ฆ))

c. ๐‘ƒ (๐‘ฅ, ๐‘ฆ) โ†’ ๐‘„(๐‘„(๐‘ฅ))

d. ๐‘„(๐‘š, ๐‘“(๐‘š))

e. ๐‘ƒ (๐‘š, ๐‘“(๐‘„(๐‘ฅ, ๐‘ฆ)))

Syntax of Predicate Logic Terms and Formulas 11/

Comparing the Definitions of WFFs

Letโ€™s compare and contrast the definitions of WFFs for propositional and predicate logic.

  • Which parts of the two definitions are the same?
  • (^) The definition of WFF for propositional logic says that a propositional variable is an atomic WFF. Is this still the case for predicate logic?
  • (^) What is new in the definition of WFF for predicate logic compared to the definition of WFF for propositional logic?
  • (^) If we were to prove that every WFF for predicate logic has a property P by structural induction , what does the proof look like? What are the base case(s) and what are the cases in the induction step?

Syntax of Predicate Logic Terms and Formulas 13/

Parse Trees of Predicate Logic Formulas

New elements in the parse tree:

  • Quantifiers โˆ€๐‘ฅ and โˆƒ๐‘ฆ has one subtree, similar to the unary connective negation.
  • A predicate ๐‘ƒ (๐‘ก 1 , ๐‘ก 2 , โ€ฆ , ๐‘ก๐‘›) has a node labelled ๐‘ƒ with a sub-tree for each of the terms ๐‘ก 1 , ๐‘ก 2 , โ€ฆ , ๐‘ก๐‘›.
  • A function ๐‘“(๐‘ก 1 , ๐‘ก 2 , โ€ฆ , ๐‘ก๐‘›) has a node labelled ๐‘“ with a sub-tree for each of the terms ๐‘ก 1 , ๐‘ก 2 , โ€ฆ , ๐‘ก๐‘›.

Example 1: (โˆ€๐‘ฅ (๐‘ƒ (๐‘ฅ) โˆง ๐‘„(๐‘ฅ))) โ†’ (ยฌ(๐‘ƒ (๐‘“(๐‘ฅ, ๐‘ฆ)) โˆจ ๐‘„(๐‘ฆ)))

Example 2: (โˆ€๐‘ฅ ((๐‘ƒ (๐‘ฅ) โˆง ๐‘„(๐‘ฅ)) โ†’ (ยฌ(๐‘ƒ (๐‘“(๐‘ฅ, ๐‘ฆ)) โˆจ ๐‘„(๐‘ฆ)))))

Syntax of Predicate Logic Terms and Formulas 14/

Free and Bound Variables

In a formula (โˆ€๐‘ฅ ๐›ผ) or (โˆƒ๐‘ฅ ๐›ผ), the scope of a quantifier is the formula ๐›ผ. A quantifier binds its variable within its scope.

An occurrence of a variable in a formula is bound if it lies in the scope of some quantifier of the same variable. Otherwise the occurrence of this variable is free.

  • If a variable occurs multiple times, we need to consider each occurrence of the variable separately.
  • (^) The variable symbol immediately after โˆƒ or โˆ€ is neither free nor bound.

A formula with no free variables is called a closed formula or sentence.

Syntax of Predicate Logic Free and Bound Variables 16/

Determine whether a variable is free or bound

Determine whether a variable is free or bound using a parse tree.

  1. Draw the parse tree for the formula.
  2. Choose the leaf node for an occurrence of a variable.
  3. Walk up the tree. Stop as soon as we encounter a quantifier for this variable or we reach the root of the tree.
  4. If we encountered a quantifier for the variable , this occurrence of the variable is bound.
  5. If we reached the root of the tree which is not a quantifier for the variable , this occurrence of the variable is free.

Example 1: (โˆ€๐‘ฅ (๐‘ƒ (๐‘ฅ) โˆง ๐‘„(๐‘ฅ))) โ†’ (ยฌ(๐‘ƒ (๐‘“(๐‘ฅ, ๐‘ฆ)) โˆจ ๐‘„(๐‘ฆ)))

Example 2: (โˆ€๐‘ฅ ((๐‘ƒ (๐‘ฅ) โˆง ๐‘„(๐‘ฅ)) โ†’ (ยฌ(๐‘ƒ (๐‘“(๐‘ฅ, ๐‘ฆ)) โˆจ ๐‘„(๐‘ฆ)))))

Syntax of Predicate Logic Free and Bound Variables 17/

Substitution

Intuitively, ๐›ผ[๐‘ก/๐‘ฅ] answers the question,

โ€œWhat happens to ๐›ผ if ๐‘ฅ has the value specified by term ๐‘ก?โ€

For a variable ๐‘ฅ, a term ๐‘ก, and a formula ๐›ผ, ๐›ผ[๐‘ก/๐‘ฅ] denotes the resulting formula by replacing each free occurrence of ๐‘ฅ in ๐›ผ with ๐‘ก. In other words, substitution does NOT affect bound occurrences of the variable.

Syntax of Predicate Logic Substitution 19/

Examles of Substitution

Examples.

  • If ๐›ผ is the formula ๐ธ(๐‘“(๐‘ฅ)), then ๐›ผ[(๐‘ฆ + ๐‘ฆ)/๐‘ฅ] is ๐ธ(๐‘“(๐‘ฆ + ๐‘ฆ)).
  • (^) ๐›ผ[๐‘“(๐‘ฅ)/๐‘ฅ] is ๐ธ(๐‘“(๐‘“(๐‘ฅ))).
  • ๐ธ(๐‘“(๐‘ฅ + ๐‘ฆ))[๐‘ฆ/๐‘ฅ] is ๐ธ(๐‘“(๐‘ฆ + ๐‘ฆ)).
  • If ๐›ฝ is (โˆ€๐‘ฅ (๐ธ(๐‘“(๐‘ฅ)) โˆง ๐‘†(๐‘ฅ, ๐‘ฆ))), then ๐›ฝ[๐‘”(๐‘ฅ, ๐‘ฆ)/๐‘ฅ] is ๐›ฝ, because ๐›ฝ has no free occurrence of ๐‘ฅ.

Syntax of Predicate Logic Substitution 20/