Intelligent Systems, part III Intelligent Agents and Knowledge Representation - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Intelligent Systems, part III Intelligent Agents and Knowledge Representation

Description:

Intelligent Systems, part III. Intelligent Agents and Knowledge Representation ... 'You may have cake or you may have ice cream.' 'If pigs can fly, then you can ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 25
Provided by: leonvand
Category:

less

Transcript and Presenter's Notes

Title: Intelligent Systems, part III Intelligent Agents and Knowledge Representation


1
Intelligent Systems, part IIIIntelligent Agents
and Knowledge Representation
  • Lecture 1 Logic and Proofs
  • Leon van der Torre

2
Slides
  • Slides can be found on the internet
  • These slides are based on MIT open courseware,
    by S. Devadas and E. Lehmann

3
What do these sentence mean?
  • You may have cake or you may have ice cream.
  • If pigs can fly, then you can understand the
    Chernoff bound.
  • If you can solve any problem we come up with,
    then you get a 20 for the course.
  • Every American has a dream.

4
Propositions and Boolean variables
  • Proposition is a statement that is true or false.
  • NotWhats a surjection, again? or Learn
    logarithms!
  • All Greeks are human, All humans are mortal.
  • 2  3  5
  • a4 b4  c4  d4 has no solution where a, b, c
    are positive integers. (Euler)
  • Every even integer greater than 2 is the sum of
    two primes. (Goldbach)

5
Combining propositions NOT
  • If all humans are mortal and all Greeks are
    human, then all Greeks are mortal.
  • Truth tables if P denotes an arbitrary
    proposition, then the validity of the proposition
    not P is defined by
  • First row when P is true (T), not P is false
    (F).
  • Second line when P is false, not P is true.

6
Combining propositions AND, OR
  • True / false for each possible setting of
    variables.
  • If a mathematician says You may have cake or
    your may have ice cream, then you can have both.

7
Combining propositions Implies
  • If Goldbachs Conjecture is true, then x 0 for
    every real number x.
  • If pigs fly, then you can understand the
    Chernoff bound.
  • If the moon is white, then the moon is made of
    white cheddar.
  • An implication is true when the if-part is false
    or the then-part is true.

8
Combining propositions If and only if
  • P if and only if Q P and Q logically
    equivalent
  • That is, either both are true or both are false.
  • x2 - 4  0 if and only if x 2
  • Doesnt arise in ordinary speech, abbreviated
    iff.

9
Propositional Logic in Computer Programs
  • if ( x gt 0 (x lt 0 y gt 100) )
  • (further instructions)
    or, and.
  • A or ((not A) and B)  for A
    x gt0, B y gt 100.
  • if ( x gt 0 y gt 100 )
  • (further instructions)
  • Chip designers minimize physical devices on a
    chip

10
Two Cryptic Notations
  • If P and not Q, then R (P ? ?Q) ? R

11
Are these sentences saying the same?
  • If I am hungry (P) , then I am grumpy (Q).
  • If I am not grumpy, then I am not hungry.

12
Are these sentences saying the same?
  • If I am hungry (P) , then I am grumpy (Q).
  • If I am grumpy, then I am hungry.
  • An implication is logically equivalent to its
    contrapositive, but not to its converse.

13
Are these sentences saying the same?
  • These two statements together
  • If I am grumpy, then I am hungry.
  • If I am hungry, then I am grumpy.
  • I am grumpy if and only if I am hungry.

14
Logic exercise
  • In computer chip design, we often use nand
  • Using nand and not, find an equivalent expression
    for A and B, A or B, and A implies B

15
Tautologies
  • P P is a tautology P is always true
  • (P ? Q) ? (Q ? P)
  • P ? (Q ? R) ? (P ? Q) ? R
  • P ? (Q ? R) ? (P ? Q) ? (P ? R)
  • (P ? P) ? P
  • ??P ? P
  • ? (P ? Q) ? ?P ? ?Q

16
SAT
  • Proposition is satisfiable if some setting of
    variables makes it true.
  • P ? Q is satisfiable because it is true when
    P is true and Q is false.
  • P ? P is not satisfiable because it is false for
    both settings of P.
  • How about (P?Q?R)?(?P??Q)?(?P??R)?(?R??Q) ?
  • Deciding whether a proposition is satisfiable is
    called SAT.
  • Construct a truth table and check whether or not
    a T ever appears.
  • Not very efficient a proposition with
    n variables has a truth table with 2n lines.
    With just 30 variables, thats already over a
    billion!
  • Is there an efficient solution to SAT? No one
    knows
  • An efficient solution to SAT would immediately
    imply efficient solutions to many, many other
    important problems involving packing, scheduling,
    routing, and circuit verification, and worldwide
    chaos
  • Decrypting coded messages would also become an
    easy task (for most codes). Online financial
    transactions would be insecure and secret
    communications could be read by everyone.

17
Predicates
  • A predicate is a proposition whose truth depends
    on the value of one or more variables. For
    example,
  • n is a perfect square
  • The predicate is true for n 4 since 4 is a
    perfect square, but false for n 5 since 5 is not
    a perfect square.
  • Function-like notation.
  • P(n) n is a perfect square
  • P(4) is true, and P(5) is false.
  • Note If P is a predicate, then P(n) is either
    true or false, depending on the value of n. If
    P is an ordinary function, like n2  1, then P(n)
    is a numerical quantity.

18
Quantifying a Predicate
  • Two ways to use variables
  • x2  0 is always true when x is a real number.
  • x2 - 9 0 is only sometimes true (when x  
    3).
  • Always True a universal quantification
  • For all x, x2  0. or x2  0 for every x.
  • Sometimes True an existential quantification
  • There exists an x such that x2 - 9 0.
  • x2 - 9 0  for some x.
  • x2 - 9 0  for at least one x.

19
Natural language may be confusing
  • If you can solve any problem we come up with,
    then you get a 20 for the course.
  • Can be interpreted as universal or existential
    quantification
  • you can solve every problem we come up with
  • you can solve at least one problem we come up
    with
  • Note that quantified statements are themselves
    propositions and can be combined with and, or,
    implies, etc. just like any other proposition.

20
More Cryptic Notation
  • Predicate P(n) is true for all values of n in
    some set S
  • ?n ?S P(n)  for all n in S, P(n) is true.
  • Predicate P(n) is true for at least one value of
    n in S
  • ?p?S P(n) There exists an n in S such that P(n)
    is true.
  • ? and ? are always followed by a variable and
    predicate.
  • Let P be the set of problems we come up with,
    S(x) be the predicate You can solve problem x,
    and A be the proposition, You get an 20 for the
    course.
  • (?x ?P S(x)) ? A you can solve every problem we
    come up with
  • (?x ?P S(x)) ? A you can solve at least one
    problem we come up with

21
Mixing of Quantifiers
  • Every even integer greater than 2 is the sum of
    two primes. (Goldbach)
  • For every even integer n greater than 2, there
    exist primes p and q such that npq.
  • Let E be the set of even integers greater than 2,
    and let P be the set of primes
  • ?n ?E ? p?P ? q?P npq

22
Order of Quantifiers
  • Every American has a dream.
  • Let A be the set of Americans, D be the set of
    dreams, and predicate H(a,d) be American a has
    dream d..
  • There is a single dream every American shares
  • ?d ? D ?a ? A H(a,d)
  • Every American has an individual dream
  • ?a ? A ?d ? D H(a,d)
  • Swapping quantifiers in Goldbachs Conjecture
  • ?p ? P ?q ? P ?n ? E npq

23
Negating Quantifiers
  • The following two sentences mean the same thing
  • It is not the case that everyone likes to
    snowboard.
  • There exists someone who does not like to
    snowboard.
  • Similarly, these sentences mean the same thing
  • There does not exist anyone who likes skiing
    over magma.
  • Everyone dislikes skiing over magma.
  • Moving a not across a quantifier changes
    quantifier.
  • ??x P(x) ? ?x ?P(x) ??x P(x) ? ?x
    ?P(x)

24
Logic test
  • Prove using truth tables that ? (P ? Q) ? ?P
    ? ?Q
  • Let Cn(S) p S p Give ten distinct
    elements of Cn(p/\q)
  • Formalize in first order logic
  • "All red cars are owned by students
  • "Everybody, who owns a red car, is rich."
  • "At least two students own a red car."
  • "Fred owns a blue car."
  • "Every student living in L. owns at least one
    blue car
  • "Some students are rich."
Write a Comment
User Comments (0)
About PowerShow.com