SWARTHMORE CS 63 - Propositional and First-Order Logic

Unformatted text preview:

Propositional and First-Order LogicPropositional LogicPropositional logicExamples of PL sentencesPropositional logic (PL)Some termsMore termsTruth tablesTruth tables IIModels of complex sentencesInference rulesSound rules of inferenceSoundness of modus ponensSoundness of the resolution inference ruleProving thingsHorn sentencesEntailment and derivationTwo important properties for inferencePropositional logic is a weak languageExampleExample IIThe “Hunt the Wumpus” agentAfter the third moveProving W13Problems with the propositional Wumpus hunterSummaryFirst-Order LogicOutlineFirst-order logicUser providesFOL ProvidesSentences are built from terms and atomsQuantifiersSlide 36Quantifier 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 FOLMonty Python and The Art of FallacyAn example from Monty Python by way of Russell & NorvigMonty Python cont.Slide 47Slide 48Monty Python Fallacy #1Monty Python Near-Fallacy #2Monty Python Fallacy #3Monty Python Fallacy #4Example: A simple genealogy KB by FOLSlide 54Semantics of FOLSlide 57Axioms, definitions and theoremsMore on definitionsSlide 60Higher-order logicExpressing uniquenessNotational differencesLogical 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 77Slide 78Goal-based agentsPropositional and Propositional and First-Order LogicFirst-Order LogicChapter 7.4-7.5, 7.7, 8.1─8.3, 8.5CS 63CS 63Some material adopted from notes and slides by Tim Finin, Marie desJardins, Andreas Geyer-Schulz and Chuck DyerPropositional Propositional LogicLogicPropositional 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 sentenceExamples 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”Propositional 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 rulesSome 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.More terms•A valid sentence or tautology is a sentence that is True under all interpretations, no matter what the world is actually like or how the semantics are defined. 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.Truth tablesTruth tables IIThe five logical connectives:A complex sentence:Models of complex sentencesInference 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.)Sound 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  CSoundness of modus ponensA B A → B OK?True True TrueTrue False FalseFalse True TrueFalse False TrueSoundness of the resolution inference ruleProving 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 Humid Premise “It is humid”2 Humid Hot Premise “If it is humid, it is hot”3 Hot Modus Ponens(1,2) “It is hot”4 (HotHumid)Rain Premise “If it’s hot & humid, it’s raining”5 HotHumid And Introduction(1,2) “It is hot and humid”6 Rain Modus Ponens(4,5) “It is raining”Horn sentences•A Horn sentence or Horn clause has the form:P1  P2  P3 ...  Pn  Qor alternativelyP1   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)Entailment and derivation•Entailment: KB |= Q–Q is entailed by KB (a set of premises or assumptions) if and only if


View Full Document

SWARTHMORE CS 63 - Propositional and First-Order Logic

Download Propositional and First-Order Logic
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Propositional and First-Order Logic and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Propositional and First-Order Logic 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?