COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Overview. Knowledge-Based Agents. Introduction. 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

Propositional Logic: Logical Agents (Part I)

Artificial Intelligence. Propositional logic

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logic. proof and truth syntacs and semantics. Peter Antal

Advanced Topics in LP and FP

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

CS 771 Artificial Intelligence. Propositional Logic

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

Knowledge based Agents

Logical agents. Chapter 7. Chapter 7 1

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

Artificial Intelligence Chapter 7: Logical Agents

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

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

Logical Agent & Propositional Logic

Logical agents. Chapter 7. Chapter 7 1

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

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

TDT4136 Logic and Reasoning Systems

Deliberative Agents Knowledge Representation I. Deliberative Agents

Propositional Logic: Logical Agents (Part I)

First Order Logic: Syntax and Semantics

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

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

Logical Agent & Propositional Logic

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

Artificial Intelligence

Logical Agents (I) Instructor: Tsung-Che Chiang

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

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Propositional Logic: Review

Logical Agents. Chapter 7

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

Kecerdasan Buatan M. Ali Fauzi

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Inference in Propositional Logic

Artificial Intelligence Knowledge Representation I

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Logic & Logic Agents Chapter 7 (& background)

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Introduction to Artificial Intelligence. Logical Agents

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

Class Assignment Strategies

Natural Deduction for Propositional Logic

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

CS 188: Artificial Intelligence Spring 2007

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

First Order Logic: Syntax and Semantics

Foundations of Artificial Intelligence

Learning Goals of CS245 Logic and Computation

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

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

Agents that reason logically

Logic for Computer Science - Week 4 Natural Deduction

Logical Agents. September 14, 2004

22c:145 Artificial Intelligence

Logical Agents: Propositional Logic. Chapter 7

02 Propositional Logic

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

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

Propositional Logic: Methods of Proof (Part II)

Inference Methods In Propositional Logic

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

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

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

15414/614 Optional Lecture 1: Propositional Logic

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

CSC Discrete Math I, Spring Propositional Logic

Section 1.2: Propositional Logic

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

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

Logic and Proofs. (A brief summary)

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

PROPOSITIONAL CALCULUS

Logic and Inferences

Artificial Intelligence

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

Inference Methods In Propositional Logic

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

Propositional Logic: Methods of Proof (Part II)

Propositional and First-Order Logic

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

Logic & Logic Agents Chapter 7 (& Some background)

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

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

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

CS 380: ARTIFICIAL INTELLIGENCE

Transcription:

COMP219: Artificial Intelligence Lecture 19: Logic for KR 1

Overview Last time Expert Systems and Ontologies Today Logic as a knowledge representation scheme Propositional Logic Syntax Semantics Proof theory Natural deduction 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; 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 Thinking humanly Logic provides the paradigm for thinking rationally Current AI is more concerned with describing rationality than pragmatic replication of human behaviour 3

Knowledge-Based Agents Knowledge base = set of sentences in a formal language Declarative approach to building an agent Tell it what it needs to know Then 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 4

Knowledge-Based Agents The 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 5

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 The syntax of a logic defines the syntactically acceptable objects of the logic, or well-formed formulae The semantics of a logic associate each formula with a meaning The proof theory is concerned with manipulating formulae according to certain rules 6

Propositional Logic The 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. These in turn may be combined into further propositions. The 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. 7

Well-Formed Formulae The set of sentences or well-formed propositional formulae (WFF) is defined as: Any propositional symbol is in WFF. The nullary connectives, true and false are in WFF. If A and B are in WFF then so is A, A B, A B,A B and A B. If A is in WFF then so is(a). So, e.g. ((A B) (P B)) Q 8

Propositional Logic Semantics Propositions can be true or false. Formally: Let I : PROP {T, F} 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. 9

Truth Tables We can summarise the operation of the connectives using truth tables. Rows in the table give all possible setting of the propositions to true (T) or false (F) p q p p q p q p q p q T T F T T T T T F F F T F F F T T F T T F F F T F F T T 10

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) 11

Exercise p q (p q) (q p) (p q) (q p) T T F F T F T F T F T T T T F T T T T T 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 13

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. 14

Propositional Logic Example (I) alarm_beeps hot (hot smoky fire) (alarm_beeps smoky) (fire switch_on_sprinklers) switch_on_sprinklers 15

Propositional Logic Example (II) (hot smoky fire) (alarm_beeps smoky) (fire switch_on_sprinklers) alarm_beeps hot switch_on_sprinklers 16

Propositional Logic Example (III) (hot smoky fire) (alarm_beeps smoky) (fire switch_on_sprinklers) switch_on_sprinklers fire 17

Propositional Logic Example (IV) (hot smoky fire) (alarm_beeps smoky) (fire switch_on_sprinklers) switch_on_sprinklers hot smoky 18

Propositional Logic for KR Describe what we know about a particular domain by a propositional formula, KB Formulate a hypothesis, α We want to know whether KB implies α 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

Entailment Test How do we know that KB α? Models Inference 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 α Then KB α if and only if M(KB) M(α) e.g. KB = Giants won and Rangers won α = Giants won 21

Example (hot smoky fire) (alarm_beeps smoky) (fire switch_on_sprinklers)? switch_on_sprinklers fire Abbreviations: Hot, Smoky, Fire, Alarm_beeps, switch_on_sprinklers ((H S F) (A S) (F W))? ( W F) 22

Truth Table gives a truth table for all possible interpretations. H S F A W ((H S F) (A S) (F W)) W F T T T T T T T T T T T F F F T T T F T T T T T T F F F F T T F T T F T T T F T F F T 23

Inference KB i α Reads: 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 α That 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 25

Some Proof Rules Modus ponens is a well known proof rule: A B, A B where A and B are any WFF. 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. 26

Natural Deduction Example From r s 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 27

Proof Theory 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). 28

Proofs Let A 1,...,A m, B be well-formed formulae. There 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. 29

Example From 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] Think 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) 30

Exercise Show r from p (q r) and p q using the rules we have seen so far. That is, prove p (q r), p q r 31

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. Theorem(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. Theorem(Completeness): If A 1... A n B then A 1,...,A n B 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. The 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) 33

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 34