1 / 52

Logic of Propositions and Predicates

Logic of Propositions and Predicates. AI knowledge representation. Knowledge consists of models that attempt to represent the environment in such a way as to maximally simplify problem-solving. should support inference . i nference - any way to get new expressions from old.

bhatfield
Download Presentation

Logic of Propositions and Predicates

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. Logic of Propositions and Predicates

  2. AI knowledge representation Knowledge consists of models that attempt to represent the environment in such a way as to maximally simplify problem-solving. should support inference. inference- any way to get new expressions from old.

  3. Main questions How we can represent knowledge as symbol structures ? How we can use that knowledge to intelligently solve problems ?

  4. Requirements • Representational Adequacy:should allow to represent the knowledge we need • Inferential Adequacy:ability to infer new knowledge from a basic set of facts • Clear Syntax and Semantics: what the allowable expressions are and what they mean • Naturalness:natural and easy to use

  5. KNOWLEDGE REPRESENTATION • Symbolic representation • Rule Base representation • Structured representation • Networked representation

  6. Symbolic Logic Logic is the formal method of reasoning • Propositional logic • Predicate logic FOPL

  7. Propositional Logic • Symbolization is done by using declarative statements • Proposition is a Declarative statement which is either true or false but not both Eg : • The symbols P,Q… are used to denote propositions are called ‘atomic formulae’ or atoms • Compound Propositions built by logical connectives

  8. Logical Connectives And, Or, Not, If … then (implication) If and only if (double implication)

  9. Syntax A well-formed formula (wff) in propositional logic is: • An atom is a wff • If P is a wff, then ~P is a wff. • If P and Q are wffs then PQ, PQ, PQ, PQ are wffs. • The set of all wffs can be generated by repeatedly applying rules above.

  10. Semantics

  11. Equivalence rules

  12. Interpretation – For a sentence interpretation is an assignment of a truth value to each propositional symbol. Eg: P & ^Q I1 – P=t, Q=t …….. ……. Eg: X: ((A & B) → (C ↔ (~ D)))

  13. Properties of wff Valid / tautulogy – A formula is said to be valid if and only if it is true under all its interpretation Satisfiable – A statement is satisfiable if there are some interpretations for which it is true. Contradiction – if there is no interpretation for which it is true. Equivalent formulas – two sentences are equivalent if they have same truth value under every interpretation

  14. Inference Rules • Provide the means to perform logical proofs. • Set of Premises -> conclusion

  15. Inference rules • Modus Ponens • Chain rule • AND introduction • Transposition

  16. FOPL • PL does not permit to make generalized statements about classes of similar objects. • This is a serious limitation when reasoning about real world • Eg : All students are intelligent Sham is a student In PL it is not possible to conclude sham is intelligent. Since the 2nd statement is not a part of first one

  17. FOPL • FOPL was developed to extend the expressiveness of PL • It is generalization of PL

  18. Syntax • Connectives : and, or, not, implication, double implication • Quantifiers : Universal and existential • Constants : A constant is a term with a fixed value • Variables : A variable is a term which may take different values in given domain. • Functions : relations defined on a domain D. It maps n elts to a elt of the domain • Predicates : denotes relation mapping from the elts of a domain to the values true or false.

  19. Evaluate: E : x(((A(a, x) V B(f(x))) & C(x)) -> D(x)) A,B,C,D are predicates, ‘a’ constant, ‘x’ variable Domain {1,2} a = 2 f(1) = 2 f(2) = 1 A(2,1) – t A(2,2) – f B(1) – t B(2) – f C(1) – t C(2) – f D(1) – f D(2) - t

  20. Example - WFF • Convert following sentences into symbolic form E1 – All employees earning 50000 or more pay taxes. E2 – Some employees are sick today. E3 – No employee earn more than the president

  21. E(x) for x is an employee • P(x) for x is a president • i(x) for the income of x • GE(u,v) for u is > or = v • S(x) for x is sick today • T(x) for x pays tax.

  22. Example - WFF E1 – x ((E(x) & GE (i(x),2L)) -> T(x)) E2 – (E(y) -> S(y)) E3 – xy((E(x) & P(y)) -> ~GE(i(x), i(y)))

  23. Well-Formed Formula A well formed formula (wff) in first order predicate logic is defined as: • A atom is an wff • If P(x) is a wff then ~P(x) is an wff. • If P(x) and Q (x) are wffs then P(x)Q(x), • P(x) Q(x), PQ and PQ are wffs. • If P(x) is an wff then x P(x), x P(x) are wffs. • The set of all wffs can be generated by repeatedly applying rules (1)..(4).

  24. Semantics of PL The interpretation of a formula F in FOPL consists of fixing a domain of values (non empty) D and of an association of values for every constant, function and predicate in the formula F as follows: • Every constant has an associated value in D. • Every function f, of arity n, is defined by the correspondence where • Every predicate of arity n, is defined by the correspondence

  25. Logical Consequence WFF Q is LC of WFFs P1, P2….Pn iff whenever P1 & P2 &….Pn is true under an interpretation Q is also true

  26. Logical Consequence -Ex From the two WFFs CLEVER(sham) and x CLEVER(x)  SUCCEED(x) Show that SUCCEED(sham) is a LC of these

  27. Bound & Free Variables Bound – within the scope of quantifier Free- occurrence of the variable is not bound If var is bound then expression can be evaluated. WFF should contain bound variable.

  28. Normal Forms A formula C is said to be in a Conjunctive Normal Form (CNF) if and only if E has the form: C: C1 & ….& Cn, n ≥ 1, where each of C1,…., Cn is a disjunction of literals. Eg: G: (~ A V B) & (A V ~ B V ~ C) A formula D is said to be in Disjunctive Normal Form (DNF) if and only if E has the form D: D1 V D2 V….Dn , where each Di is a conjunction of li Eg: F: ( ~ A & B ) V (A & ~ B & ~ C)

  29. Conversion of FOPL into Normal Form Step 1: Remove the connectives ‘↔’ and ‘→’ using the equivalences P ↔ G = (P → G) & (G → P) , P→ G = ~ P V G Step 2: Use the equivalence to remove ~s ~ ( ~ P) = P Step 3: Apply De Morgan’s laws in order to bring the negation signs immediately before atoms ~ (P V G) = ~ P & ~ G ~ ((x) P(x)) = ( x) (~P(x)) ~ (( x) P(x)) = ( x) (~F(x))

  30. Conversion of FOPL into Normal Form Step 6: Drop all  and put expression in CNF Step 7:Write each clause separate line. Step 4: Rename bound variables if necessary Step 5: Bring quantifiers to the left before any predicate symbol appears in the formula. Skolomization Every existentially quantified variable can be replaced by a unique Skolem function whose arguments are all the universally quantified variables on which the existential depends

  31. A Predicate Logic Example • Marcus was a man. • Marcus was a Pompeian. • All Pompeians were Romans. • Caesar was a ruler. • All Romans were either loyal to Caesar or hated him. • Everyone is loyal to someone. • People only try to assassinate rulers they aren't loyal to. • Marcus tried to assassinate Caesar. • All men are people.

  32. Marcus was a man. man(Marcus) • Marcus was a Pompeian. Pompeian(Marcus) • All Pompeians were Romans. x: Pompeian(x)Roman(x) • Caesar was a ruler. ruler(Caesar) • All Romans were either loyal to Caesar or hated him. x: Roman(x)  loyalto(x, Caesar)V hate(x,Caesar) • Everyone is loyal to someone. x:y:loyalto(x,y) • People only try to assassinate rulers they aren't loyal to. x:y:person(x) ruler(y)tryassassinate(x,y) loyalto(x,y) • Marcus tried to assassinate Caesar. tryassassinate(Marcus, Caesar) • All men are people. x: man(x)  person(x)

  33. Conversion to Clause Form • Example: x: [Roman(x) know(x, Marcus)] [hate(x,Caesar) V (y: z: hate(y,z) thinkcrazy(x,y))] • Eliminate  x: [Roman(x) know(x, Marcus)] V [hate(x,Caesar) V (y: z: hate(y,z) Vthinkcrazy(x,y))] • Reduce scope of . x: [ Roman(x) V know(x, Marcus)] V [hate(x,Caesar) V (y: z: hate(y,z) Vthinkcrazy(x,y))] • “Standardize” variables: x: P(x) V x: Q(x) converts to x: P(x) V y: Q(y) • Move quantifiers. x: y: z: [Roman(x) Vknow(x, Marcus)] V [hate(x,Caesar) V (hate(y,z) Vthinkcrazy(x,y))]

  34. Eliminate existential quantifiers. y: President(y) will be converted to President(S1) x: y: father-of(y,x) will be converted to x: father-of(S2(x),x)) • Drop the prefix. [ Roman(x) know(x,Marcus)] V [hate(x, Caesar) V (hate(y,z) V thinkcrazy(x,y))] • Convert to a conjunction of disjuncts. Roman(x) V know(x,Marcus) V hate(x,Caesar) V hate(y,z) V thinkcrazy(x,y)

  35. Inference Techniques

  36. Resolution Principle • Syntactic Inference procedure • Proof by contradiction C1, C2 …. Cn are set of clauses (axioms) to show D is a logical consequence C1, C12 …. Cn,: Negate D (~D) Add ~D to the set C1, C2 …. Cn, Find resolvents which yields [ ] empty clause.

  37. Resolution Principle • Given any two clauses A and B, if there is a literal P1 in A which has a complementary literal P2 in B, delete P1 & P2 from A and B and construct a disjunction of the remaining clauses. The clause so constructed is called Resolvent of A and B.” Eg: A: P V Q V R B: ~P V Q V R C: Q V R

  38. A Resolution Proof • Axioms in clause form: 1. man(Marcus) 2. Pompeian(Marcus) 3.  Pompeian(x1) v Roman(x1) 4. Ruler(Caesar) 5.  Roman(x2)v loyalto(x2, Caesar)v hate(x2, Caesar) 6. loyalto(x3, f1(x3)) 7.  man(x4) v  ruler(y1) v  tryassassinate(x4, y1) v loyalto (x4, y1) 8. tryassassinate(Marcus, Caesar)

  39. Prove: hate(Marcus, Caesar) hate(Marcus, Caesar) 5 Marcus/x2 3 Roman(Marcus) V loyalto(Marcus,Caesar) Marcus/x1 Pompeian(Marcus) V loyalto(Marcus,Caesar) 2 7 loyalto(Marcus,Caesar) Marcus/x4, Caesar/y1 1 man(Marcus) V ruler(Caesar) V  tryassassinate(Marcus, Caesar)  ruler(Caesar) V  tryassassinate(Marcus, Caesar) 4  tryassassinate(Marcus, Caesar) 8

  40. Monkey and bananas problem This is a famous AI problem uses resolution principle for inference. This problem specifies that a room containing a monkey, a chair and some bananas that have been hung from the centre of the ceiling, out of reach from monkey. If the monkey is clever enough, it can reach the banana by placing the chair directly below and climbing on top of the chair. Use FOPL to represent this and using resolution prove monkey can reach banana.

  41. Unification • Substitution makes two or more expression equal is called a unifier. • Unifiers: Variable Substitutions P(x) P(y) {y/x} Q(x,x) Q(y,z) {y/x, z/x} P(f(x),z) P(y,Fido) {y/f(x), z/Fido}

More Related