artificial intelligence lecture 1 2 representational
play

Artificial Intelligence Lecture 1-2: Representational Methods - PDF document

Artificial Intelligence Lecture 1-2: Representational Methods Propositional Logic and Predicate Logic CS 231: LUMS Lahore Dr. M M Awais Lecture 1-2 Propositional Logic Symbols P,Q,R,S .. Truth Symbols True (T), False (F)


  1. Artificial Intelligence Lecture 1-2: Representational Methods •Propositional Logic and Predicate Logic CS 231: LUMS Lahore Dr. M M Awais Lecture 1-2 Propositional Logic • Symbols P,Q,R,S …….. • Truth Symbols True (T), False (F) • Connectives � (and), � (or), � (Implication), � � (Equality, equivalence) � (not) Statements (Propositions) could be true/false FACTS are also called Atomic Proposition 2 1

  2. Lecture 1-2 Are same Truth Table � P � Q � P � Q P � Q P Q T T F F T T T F F T F F F T T F T T F F T T T T 3 Lecture 1-2 Possible Sentences • P � Q Conjuncts • P � Q Disjuncts • P � Q P=Premise/Antecedent Q=conclusion/Consequent • � P • (P � Q) = ( � P � Q) Inter conversion 4 2

  3. Lecture 1-2 Laws of Propositional Expressions • Demorgan’s Law � (P V Q)=( � P � � Q) • Distributive Law P V(Q � R)= (P � Q) � (P � R) • Commutative Law P � Q= Q � P • Associative Law (P � Q) � R=P � (Q � R) • Contrapositive Law P � Q= � P � � Q 5 Lecture 1-2 Inferencing • If simple facts are known to be true one can find the truth value for the expressions • Thus INTERPRETATIONS can be done. • Interpretation is the assignment of truth values to the sentences Symbols T/F Mapping 6 3

  4. Lecture 1-2 Expressions for KR • Fact 1: Ali likes cakes P • Fact 2: Ali eats cakes Q • P � Q : Ali Likes cakes or eats cakes • P � Q : Ali likes cakes and eats ckes • � Q : Ali does not eat cakes • P � Q: If Ali likes cakes then he eats cakes • P � Q:????? – Above and vice versa 7 Lecture 1-2 Formal Logic Formal Logic • The most widely used formal logic method is FIRST-ORDER PREDICATE LOGIC Components : Alphabets Formal language Axioms Inference Rules 8 4

  5. Lecture 1-2 Alphabets- -I I Alphabets Predicates, variables, functions,constants, connectives, quantifiers, and delimiters Constants: (first letter small) bLUE a color sanTRO a car crow a bird Variables: (first letter capital) Dog: an element that is a dog, but unspecified Color: an unspecified color 9 Lecture 1-2 Alphabets- -II II Alphabets Function: father(ali) A function that specifies the unique element, that is the father of Ali killer(X) x is a killer Have arity ‘n=1’ (number of arguments to the function) Predicate man(shahid) A predicate which gets TRUTH value equal to 1 (or represented by T) when the interpretation is true. Here Shahid is a man so the predicate is true . bigger(ali , father(babar)) Ali is bigger than the father of Babar. 10 5

  6. Lecture 1-2 Alphabets- -III III Alphabets Connectives: ^ and v or ~ not Implication (when applied to representing logic consider implication sentences as IF-THEN rules) Quantification All persons can see There is a person who cannot see Universal quantifiers Existential quantifiers 11 Lecture 1-2 Examples Examples My house is a blue, two -story, with red shutters, and is a corner house blue(my-house)^two-story(my-house)^red-shutters(my- house)^corner(my-house) Ali bought a scooter or a car bought(ali , car) v bought(ali , scooter) IF fuel, air and spark are present the fuel will combust present(spark)^present(fuel)^present(air) combustion(fuel) 12 6

  7. Lecture 1-2 Examples Examples All people need air ∀ X[person(X) need_AIR(X)] The owner of the car also owns the boat [owner(X , car) ^ car(X , boat)] Formulate the following expression in the PC: “Ali is a computer science student but not a pilot or a football player” cs_STUDENT(ali) ∧ ( ¬ pilot(ali) ∨ ¬ ft_PLAYER(ali) ) 13 Lecture 1-2 Examples Examples Restate the sentence in the following way: 1. Ali is a computer science (CS) student 2. Ali is not a pilot 3. Ali is not a football player cs_student(ali)^ ~pilot(ali)^ ~football_player(ali) 14 7

  8. Lecture 1-2 Examples Examples Studying fuzzy systems is exciting and applying logic is great fun if you are not going to spend all of your time slaving over the terminal ∀ X(~slave_terminal(X) [fs_eciting(X)^logic_fun(X)]) Every voter either favors the amendment or despises it ∀ X[voter(X) [favor(X , amendment) v despise(X,amendment)] ^ ~[favor(X , amendment) v despise(X , amendment)] (this part simply endorses the statement, may not be required) 15 Lecture 1-2 Undecidable Predicate • For which exhaustive testing is required • Example: • ∀ X likes(zahra, X) • This sentence is computationally impossible to calculate 16 8

  9. Lecture 1-2 Example: Robotic Arm • Represent the initial details of the systems • Generate sentences of descriptive nature and or implicative nature • Modify the facts using new sentences on(b,a) On( c,d) ontable(b) A C ontable(d) clear(a) B D clear(c) hand_empty 17 Lecture 1-2 Definitions • Logically Follows : X logically follows from a set of predicate calculus expressions S if every interpretation that satisfy S also satisfy X (X F S) • Satisfy: If S has value T under interpretation I then I satisfy S (interpretation that makes the sentence true) • Model: If I satisfies S for all variables then I is a model of S • Satisfiable: S is satisfiable iff there exists an interpretation and variable assignments that satisfy it 18 9

  10. Lecture 1-2 S F X S: All birds fly S: Sparrow is bird X: Sparrow flies All humans are mortal Shahid is a human Shahis is mortal All birds fly Sparrow is bird Sparrow flies 19 Lecture 1-2 Definitions • Inconsistent: If a set of expressions are not satisfiable • Valid:If any expression has a value T for all possible interpertations • Sound: If an expression logically follows from another expression then the inferential rule is sound • Complete: When inferential rule produces every expression that logically follows a particular expression 20 10

  11. Lecture 1-2 Operations • Unification: Algorithm for determining the subitutions needed to make two predicate calculus expressions match • Skolemization: A method of removing or replacing existential quantifiers • Composition: If S and S` are two substitutions sets, then the composition of S and S` (SS`) is obtained by applying the elements of S to the elements of S` and finally adding the results 21 11

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend