1 / 61

Artificial Intelligence

Artificial Intelligence. Knowledge Representation Problem. Knowledge bases. Knowledge base = set of sentences in a formal language. Stages of Knowledge Use. Acquisition structure of facts integration of old & new knowledge Retrieval (recall) roles of linking and chunking

Download Presentation

Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Artificial Intelligence Knowledge Representation Problem

  2. Knowledge bases • Knowledge base = set of sentences in a formal language

  3. Stages of Knowledge Use • Acquisition • structure of facts • integration of old & new knowledge • Retrieval (recall) • roles of linking and chunking • means of improving recall efficiency

  4. Representation • Set of syntactic and semantic conventions which make it possible to describe things • Syntax • specific symbols allowed and rules allowed • Semantics • how meaning is associated with symbol arrangements allowed by syntax

  5. Knowledge Representation Schemas • Logic based representation – first order predicate logic, Prolog • Procedural representation – rules, production system • Network representation – semantic networks, conceptual graphs • Structural representation – scripts, frames, objects

  6. Conceptual Graphs • each concept has got its type and an instance general concept – a concept with a wildcard instance specific concept – a concept with a concrete instance • there exsists a hierarchy of types subtype: • concept w is specialisation of concept v iftype(v)>type(w) or instance(w)::type(v) colour dog:*X brown colour dog:Emma brown animal dog cat

  7. Types of Knowledge • Objects • both physical & concepts • Events • usually involve time • maybe cause & effect relationships • Performance • how to do things • META Knowledge • knowledge about how to use knowledge

  8. Proposition logic

  9. Basic connectives and truth tables statements (propositions): declarative sentences that are either true or false--but not both. Eg. Ahmed Hassan wrote Gone with the Wind. 2+3=5. not statements: What a beautiful morning! Get up and do your exercises.

  10. Fundamentals of Logic "The number x is an integer." is not a statement because its truth value cannot be determined until a numerical value is assigned for x.

  11. Propositional logic • Logical constants: true, false • Propositional symbols: P, Q, S, ... (atomic sentences) • Sentences are combined by connectives: ...and [conjunction] ...or [disjunction] ...implies [implication / conditional] ..is equivalent [biconditional] ...not [negation] • Literal: atomic sentence or negated atomic sentence

  12. Truth Tables p q 0 0 0 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1

  13. Examples of PL sentences • P means “It is hot.” • Q means “It is humid.” • R means “It is raining.” • (P  Q)  R “If it is hot and humid, then it is raining” • Q  P “If it is humid, then it is hot” • A better way: Hot = “It is hot” Humid = “It is humid” Raining = “It is raining”

  14. Example s: Aya goes out for a walk. t: The moon is out. u: It is snowing. : If the moon is out and it is not snowing, then Aya goes out for a walk. If it is snowing and the moon is not out, then Aya will not go out for a walk.

  15. Logical Equivalence p q 0 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1

  16. Logical equivalence • Two sentences are logically equivalent} iff true in same models: α ≡ ß iff α╞ βand β╞ α

  17. Identity laws Like adding 0 Domination laws Like multiplying by 0 Idempotent laws Delete redundancies Double negation “I don’t like you, not” Commutativity Like “x+y = y+x” Associativity Like “(x+y)+z = y+(x+z)” Distributivity Like “(x+y)z = xz+yz” De Morgan Tables of Logical Equivalences

  18. Excluded middle Negating creates opposite Definition of implication in terms of Not and Or Tables of Logical Equivalences

  19. Fundamentals of Logic A compound statement is called a tautology(T0) if it is true for all truth value assignments for its component statements. If a compound statement is false for all such assignments, then it is called a contradiction(F0). : tautology : contradiction

  20. Propositional Logic - 2 more defn… A tautology is a proposition that’s always TRUE. A contradiction is a proposition that’s always FALSE. T T F F

  21. Tautology example Demonstrate that [¬p(p q )]q is a tautology in two ways: • Using a truth table – show that [¬p(p q )]q is always true • Using a proof (will get to this later).

  22. Tautology by truth table

  23. Tautology by truth table

  24. Tautology by truth table

  25. Tautology by truth table

  26. Tautology by truth table

  27. Derivational Proof Techniques EG: consider the compound proposition (p p )  ((sr)t) )  (qr ) Q: Why is this a tautology?

  28. Derivational Proof Techniques A: Part of it is a tautology (p p ) and the disjunction of True with any other compound proposition is still True: (p p )  ((sr)t ))  (qr ) • T  ((sr)t ))  (qr ) • T Derivational techniques formalize the intuition of this example.

  29. Tautology by proof [¬p(p q )]q

  30. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive

  31. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE

  32. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity

  33. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE

  34. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan

  35. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan [p ¬q ] q Double Negation

  36. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan [p ¬q ] q Double Negation p [¬q q ]Associative

  37. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan [p ¬q ] q Double Negation p [¬q q ]Associative p [q ¬q ]Commutative

  38. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan [p ¬q ] q Double Negation p [¬q q ]Associative p [q ¬q ]Commutative p T ULE

  39. Tautology by proof [¬p(p q )]q [(¬pp)(¬pq)]q Distributive [ F (¬pq)]q ULE [¬pq ]q Identity ¬[¬pq ] q ULE [¬(¬p)¬q ] q DeMorgan [p ¬q ] q Double Negation p [¬q q ]Associative p [q ¬q ]Commutative p T ULE T Domination

  40. Examples • “I don’t study well and fail” is logically equivalent to “If I study well, then I don’t fail” • Write a C program that represents the compound proposition (pq)r

  41. Use truth table to find - P  Q  P  R P  -Q  R  P  R  - Q A  B  -C  D  E  F

  42. Limitations of propositional logic • So far we studied propositional logic • Some English statements are hard to model in propositional logic: • “If your roommate is wet because of rain, your roommate must not be carrying any umbrella” • Pathetic attempt at modeling this: • RoommateWetBecauseOfRain => (NOT(RoommateCarryingUmbrella0) AND NOT(RoommateCarryingUmbrella1) AND NOT(RoommateCarryingUmbrella2) AND …)

  43. Problems with propositional logic • No notion of objects • No notion of relations among objects • RoommateCarryingUmbrella0 is instructive to us, suggesting • there is an object we call Roommate, • there is an object we call Umbrella0, • there is a relationship Carrying between these two objects • Formally, none of this meaning is there • Might as well have replaced RoommateCarryingUmbrella0 by P

  44. First-Order Logic Syntax

  45. Constants • Constants refer to objects, functions and relationships. Ahmed, Mona, loves, happy, • Simple sentences express relationships among objects. loves(Ahmed, Mona) They are called atoms. • Compound sentences capture relationships among relations. loves(x,y) Þ loves(y,x) loves(x,y) Ù loves(y,x) Þ happy(x) • Relations can be unary as well. tall(Tomy)

  46. Elements of first-order logic • Objects:can give these names such as Umbrella0, Person0, John, Earth, … • Relations:Carrying(., .), IsAnUmbrella(.) • Carrying(Person0, Umbrella0), IsUmbrella(Umbrella0) • Relations with one object = unary relations = properties • Functions: Roommate(.) • Roommate(Person0) • Equality: Roommate(Person0) = Person1

  47. Example with Functions E.g. Mona loves her dog. loves(Mona, dog_of (Mona)) Note: We are allowed to relate sentences only. So, we can say: loves(Mona, dog_of (Mona)) Ù loves(Mona, cat_of (Mona)) But not, loves(Mona, dog_of (Mona) Ù cat_of (Mona)) E.g. How about saying that Ahmed has a big nose? Ahmed is an object and nose_of (Ahmed) is a function that constructs an object from the argument object. Then, we can write: big(nose_of (Ahmed))

  48. First-Order Logic: , • The language that we have described so far, consisting of atoms and the connectives (,,,,,) is typically called predicate logic. • To extend it to first-order logic, we need to add quantifiers. • The purpose of quantifiers is to allow us to say things about sets of objects. • To say that Heba loves everything we write: x. loves (Heba, x) We can think of  as a big conjunction. For example, if there are only three objects Heba, dog, and cat, what the above asserts is: loves (Heba, dog)  loves (Heba, cat)  loves (Heba, Heba) • To say that Hassan loves something we write: x. loves (Hassan, x) We can think of  as a big disjunction. For example, if there are only three objects as above, then what we are asserting is: loves (Hassan, dog)  loves (Hassan, cat)  loves (Hassan, Hassan)

  49. First Order Predicate Logic – • enriched by variables, predicates, functions • quantifiers ,  friends(father(david),father(andrew))  Y friends(Y, petr)  X likes(X,ice_cream)  X  Y  Z parent(X,Y)  parent(X,Z)  siblings(Y,Z)

  50. Reasoning about many objects at once • Variables: x, y, z, … can refer to multiple objects • New operators “for all” and “there exists” • Universal quantifier and existential quantifier • for all x: CompletelyWhite(x) => NOT(PartiallyBlack(x)) • Completely white objects are never partially black • there exists x: PartiallyWhite(x) AND PartiallyBlack(x) • There exists some object in the world that is partially white and partially black

More Related