DOC PREVIEW
Pitt CS 2710 - Propositional logic

This preview shows page 1-2-17-18-19-35-36 out of 36 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Propositional LogicChapter 7Outline• Review– Knowledge-based agents– Logic in general – Propositional logic in particular – syntax and semantics• Wumpus world• Inference rules and theorem proving– Resolution– forward chaining– backward chaining2Logic in general• Logics are formal languages for representing information such that conclusions can be drawn• Syntax defines the sentences in the language• Semantics define the "meaning" of sentences;– i.e., define truth of a sentence in a world• E.g., the language of arithmetic– x+2 ≥ y is a sentence; x2+y > {} is not a sentence– x+2 ≥ y is true iff the number x+2 is no less than the number y– x+2 ≥ y is true in a world where x = 7, y = 1– x+2 ≥ y is false in a world where x = 0, y = 6Entailment• Entailment means that one thing follows from another:KB ╞ α• Knowledge base KB entails sentence α if and only if α is true in all worlds where KB is true– E.g., the KB containing “the Steelers won” and “the Bengals won” entails “Either the Steelers won or the Bengals won”– E.g., x+y = 4 entails 4 = x+y– Entailment is a relationship between sentences (i.e., syntax) that is based on semantics3TFTFFFFFA ∧∧∧∧CFTFTTTFFFFFFA ∧∧∧∧BTTFTFTFCTTTFFTFFTTTFFTFFFFFFFB ∧∧∧∧ CBAA,B, EntailsA∧∧∧∧BA^C, Cdoes not entailB∧∧∧∧CInference• KB ├i α = sentence α can be derived from KB by procedure i• Soundness: i is sound if whenever KB ├i α, it is also true that KB╞ α• Completeness: i is complete if whenever KB╞ α, it is also true that KB ├i α• Preview: we will define a logic (first-order logic) which is expressive enough to say almost anything of interest, and for which there exists a sound and complete inference procedure.• That is, the procedure will answer any question whose answer follows from what is known by the KB.4Propositional logic: Syntax• Propositional logic is the simplest logic – illustrates basic ideas• The proposition symbols P1, P2etc are sentences– If S is a sentence, ¬S is a sentence (negation)– If S1and S2are sentences, S1∧ S2is a sentence (conjunction)– If S1and S2are sentences, S1∨ S2is a sentence (disjunction)– If S1and S2are sentences, S1⇒ S2is a sentence (implication)– If S1and S2are sentences, S1⇔ S2is a sentence (biconditional)Propositional Logic: Semantics (truth tables for connectives)5Wumpus World PEAS description• Performance measure– gold +1000, death -1000– -1 per step, -10 for using the arrow• Environment– Squares adjacent to wumpus are smelly– Squares adjacent to pit are breezy– Glitter iff gold is in the same square– Shooting kills wumpus if you are facing it– Shooting uses up the only arrow– Grabbing picks up gold if in same square– Releasing drops the gold in same square• Sensors: Stench, Breeze, Glitter, Bump, Scream• Actuators: Left turn, Right turn, Forward, Grab, Release, ShootWumpus world characterization• Fully Observable• Deterministic• Episodic• Static• Discrete• Single-agent?6Wumpus world characterization• Fully Observable No – only local perception• Deterministic Yes – outcomes exactly specified• Episodic No – sequential at the level of actions• Static Yes – Wumpus and Pits do not move• Discrete Yes• Single-agent? Yes – Wumpus is essentially a natural featureWumpus World continued• Main difficulty: Agent doesn’t know the configuration• Reason about configuration• Knowledge evolves as new percepts arrive and actions are taken.7Wumpus Examplebreeze[Pit]breeze[start]stench,breezeGlitter[gold]stench[Wumpus]stench00Examples of reasoning• If the player is in square (1, 0) and the percept is breeze, then there must be a pit in (0,0) or a pit in (2,0) or a pit in (1,1).• If the player is now in (0,0) [and still alive], there is not a pit in (0,0).• If there is no breeze percept in (0,0), there is no pit in (0,1)• If there is also no breeze in (0,1) then there is no pit in (1,1).• Therefore, there must be a pit in (2,0)8Exploring a wumpus worldExploring a wumpus world9Exploring a wumpus worldExploring a wumpus world10Exploring a wumpus worldExploring a wumpus world11Exploring a wumpus worldExploring a wumpus world12Entailment in the wumpus worldSituation after detecting nothing in [1,1], moving right, breeze in [2,1]Consider possible models for KB assuming only pits3 Boolean choices ⇒ 8 possible modelsWumpus models13Wumpus models• KB = wumpus-world rules + observationsWumpus models• KB = wumpus-world rules + observations• α1= "[1,2] is safe", KB ╞ α1, proved by model checking14Wumpus models• KB = wumpus-world rules + observationsWumpus models• KB = wumpus-world rules + observations• α2= "[2,2] is safe", KB ╞ α215Logical Representation of WumpusIs there a pit in [i, j]?Is there a breeze in [i, j]?Pits cause breezes in adjacent squares.Some Wumpus world sentencesLet Pi,jbe true if there is a pit in [i, j].Let Bi,jbe true if there is a breeze in [i, j].¬ P1,1¬B1,1B2,1…• "Pits cause breezes in adjacent squares"B1,1 ⇔ (P1,2∨ P2,1)B2,1 ⇔ (P1,1∨ P2,2 ∨ P3,1)…16Inference-based agents in the wumpus worldA wumpus-world agent using propositional logic:¬P1,1¬W1,1Bx,y⇔ (Px,y+1∨ Px,y-1∨ Px+1,y∨ Px-1,y) Sx,y⇔ (Wx,y+1∨ Wx,y-1∨ Wx+1,y∨ Wx-1,y)W1,1∨ W1,2∨ … ∨ W4,4¬W1,1∨ ¬W1,2¬W1,1∨ ¬W1,3…⇒ 64 distinct proposition symbols, 155 sentencesTruth tables for inference17Inference by enumeration• Depth-first enumeration of all models is sound and complete • For n symbols, time complexity is O(2n), space complexity is O(n)Logical equivalence• Two sentences are logically equivalent iff true in same models: α ≡ ß iff α╞ β and β╞ α18Example Proof by Deduction• KnowledgeS1: B22 ⇔⇔⇔⇔ ( P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ) ruleS2: ¬B22observation• InferencesS3: (B22 ⇒⇒⇒⇒ (P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ))∧∧∧∧((P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ) ⇒⇒⇒⇒ B22) S1,bi elimS4:S5:S6:S7:Example Proof by Deduction• KnowledgeS1: B22 ⇔⇔⇔⇔ ( P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ) ruleS2: ¬B22observation• InferencesS3: (B22 ⇒⇒⇒⇒ (P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ))∧∧∧∧((P21 ∨∨∨∨ P23 ∨∨∨∨ P12 ∨∨∨∨ P32 ) ⇒⇒⇒⇒ B22) S1,bi


View Full Document

Pitt CS 2710 - Propositional logic

Documents in this Course
Learning

Learning

24 pages

Planning

Planning

25 pages

Lecture

Lecture

12 pages

Load more
Download Propositional 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 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 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?