Predicate Logic

  • Variables

  • Predicates

  • Quantifiers

  • E.g: (Predicate Logic)

    • Let P(x) denote “x>0”, then
      • is true
      • is false
      • is NOT a proposition
  • (E.g. 2) Predicate Logic

    • Let Q(x, y) denote “x = y + 3”, then
      • Q(1,2) is false
      • Q(3,0) is true

Quantifiers

We need quantifiers to express the meaning of words including all and some.

  • Universal Quantifiers . asserts P(x) is true for every x in the domain
  • Existential Quantifier asserts P(x) is true for some x in the domain

E.g (quantifier):
If P(x) denotes “x is even” and U the integers, then

  • . P(x) is false. but
  • . P(x) is true

The domain is often denoted by U for universe of discourse

Example (precedence)
means )

Domain

The truth values of and . P(x) depend on both

  • the predicate P(x) and
  • the domain U
    Example (Quantifiers):
  • If U is the positive integers and P(x) is the statement “x<2”, then is true, but is false.
  • If U is the negative integers and P(x) is the statement “x<2”, then both is and are true.

Nested Quantifiers

Nested Quantifiers are often necessary to express the meaning of sentences in English as well as important concepts in Computer Science and mathematics

E.g:
where the domains of x and y are the integers.

Let denote “x+y=0” and assume that U is the integers. What is truth value of it is False

  • Q(x, y) is true, but
  • Q(x, y) is false

Equivalences in Predicate Logic

Two statements S and T involving predicates and quanrtifiers are logically equivalent, denoted S \equiv T, if and only if they have the same truth value

  • for every predicate substitute statements
  • for every domain of discourse used for the variables in the expressions

E.g( Equivalences)

  • If U consists of the integers 1,2 and 3:

De Morgan’s Laws for Quantifiers

Example (De Morgan’s Laws for Quantifiers)

  • Not every student in your class who has taken a course in Java
  • means every student in your class has not taken Java