Knowledge Representation. Propositional logic

Similar documents
Knowledge Representation. Propositional logic.

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Propositional logic II.

CS 2710 Foundations of AI Lecture 12. Propositional logic. Logical inference problem

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Inference in Propositional Logic

Inference in first-order logic

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Learning Goals of CS245 Logic and Computation

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Reasoning

Logical Agents. September 14, 2004

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Introduction Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic: Propositional Logic (Part I)

Rules Build Arguments Rules Building Arguments

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Modeling and reasoning with uncertainty

Bayesian belief networks

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Inference in first-order logic

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Inference in first-order logic

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

UNIT-I: Propositional Logic

Logic: Propositional Logic Truth Tables

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Inference Methods In Propositional Logic

Proof Methods for Propositional Logic

CS 7180: Behavioral Modeling and Decision- making in AI

Propositional Logic: Logical Agents (Part I)

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Propositional Logic: Review

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Propositional logic (revision) & semantic entailment. p. 1/34

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Advanced Topics in LP and FP

Knowledge based Agents

Inference Methods In Propositional Logic

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

AI Programming CS S-09 Knowledge Representation

Chapter 4: Classical Propositional Semantics

Math.3336: Discrete Mathematics. Propositional Equivalences

software design & management Gachon University Chulyun Kim

KB Agents and Propositional Logic

Artificial Intelligence Chapter 7: Logical Agents

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Logical Agents. Outline

Propositional Logic: Methods of Proof. Chapter 7, Part II

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Logical Agent & Propositional Logic

Propositional Logic: Models and Proofs

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Propositional Logic (2A) Young W. Lim 11/8/15

Propositional Logic Part 1

Propositional Logic: Logical Agents (Part I)

Propositional Logic: Methods of Proof (Part II)

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Intelligent Agents. Pınar Yolum Utrecht University

Artificial Intelligence. Propositional logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs

Kecerdasan Buatan M. Ali Fauzi

Foundations of Artificial Intelligence

Propositional Logic: Methods of Proof (Part II)

EECS 1028 M: Discrete Mathematics for Engineers

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Language of Propositional Logic

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

Logical Agents. Chapter 7

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Logical Agent & Propositional Logic

Deliberative Agents Knowledge Representation I. Deliberative Agents

Natural Deduction for Propositional Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

PROPOSITIONAL CALCULUS

Discrete Structures for Computer Science

Review: Potential stumbling blocks

Propositional Logic and Semantics

Class Assignment Strategies

Introduction to Artificial Intelligence. Logical Agents

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

The Logic of Compound Statements cont.

Transcription:

CS 2710 Foundations of AI Lecture 10 Knowledge Representation. Propositional logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Knowledge-based agent Knowledge base Inference engine Knowledge base (KB): Knowledge that describe facts about the world in some formal (representational) language Domain specific Inference engine: A set of procedures that use the representational language to infer new facts from known ones or answer a variety of KB queries. Inferences typically require search. Domain independent 1

Example: MYCIN MYCIN: an expert system for diagnosis of bacterial infections Knowledge base represents Facts about a specific patient case Rules describing relations between entities in the bacterial infection domain If Then 1. The stain of the organism is gram-positive, and 2. The morphology of the organism is coccus, and 3. The growth conformation of the organism is chains the identity of the organism is streptococcus Inference engine: manipulates the facts and known relations to answer diagnostic queries (consistent with findings and rules) Knowledge representation Objective: express the knowledge about the world in a computer-tractable form Knowledge representation languages (KRLs) Key aspects: Syntax: describes how sentences in KRL are formed in the language Semantics: describes the meaning of sentences, what is it the sentence refers to in the real world Computational aspect: describes how sentences and objects in KRL are manipulated in concordance with semantic conventions Many KB systems rely on and implement some variant of logic 2

Logic A formal language for expressing knowledge and for making logical inferences Defined by: A set of sentences: A sentence is constructed from a set of primitives according to syntactic rules A set of interpretations: An interpretation I gives a semantic to primitives. It associates primitives with objects or values I: primitives objects/values The valuation (meaning) function V: Assigns a value (typically the truth value) to a given sentence under some interpretation V : sentence interpreta tion {, } The simplest logic Propositional logic Definition: A proposition is a statement that is either true or false. Examples: Pitt is located in the Oakland section of Pittsburgh. (T) 3

The simplest logic Propositional logic Definition: A proposition is a statement that is either true or false. Examples: Pitt is located in the Oakland section of Pittsburgh. (T) 5 + 2 = 8.? The simplest logic Propositional logic Definition: A proposition is a statement that is either true or false. Examples: Pitt is located in the Oakland section of Pittsburgh. (T) 5 + 2 = 8. (F) It is raining today.? 4

The simplest logic Propositional logic Definition: A proposition is a statement that is either true or false. Examples: Pitt is located in the Oakland section of Pittsburgh. (T) 5 + 2 = 8. (F) It is raining today. (either T or F) CS 1571 Intro to AI Examples (cont.): How are you?? Propositional logic 5

Propositional logic Examples (cont.): How are you? a question is not a proposition x + 5 = 3? Propositional logic Examples (cont.): How are you? a question is not a proposition x + 5 = 3 since x is not specified, neither true nor false 2 is a prime number.? 6

Propositional logic Examples (cont.): How are you? a question is not a proposition x + 5 = 3 since x is not specified, neither true nor false 2 is a prime number. (T) Propositional logic. Syntax Formally propositional logic P: Is defined by Syntax+interpretation+semantics of P Syntax: Symbols (alphabet) in P: Constants:, Propositional symbols Examples: P Pitt is located in the Oakland section of Pittsburgh., It rains outside, etc. A set of connectives:,,,, 7

Propositional logic. Syntax Sentences in the propositional logic: Atomic sentences: Constructed from constants and propositional symbols, are (atomic) sentences P,Q or Light in the room is on, It rains outside are (atomic) sentences Composite sentences: Constructed from valid sentences via logical connectives If A, B are sentences then A ( A B) ( A B) ( A B) ( A B) or ( A B) ( A B) are sentences Propositional logic. Semantics. The semantic gives the meaning to sentences. the semantics in the propositional logic is defined by: 1. Interpretation of propositional symbols and constants Semantics of atomic sentences 2. Through the meaning of logical connectives Meaning (semantics) of composite sentences 8

Semantic: propositional symbols A propositional symbol a statement about the world that is either true or false Examples: Pitt is located in the Oakland section of Pittsburgh It rains outside Light in the room is on An interpretation maps symbols to one of the two values: (T), or (F), depending on whether the symbol is satisfied in the world I: Light in the room is on ->, It rains outside -> I : Light in the room is on ->, It rains outside -> Semantic: propositional symbols The meaning (value) of the propositional symbol for a specific interpretation is given by its interpretation I: Light in the room is on ->, It rains outside -> V(Light in the room is on, I) = V( It rains outside, I) = I : Light in the room is on ->, It rains outside -> V(Light in the room is on, I ) = Interpretations Meanings (values) Light in the room is on It rains outside Light in the room is on It rains outside 9

Semantics: constants The meaning (truth) of constants: and constants are always (under any interpretation) assigned the corresponding, value V(, I) = V(, I) = For any interpretation I Semantics: composite sentences. The meaning (truth value) of complex propositional sentences. Determined using the standard rules of logic: P Q P P Q P Q P Q P Q 10

Translation Translation of English sentences to propositional logic: (1) identify atomic sentences that are propositions (2) Use logical connectives to translate more complex composite sentences that consist of many atomic sentences Assume the following sentence: It is not sunny this afternoon and it is colder than yesterday. Atomic sentences: p = It is sunny this afternoon q = it is colder than yesterday Translation: p q Translation Assume the following sentences: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Denote: p = It is sunny this afternoon q = it is colder than yesterday r = We will go swimming s= we will take a canoe trip t= We will be home by sunset 11

Translation Assume the following sentences: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Denote: p = It is sunny this afternoon q = it is colder than yesterday r = We will go swimming s= we will take a canoe trip t= We will be home by sunset p q Translation Assume the following sentences: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Denote: p = It is sunny this afternoon q = it is colder than yesterday r = We will go swimming s= we will take a canoe trip t= We will be home by sunset p q r p 12

Translation Assume the following sentences: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Denote: p = It is sunny this afternoon q = it is colder than yesterday r = We will go swimming s= we will take a canoe trip t= We will be home by sunset p q r p r s Translation Assume the following sentences: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Denote: p = It is sunny this afternoon q = it is colder than yesterday r = We will go swimming s= we will take a canoe trip t= We will be home by sunset p q r p r s s t 13

Contradiction and Tautology Some composite sentences may always (under any interpretation) evaluate to a single truth value: Contradiction (always ) P P Tautology (always ) P P ( P Q) ( P ) ( P Q) ( P ) DeMorgan s Laws Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 1: Primitives: P,Q Sentence: P Q Interpretations: Model? P, Q? ( P Q) (( P Q) ) P 14

Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 1: Primitives: P,Q Sentence: P Q Interpretations: Model? P, Q Yes P, Q? ( P Q) (( P Q) ) P Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 1: Primitives: P,Q Sentence: P Q Interpretations: Model? P, Q Yes P, Q Yes P, Q? ( P Q) (( P Q) ) P 15

Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 1: Primitives: P,Q Sentence: P Q Interpretations: Model? P, Q Yes P, Q Yes P, Q ( P Q) No (( P Q) ) P Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 2: Primitives: P,Q Sentences: P Q ( P Q) Is there a model? (( P Q) ) P ( P Q) (( P Q) ) P 16

Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. Example 2: Primitives: P,Q Sentences: P Q ( P Q) Is there a model? Yes P Q (( P Q) ) P ( P Q) (( P Q) ) P Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. A sentence is satisfiable if it has a model; There is at least one interpretation under which the sentence can evaluate to Example: Sentence: ( P Q) Satisfiable? ( P Q) (( P Q) ) P 17

Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. A sentence is satisfiable if it has a model; There is at least one interpretation under which the sentence can evaluate to Example: Sentence: ( P Q) Satisfiable? Yes for P, Q ( P Q) (( P Q) ) P Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. A sentence is satisfiable if it has a model; There is at least one interpretation under which the sentence can evaluate to. A sentence is valid if it is in all interpretations i.e., if its negation is not satisfiable (leads to contradiction) valid sentence? ( P Q) (( P Q) ) P 18

Model, validity and satisfiability An interpretation is a model for a set of sentences if it assigns true to each sentence in the set. A sentence is satisfiable if it has a model; There is at least one interpretation under which the sentence can evaluate to. A sentence is valid if it is in all interpretations i.e., if its negation is not satisfiable (leads to contradiction) ( P Q) valid sentence? (( P Q) ) P Entailment Entailment reflects the relation of one fact in the world following from the others Entailment KB Knowledge base KB entails sentence if and only if is true in all worlds where KB is true 19

Sound and complete inference Inference is a process by which new sentences are derived from existing sentences in the KB the inference process is implemented on a computer Assume an inference procedure i that derives a sentence from the KB : KB i Properties of the inference procedure in terms of entailment Soundness: An inference procedure is sound If KB i then it is true that KB Completeness: An inference procedure is complete If KB then it is true that KB i Logical inference problem Logical inference problem: Given: a knowledge base KB (a set of sentences) and a sentence (called a theorem), Does a KB semantically entail? KB? In other words: In all interpretations in which sentences in the KB are true, is also true? Question: Is there a procedure (program) that can decide this problem in a finite number of steps? Answer: Yes. Logical inference problem for the propositional logic is decidable. 20

Solving logical inference problem In the following: How to design the procedure that answers: KB? Three approaches: Truth-table approach Inference rules Conversion to the inverse SAT problem Resolution-refutation Truth-table approach Problem: KB? We need to check all possible interpretations for which the KB is true (models of KB) whether is true for each of them Truth table: enumerates truth values of sentences for all possible interpretations (assignments of / values to propositional symbols) Example: KB P Q ( P ) Q 21

Truth-table approach Problem: KB? We need to check all possible interpretations for which the KB is true (models of KB) whether is true for each of them Truth table: enumerates truth values of sentences for all possible interpretations (assignments of / to propositional symbols) Example: KB P Q ( P ) Q Truth-table approach Problem: KB? We need to check all possible interpretations for which the KB is true (models of KB) whether is true for each of them Truth table: enumerates truth values of sentences for all possible interpretations (assignments of / to propositional symbols) Example: KB P Q ( P ) Q 22

Truth-table approach A two steps procedure: 1. Generate table for all possible interpretations 2. Check whether the sentence evaluates to true whenever KB evaluates to true Example: KB ( A C) ( B C) ( A B) A B C A C ( B C) KB Truth-table approach A two steps procedure: 1. Generate table for all possible interpretations 2. Check whether the sentence evaluates to true whenever KB evaluates to true Example: KB ( A C) ( B C) ( A B) A B C A C ( B C) KB 23

Truth-table approach A two steps procedure: 1. Generate table for all possible interpretations 2. Check whether the sentence evaluates to true whenever KB evaluates to true Example: KB ( A C) ( B C) ( A B) A B C A C ( B C) KB Truth-table approach KB ( A C) ( B C) ( A B) A B C A C ( B C) KB KB entails The truth-table approach is sound and complete for the propositional logic!! 24

Limitations of the truth table approach. KB? What is the computational complexity of the truth table approach?? Limitations of the truth table approach. KB? What is the computational complexity of the truth table approach? Exponential in the number of the propositional symbols n 2 Rows in the table has to be filled the truth table is exponential in the number of propositional symbols (we checked all assignments) 25