Docsity

First Order Logic: Quantifiers, Negation, and Multiple Quantifiers, Lecture notes of Discrete Mathematics

Partial preview of the text

Download First Order Logic: Quantifiers, Negation, and Multiple Quantifiers and more Lecture notes Discrete Mathematics in PDF only on Docsity!

First Order Logic

Lecture 2: Sep 9

This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order logic, a logic on quantified statements. First order logic is much more expressive than propositional logic. The topics on first order logic are:  Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements

Predicates are propositions (i.e. statements) with variables Example: P ( x,y ) ::= x + 2 = y Predicates x = 1 and y = 3: P (1,3) is true x = 1 and y = 4: P (1,4) is false  P (1,4) is true The domain of a variable is the set of all values that may be substituted in place of the variable. When there is a variable, we need to specify what to put in the variables.

Set We have not defined formally what is a set, and will do so later in the course. For now, it is enough for our discussion to recall some well-known examples. Z: the set of all integers Z

: the set of all positive integers Z

  • : the set of all negative integers R: the set of all real numbers Q: the set of all rational numbers

The Existential Quantifiery There EXISTS some y   x y x.  y Domain Truth value positive integers

integers negative integers

negative reals R

T

e.g. The truth of a predicate depends on the domain. T F T  y Z

P(y) means P(1) P(2) P(3) …

Translating Mathematical Theorem Fermat (1637): If an integer n is greater than 2, then the equation a n

  • b n = c n has no solutions in non-zero integers a, b, and c. Andrew Wiles (1994) http://en.wikipedia.org/wiki/Fermat's_last_theorem

 Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements

Negations of Quantified Statements Everyone likes football. What is the negation of this statement? (generalized) DeMorgan’s Law Not everyone likes football = There exists someone who doesn’t like football. Say the domain has only three values. The same idea can be used to prove it for any number of variables.

 Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements

Order of Quantifiers There is an anti-virus program killing every computer virus. How to interpret this sentence? For every computer virus, there is an anti-virus program that kills it.

  • For every attack, I have a defense:
  • against MYDOOM , use Defender
  • against ILOVEYOU , use Norton
  • against BABLAS , use Zonealarm … is expensive!

Order of Quantifiers Let’s say we have an array A of size 6x6. 1 1 1 1 1 1 1 1 1 Then this table satisfies the statement.

Order of Quantifiers Let’s say we have an array A of size 6x6. 1 1 1 1 1 1 1 1 1 But if the order of the quantifiers are changes, then this table no longer satisfies the new statement.

Questions Are these statements equivalent? Are these statements equivalent? Yes, in general, you can change the order of two “foralls”, and you can change the order of two “exists”.

More Negations There is an anti-virus program killing every computer virus. What is the negation of the above sentence? For every program, there is some virus that it can not kill.