##
This **preview** shows page *1-2-3-4-31-32-33-34-35-63-64-65-66*
out of 66 **pages**.

*View Full Document*

End of preview. Want to read all 66 pages?

Upload your study docs or become a GradeBuddy member to access this document.

View Full Document**Unformatted text preview:**

CMSC 671 Fall 2005Propositional and First-Order LogicToday’s classPropositional Logic: ReviewPropositional logicPropositional logic (PL)Some termsMore termsInference rulesSound rules of inferenceSoundness of modus ponensSoundness of the resolution inference ruleProving thingsHorn sentencesEntailment and derivationTwo important properties for inferenceProblems with Propositional LogicPropositional logic is a weak languageExampleExample IIThe “Hunt the Wumpus” agentAfter the third moveProving W13Problems with the propositional Wumpus hunterFirst-Order Logic: ReviewFirst-order logicUser providesFOL ProvidesSentences are built from terms and atomsQuantifiersSlide 38Quantifier ScopeConnections between All and ExistsQuantified inference rulesUniversal instantiation (a.k.a. universal elimination)Existential instantiation (a.k.a. existential elimination)Existential generalization (a.k.a. existential introduction)Translating English to FOLExample: A simple genealogy KB by FOLSlide 55Semantics of FOLSlide 58Axioms, definitions and theoremsMore on definitionsSlide 61Higher-order logicExpressing uniquenessNotational differencesLogical AgentsLogical agents for the Wumpus WorldA simple reflex agentRepresenting changeSituationsSituation calculusDeducing hidden propertiesDeducing hidden properties IIRepresenting change: The frame problemThe frame problem IIQualification problemRamification problemKnowledge engineering!Preferences among actionsSlide 79Slide 80Goal-based agentsComing up next:1CMSC 671CMSC 671Fall 2005Fall 2005Class #10─Tuesday, October 42Propositional and First-Order LogicChapter 7.4─7.8, 8.1─8.3, 8.5Some material adopted from notes by Andreas Geyer-Schulzand Chuck Dyer3Today’s class•Propositional logic (quick review)•Problems with propositional logic•First-order logic (review)–Properties, relations, functions, quantifiers, …–Terms, sentences, wffs, axioms, theories, proofs, …•Extensions to first-order logic•Logical agents–Reflex agents–Representing change: situation calculus, frame problem–Preferences on actions–Goal-based agents4Propositional Logic: Review5Propositional logic•Logical constants: true, false •Propositional symbols: P, Q, S, ... (atomic sentences)•Wrapping parentheses: ( … )•Sentences are combined by connectives: ...and [conjunction] ...or [disjunction] ...implies [implication / conditional] ..is equivalent [biconditional] ...not [negation]•Literal: atomic sentence or negated atomic sentence7Propositional logic (PL)•A simple language useful for showing key ideas and definitions •User defines a set of propositional symbols, like P and Q. •User defines the semantics of each propositional symbol:–P means “It is hot”–Q means “It is humid”–R means “It is raining”•A sentence (well formed formula) is defined as follows: –A symbol is a sentence–If S is a sentence, then S is a sentence–If S is a sentence, then (S) is a sentence–If S and T are sentences, then (S T), (S T), (S T), and (S ↔ T) are sentences–A sentence results from a finite number of applications of the above rules9Some terms•The meaning or semantics of a sentence determines its interpretation. •Given the truth values of all symbols in a sentence, it can be “evaluated” to determine its truth value (True or False). •A model for a KB is a “possible world” (assignment of truth values to propositional symbols) in which each sentence in the KB is True.10More terms•A valid sentence or tautology is a sentence that is True under all interpretations, no matter what the world is actually like or what the semantics is. Example: “It’s raining or it’s not raining.”•An inconsistent sentence or contradiction is a sentence that is False under all interpretations. The world is never like what it describes, as in “It’s raining and it’s not raining.”•P entails Q, written P |= Q, means that whenever P is True, so is Q. In other words, all models of P are also models of Q.14Inference rules•Logical inference is used to create new sentences that logically follow from a given set of predicate calculus sentences (KB).•An inference rule is sound if every sentence X produced by an inference rule operating on a KB logically follows from the KB. (That is, the inference rule does not create any contradictions)•An inference rule is complete if it is able to produce every expression that logically follows from (is entailed by) the KB. (Note the analogy to complete search algorithms.)15Sound rules of inference•Here are some examples of sound rules of inference–A rule is sound if its conclusion is true whenever the premise is true•Each can be shown to be sound using a truth tableRULE PREMISE CONCLUSIONModus Ponens A, A B BAnd Introduction A, B A BAnd Elimination A B ADouble Negation A AUnit Resolution A B, B AResolution A B, B C A C16Soundness of modus ponensA B A → B OK?True True TrueTrue False FalseFalse True TrueFalse False True17Soundness of the resolution inference rule18Proving things•A proof is a sequence of sentences, where each sentence is either a premise or a sentence derived from earlier sentences in the proof by one of the rules of inference. •The last sentence is the theorem (also called goal or query) that we want to prove.•Example for the “weather problem” given above.1 Hu Premise “It is humid”2 HuHo Premise “If it is humid, it is hot”3 Ho Modus Ponens(1,2) “It is hot”4 (HoHu)R Premise “If it’s hot & humid, it’s raining”5 HoHu And Introduction(1,3) “It is hot and humid”6 R Modus Ponens(4,5) “It is raining”19Horn sentences•A Horn sentence or Horn clause has the form:P1 P2 P3 ... Pn Qor alternativelyP1 P2 P3 ... Pn Qwhere Ps and Q are non-negated atoms•To get a proof for Horn sentences, apply Modus Ponens repeatedly until nothing can be done•We will use the Horn clause form later(P Q) = (P Q)20Entailment and derivation•Entailment: KB |= Q–Q is entailed by KB (a set of premises or assumptions) if and only if there is no logically possible world in which Q is false while all the premises in KB are true. –Or, stated positively, Q is entailed by KB if and only if the conclusion is true in every logically possible world in which all the premises in KB are true. •Derivation:

View Full Document