1 / 51

# Propositional Logic - PowerPoint PPT Presentation

Propositional Logic. Reading: C. 7.4-7.8, C. 8. Logic: Outline. Propositional Logic Inference in Propositional Logic First-order logic. Agents that reason logically. A logic is a: Formal language in which knowledge can be expressed A means of carrying out reasoning in the language

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Propositional Logic

• Propositional Logic

• Inference in Propositional Logic

• First-order logic

• A logic is a:

• Formal language in which knowledge can be expressed

• A means of carrying out reasoning in the language

• A Knowledge base agent

• Tell: add facts to the KB

• Problem-specific AI (e.g., Roomba)

• Specific data structure

• Need special implementation

• Can be fast

• General –purpose AI (e.g., logic-based)

• Flexible and expressive

• Generic implementation possible

• Can be slow

• Programming languages

• Formal, not ambiguous

• Lacks expressivity (e.g., partial information)

• Natural Language

• Very expressive, but ambiguous:

• Flying planes can be dangerous.

• The teacher gave the boys an apple.

• Inference possible, but hard to automate

• Good representation language

• Both formal and can express partial information

• Can accommodate inference

• Syntax: symbols and rules for combining themWhat you can say

• Semantics: Specification of the way symbols (and sentences) relate to the worldWhat it means

• Inference Procedures: Rules for deriving new sentences (and therefore, new semantics) from existing sentencesReasoning

• A possible world (also called a model) is an assignment of truth values to each propositional symbol

• The semantics of a logic defines the truth of each sentence with respect to each possible world

• A model of a sentence is an interpretation in which the sentence evaluates to True

• E.g., TodayIsTuesday -> ClassAI is true in model {TodayIsTuesday=True, ClassAI=True}

• We say {TodayIsTuesday=True, ClassAI=True} is a model of the sentence

What is the meaning of these two sentences?

• If Shakespeare ate Crunchy-Wunchies for breakfast, then Sally will go to Harvard

• If Shakespeare ate Cocoa-Puffs for breakfast, then Sally will go to Columbia

• What are the models of the following sentences?

• KB1: TodayIsTuesday -> ClassAI

• KB2: TodayIsTuesday -> ClassAI, TodayIsTuesday

• A complete inference procedure

• A single inference rule, resolution

• A conjunctive normal form for the logic

• Agent in [1,1] has no breeze

• KB = R2Λ R4 = (B1,1<->(P1,2 V P2,1)) Λ⌐B1,1

• Goal: show ⌐P1,2

• Inference method A is sound (or truth-preserving) if it only derives entailed sentences

• Inference method A is complete if it can derive any sentence that is entailed

• A proof is a record of the progress of a sound inference algorithm.

• Model Checking

• Forward chaining with modus ponens

• Backward chaining with modus ponens

• Enumerate all possible worlds

• Restrict to possible worlds in which the KB is true

• Check whether the goal is true in those worlds or not

• Percepts: {nothing in 1,1; breeze in 2,1}

• Assume agent has moved to [2,1]

• Goal: where are the pits?

• Construct the models of KB based on rules of world

• Use entailment to determine knowledge about pits

• Sound because it directly implements entailment

• Complete because it works for any KB and sentence to prove αand always terminates

• Problem: there can be way too many worlds to check

• O(2n) when KB and α have n variables in total

• State: current set of sentences

• Operator: sound inference rules to derive new entailed sentences from a set of sentences

• Can be goal directed if there is a particular goal sentence we have in mind

• Can also try to enumerateevery entailed sentence

• N propositions; M rules

• Every possible fact can be establisehd with at most N linear passes over the database

• Complexity O(NM)

• Forward chaining with Modus Ponens is complete for Horn logic