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

Similar documents
COMP219: Artificial Intelligence. Lecture 19: Logic for KR

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logical Agents. Outline

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Intelligent Agents. Pınar Yolum Utrecht University

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logic: Propositional Logic (Part I)

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

Logical Agents. Chapter 7

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

First Order Logic: Syntax and Semantics

Propositional Logic: Logical Agents (Part I)

Artificial Intelligence. Propositional logic

Advanced Topics in LP and FP

Artificial Intelligence Knowledge Representation I

Logic. proof and truth syntacs and semantics. Peter Antal

Logical Agents. Chapter 7

CS 771 Artificial Intelligence. Propositional Logic

Knowledge based Agents

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

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

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

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Logical agents. Chapter 7. Chapter 7 1

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

Artificial Intelligence Chapter 7: Logical Agents

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

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

Logical agents. Chapter 7. Chapter 7 1

Logical Agent & Propositional Logic

Propositional Logic: Logical Agents (Part I)

Propositional Logic: Part II - Syntax & Proofs 0-0

TDT4136 Logic and Reasoning Systems

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

Artificial Intelligence

Logical Agent & Propositional Logic

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

Propositional Logic: Review

Deliberative Agents Knowledge Representation I. Deliberative Agents

Reasoning. Inference. Knowledge Representation 4/6/2018. User

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

Logical Agents (I) Instructor: Tsung-Che Chiang

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Logic & Logic Agents Chapter 7 (& background)

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Kecerdasan Buatan M. Ali Fauzi

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

cis32-ai lecture # 18 mon-3-apr-2006

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

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

Introduction to Artificial Intelligence. Logical Agents

Learning Goals of CS245 Logic and Computation

Class Assignment Strategies

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

CS 188: Artificial Intelligence Spring 2007

Natural Deduction for Propositional Logic

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

Foundations of Artificial Intelligence

22c:145 Artificial Intelligence

02 Propositional Logic

Inference in Propositional Logic

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

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

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

CSC Discrete Math I, Spring Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

Logical Agents: Propositional Logic. Chapter 7

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Logic and Proofs. (A brief summary)

Agents that reason logically

Logic for Computer Science - Week 4 Natural Deduction

PROPOSITIONAL CALCULUS

Propositional Logic: Methods of Proof (Part II)

Logical Agents. September 14, 2004

Logic and Inferences

Inference Methods In Propositional Logic

Artificial Intelligence

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

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Logic Overview, I. and T T T T F F F T F F F F

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

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

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

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

Logic & Logic Agents Chapter 7 (& Some background)

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

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

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

Propositional Logic. Spring Propositional Logic Spring / 32

First Order Logic: Syntax and Semantics

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

CS 380: ARTIFICIAL INTELLIGENCE

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

Inference Methods In Propositional Logic

Transcription:

COMP219: Artificial Intelligence Lecture 19: Logic for KR Last time Expert Systems and Ontologies oday Logic as a knowledge representation scheme Propositional Logic Syntax Semantics Proof theory Natural deduction Overview Learning outcomes covered today: Distinguish the characteristics, and advantages and disadvantages, of the major knowledge representation paradigms that have been used in AI, such as production rules, semantic networks, propositional logic and first-order logic; Solve simple knowledge-based problems using the AI representations studied; 1 2 Introduction We have considered a number of forms of knowledge representation Despite some of their advantages, all suffer from the lack of a well-defined semantics Logic is a method of KR which does have a well-defined semantics Rules and structured objects were meant to correspond to the way people store knowledge hinking humanly Logic provides the paradigm for thinking rationally Current AI is more concerned with describing rationality than pragmatic replication of human behaviour Knowledge-Based Agents Knowledge base = set of sentences in a formal language Declarative approach to building an agent ell it what it needs to know hen it can Ask itself what to do - answers should follow from the KB Agents can be viewed at the knowledge level i.e. what they know, regardless of how implemented Or at the implementation level i.e. data structures in KB and algorithms that manipulate them 3 4

Knowledge-Based Agents he agent must be able to represent states, actions, etc. incorporate new percepts update internal representations of the world deduce hidden properties of the world deduce appropriate actions Logic in General Logics: formal languages for representing information such that conclusions can be drawn Common logics: propositional or first-order predicate logic However there are many other logics, e.g. modal logics, temporal logics, description logics, A logic usually has a well-defined syntax, semantics and proof theory he syntax of a logic defines the syntactically acceptable objects of the logic, or well-formed formulae he semantics of a logic associate each formula with a meaning he proof theory is concerned with manipulating formulae according to certain rules 5 6 Propositional Logic he syntax of propositional logic is constructed from propositions and connectives. A proposition is a statement that is either true or false but not both. Propositions may be combined with other propositions to form compound propositions. hese in turn may be combined into further propositions. he connectives that may be used are true false and conjunction (& or.) or disjunction ( or +) not negation ( ) if... then implication ( ) if and only if equivalence ( ) Some books use different notations, as indicated by the alternative symbols given in parentheses. Well-ormed ormulae he set of sentences or well-formed propositional formulae (W) is defined as: Any propositional symbol is in W. he nullary connectives, true and false are in W. If A and B are in W then so is A, A B, A B,A B and A B. If A is in W then so is(a). So, e.g. ((A B) (P B)) Q 7 8

Propositional Logic Semantics ruth ables Propositions can be true or false. ormally: Let I : PROP {, } be an interpretation which assigns a truth value to each atomic proposition. E.g. P Q R true true false Rules for evaluating truth with respect to an interpretation I are determined by truth tables. If a compound proposition is true for ALL values of the propositions it contains, it is a tautology, and is logically true. If a compound proposition is false for ALL values of the propositions it contains, it is a contradiction, and is logically false. We can summarise the operation of the connectives using truth tables. Rows in the table give all possible setting of the propositions to true () or false () p q p p q p q p q p q 9 10 Exercise Exercise Construct the truth table for the following formula and state whether the formula is a tautology, a contradiction or neither (a contingency): (p q) V (q p) p q (p q) (q p) (p q) (q p) 11 12

Back to Knowledge Representation We are interested in a computer-suitable language to represent explicit knowledge reason Inference engine Knowledge base Domain-independent algorithms Domain-specific content Knowledge base = set of sentences in a formal language Clear syntax and semantics Adequate (in many aspects) Natural Entailment 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 Giants won and the Rangers won entails Either the Giants won or the Rangers won E.g., x + y = 4 entails 4 = x + y Entailment is a relationship between sentences (i.e., syntax) that is based on semantics. 13 14 Propositional Logic Example (I) Propositional Logic Example (II) alarm_beeps hot (hot smoky fire) switch_on_sprinklers (hot smoky fire) alarm_beeps hot switch_on_sprinklers 15 16

Propositional Logic Example (III) Propositional Logic Example (IV) (hot smoky fire) (hot smoky fire) switch_on_sprinklers fire switch_on_sprinklers hot smoky 17 18 Propositional Logic for KR Describe what we know about a particular domain by a propositional formula, KB ormulate a hypothesis, α We want to know whether KB implies α Entailment est How do we know that KB α? Models Inference Given a knowledge base KB and a property α, check if KB α Use truth tables Prove α from KB Relate with validity and satisfiability Davis-Putnam algorithm 19 20

Models Logicians typically think in terms of models, which are formally structured worlds with respect to which truth can be evaluated. We say m is a model of a sentence α if α is true in m Each line on a truth table that evaluates to true is a model for the formula. M(α) is the set of all models of α hen KB α if and only if M(KB) M(α) e.g. KB = Giants won and Rangers won α = Giants won Example (hot smoky fire) switch_on_sprinklers fire Abbreviations: Hot, Smoky, ire, Alarm_beeps, switch_on_sprinklers? ((H S ) (A S) ( W))? ( W ) 21 22 ruth able Inference gives a truth table for all possible interpretations. KB i α Reads: sentence α can be derived from KB by procedure i H S A W ((H S ) (A S) ( W)) W 23 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 α hat is, the procedure will answer any question whose answer follows from what is known by the KB. Certainty factor expressing confidence in the conclusion 24

Inference Example and Proof Rules fire fire switch_on_sprinklers switch_on_sprinklers Stating that B follows (or is provable) from A 1,...,A n can be written A 1,...,A n B Some Proof Rules Modus ponens is a well known proof rule: A B, A B where A and B are any W. Another common proof rule, is -elimination: A B A B A B Reads: if A and B hold (or are provable or true) then A (resp. B) must also hold. Another proof rule, is -introduction is: A A A B B A Reads: if A holds (or is provable or true) then A B must also hold. 25 26 rom r s Natural Deduction Example and s p p r s, s p? can we prove p, i.e. show 1. r s [Given] 2. s p [Given] 3. s [1 -elimination] r s s 4. p [2,3 modus ponens] s p, s p Proof heory Reasoning about statements of the logic without considering interpretations is known as proof theory. Proof rules (or inference rules) show us, given true statements how to generate further true statements. Axioms describe universal truths of the logic. Example p p is an axiom of propositional logic. We use the symbol to denote is provable or is true. We write A 1,...,A n B to show that B is provable from A 1,...,A n (given some set of inference rules). 27 28

Proofs Let A 1,...,A m, B be well-formed formulae. here is a proof of B from A 1,...,A m iff there exists some sequence of formulae C 1,...,C n such that C n = B,and each formula C k, for 1 k < n is either an axiom or one of the formulae A 1,...,A m, or else is the conclusion of a rule whose premises appeared earlier in the sequence. Example rom p q,( r q) (s p),q can we prove s q? 1. p q [Given] 2. ( r q) (s p) [Given] 3. q [Given] 4. s q [3, -introduction] hink how much work we would have had to do to construct a truth table to show ((p q) (( r q) (s p)) q) (s q) 29 30 Exercise Show r from p (q r) and p q using the rules we have seen so far. hat is, prove p (q r), p q r Soundness and Completeness Let A 1,...,A n,b be well-formed formulae and let A 1,...,A n B denote that B is derivable from A 1,...,A n. Informally, soundness involves ensuring our proof system gives the correct answers. heorem(soundness): If A 1,...,A n B then A 1... A n B Informally, completeness involves ensuring that all formulae that should be able to be proved can be. heorem(completeness): If A 1... A n B then A 1,...,A n B 31 32

More on Soundness and Completeness Example: An unsound (bad) inference rule is: A, B C Using this rule, from any p and q we could derive r yet p q r does not hold. he set of rules modus ponens and -elimination is incomplete: without -introduction we cannot do the proof on slide 28, yet ((p q) (( r q) (s p)) q) (s q) Summary We have had a brief recap of the syntax and semantics of propositional logic We have discussed proof (inference) rules and axioms, but have not seen the full set (- see books covering Natural Deduction in logic) We have seen some example proofs Note, at any step in the proof there may be many rules which could be applied; may need to apply search techniques, heuristics or strategies to find a proof Getting computers to perform proof is an area of AI itself known as automated reasoning Next time We will look at how we can automate deduction 33 34