+ All Categories
Home > Documents > First Order Logic (2)

First Order Logic (2)

Date post: 02-Mar-2016
Category:
Upload: durai-raj-kumar
View: 13 times
Download: 0 times
Share this document with a friend
Description:
hhadvj

of 26

Transcript
  • ITCS 3153Artificial IntelligenceLecture 15First-Order LogicChapter 9

  • Forward ChainingRemember this from propositional logic?Start with atomic sentences in KBApply Modus Ponensadd new sentences to KBdiscontinue when no new sentencesHopefully find the sentence you are looking for in the generated sentences

  • Lifting forward chainingFirst-order definite clausesall sentences are defined this way to simplify processingdisjunction of literals with exactly one positiveclause is either atomic or an implication whose antecedent is a conjunction of positive literals and whose consequent is a single positive literal

  • ExampleThe law says it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missles were sold to it by Colonel West, who is American

    We will prove West is a criminal

  • ExampleIt is a crime for an American to sell weapons to hostile nations

    Nono has some misslesOwns (Nono, M1)Missile (M1)All of its missiles were sold to it by Colonel West

  • ExampleWe also need to know that missiles are weapons

    and we must know that an enemy of America counts as hostile

    West, who is American

    The country Nono, an enemy of America

  • Forward-chainingStarting from the factsfind all rules with satisfied premisesadd their conclusions to known factsrepeat untilquery is answeredno new facts are added

  • First iteration of forward chainingLook at the implication sentences first

    must satisfy unknown premisesWe can satisfy this rule

    by substituting {x/M1} and adding Sells(West, M1, Nono) to KB

  • First iteration of forward chainingWe can satisfy

    with {x/M1}and Weapon (M1) is addedWe can satisfy

    with {x/Nono}and Hostile {Nono} is added

  • Second iteration of forward chainingWe can satisfy

    with {x/West, y/M1, z/Nono}and Criminal (West) is added

  • Analyze this algorithmSound?Does it only derive sentences that are entailed?Yes, because only Modus Ponens is used and it is soundComplete?Does it answer every query whose answers are entailed by the KB?Yes if the clauses are definite clauses

  • Proving completenessAssume KB only has sentences with no function symbolsWhats the most number of iterations through algorithm?Depends on the number of facts that can be addedLet k be the arity, the max number of arguments of any predicate andLet p be the number of predicatesLet n be the number of constant symbolsAt most pnk distinct ground factsFixed point is reached after this many iterationsA proof by contradiction shows that the final KB is complete

  • Complexit of this algorithmThree sources of complexityinner loop requires finding all unifiers such that premise of rule unifies with facts of databasethis pattern matching is expensivemust check every rule on every iteration to check if its premises are satisfiedmany facts are generated that are irrelevant to goal

  • Pattern matchingConjunct orderingMissile (x) ^ Owns (Nono, x) => Sells (West, x, Nono)Look at all items owned by Nono, call them Xfor each element x in X, check if it is a missile

    Look for all missiles, call them Xfor each element x in X, check if it is owned by NonoOptimal ordering is NP-hard, similar to matrix mult

  • Incremental forward chainingPointless (redundant) repetitionSome rules generate new informationthis information may permit unification of existing rulessome rules generate preexisting informationwe need not revisit the unification of the existing rules

    Every new fact inferred on iteration t must be derived from at least one new fact inferred on iteration t-1

  • Irrelevant factsSome facts are irrelevant and occupy computation of forward-chaining algorithmWhat if Nono example included lots of facts about food preferences?Not related to conclusions drawn about sale of weaponsHow can we eliminate them?Backward chaining is one way

  • Magic SetRewriting the rule setSounds dangerousAdd elements to premises that restrict candidates that will matchadded elements are based on desired goalLet goal = Criminal (West)Magic(x) ^ American(x) ^ Weapon(y) ^ Sells(x, y, z) ^ Hostile(z) => Criminal (x)Add Magic (West) to Knowledge Base

  • Backward ChainingStart with the premises of the goalEach premise must be supported by KBStart with first premise and look for support from KBlooking for clauses with a head that matches premisethe heads premise must then be supported by KBA recursive, depth-first, algorithmSuffers from repetition and incompleteness

  • ResolutionWe saw earlier that resolution is a complete algorithm for refuting statementsMust put first-order sentences into conjunctive normal formconjunction of clauses, each is a disjunction of literalsliterals can contain variables (which are assumed to be universally quantified)

  • First-order CNFFor all x, American(x) ^ Weapon(y) ^ Sells(x, y, z) ^ Hostile (z) => Criminal(x)

    ~American(x) V ~Weapon(y) V ~Sells(x, y, z) V ~Hostile(z) V Criminal(x)

    Every sentence of first-order logic can be converted into an inferentially equivalent CNF sentence (they are both unsatisfiable in same conditions)

  • ExampleEveryone who loves all animals is loved by someone

  • Example

  • Example

    F and G are Skolem Functionsarguments of function are universally quantified variables in whose scope the existential quantifier appears

  • Example

    Two clausesF(x) refers to the animal potentially unloved by xG(x) refers to someone who might love x

  • Resolution inference ruleA lifted version of propositional resolution ruletwo clauses must be standardized apartno variables are sharedcan be resolved if their literals are complementaryone is the negation of the otherif one unifies with the negation of the other

  • Resolution


Recommended