CSCE 222 Lecture 5

From Notes
Jump to navigation Jump to search

« previous | Friday, January 28, 2011 | next »


Predicate Logic

A Predicate is a function that filters from a domain by returning true or false:

EX: domain is all integers; predicate could be P(x) → x > 3
P(4) is true, but P(2) is false

"Predicate holds for all elements of a domain" written as xP(x)

(be aware of what the domain is)

If a predicate holds for any one or more element of a domain, then x P(x) Avoid using set notation (∈)

  • xP(x) returns false if no value of x in D satisfies P(x)
  • xP(x) is false if one value of x in D satisfies P(x)


Equivalence of Predicates

¬xP(x)x¬P(x)¬xP(x)x¬P(x)x(P(x)Q(x))xP(x)xQ(x)


Example

¬x(P(x)Q(x))x(P(x)¬Q(x))x¬(P(x)Q(x))x¬(¬P(x)Q(x))x(¬(¬P(x))¬Q(x))x(P(x)¬Q(x))