Logic: Intro & Propositional Definite Clause Logic

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

Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

Individuals and Relations

Propositional Logic: Semantics and an Example

Logic: Bottom-up & Top-down proof procedures

Reasoning Under Uncertainty: Introduction to Probability

Reasoning under Uncertainty: Intro to Probability

Künstliche Intelligenz

Logic: Top-down proof procedure and Datalog

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

Reasoning Under Uncertainty: Introduction to Probability

Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule

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

Propositional Logic: Bottom-Up Proofs

Contents Chapters 2 & 3

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

Reasoning under Uncertainty: Intro to Probability

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Artificial Intelligence Chapter 7: Logical Agents

Announcements. Assignment 5 due today Assignment 6 (smaller than others) available sometime today Midterm: 27 February.

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

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Intelligent Agents. Pınar Yolum Utrecht University

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Foundations of Artificial Intelligence

Logic: Resolution Proofs; Datalog

Deliberative Agents Knowledge Representation I. Deliberative Agents

Introduction to Arti Intelligence

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

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Kecerdasan Buatan M. Ali Fauzi

Introduction to Artificial Intelligence. Logical Agents

Introduction to Artificial Intelligence (AI)

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

CS 4700: Foundations of Artificial Intelligence

Logical Agents. September 14, 2004

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Introduction to Artificial Intelligence (AI)

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

SAT, NP, NP-Completeness

CSE507. Course Introduction. Computer-Aided Reasoning for Software. Emina Torlak

Chapters 2&3: A Representation and Reasoning System

First Order Logic (FOL)

Proofs Propositions and Calculuses

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

Probability and Time: Hidden Markov Models (HMMs)

Mathematical Logic Part Three

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

Logical Agent & Propositional Logic

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

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

Logical Agents. Chapter 7

Propositional Reasoning

CS 188: Artificial Intelligence Spring 2007

AI Programming CS S-09 Knowledge Representation

First Order Logic: Syntax and Semantics

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

Artificial Intelligence Knowledge Representation I

Intelligent Systems (AI-2)

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

CS 4100 // artificial intelligence. Recap/midterm review!

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

Chapter 4: Classical Propositional Semantics

Logical Agents. Outline

Propositions. c D. Poole and A. Mackworth 2008 Artificial Intelligence, Lecture 5.1, Page 1

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Lecture 7: Logic and Planning

Agents that reason logically

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

Propositional Logic: Logical Agents (Part I)

Introduction to Intelligent Systems

Propositional Logic: Logical Agents (Part I)

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Logic Background (1A) Young W. Lim 5/14/18

Artificial Intelligence

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

CS 730/830: Intro AI. 1 handout: slides. Wheeler Ruml (UNH) Lecture 11, CS / 15. Propositional Logic. First-Order Logic

CS 730/830: Intro AI. 2 handouts: slides, asst 5. Wheeler Ruml (UNH) Lecture 10, CS / 19. What is KR? Prop. Logic. Reasoning

Guest Speaker. CS 416 Artificial Intelligence. First-order logic. Diagnostic Rules. Causal Rules. Causal Rules. Page 1

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II)

Propositional Logic 1

Chapter 5: Propositions and Inference. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 5, Page 1

Lecture Overview [ ] Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 6. Motivation. Logical Agents

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Midterm Examination CS540: Introduction to Artificial Intelligence

COMP3702/7702 Artificial Intelligence Week1: Introduction Russell & Norvig ch.1-2.3, Hanna Kurniawati

Computer Science CPSC 322. Lecture 18 Marginalization, Conditioning

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

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Computer Science CPSC 322. Lecture 23 Planning Under Uncertainty and Decision Networks

CSC9R6 Computer Design. Practical Digital Logic

Lecture 3: Semantics of Propositional Logic

Transcription:

Logic: Intro & Propositional Definite Clause Logic Alan Mackworth UBC CS 322 Logic 1 February 27, 2013 P & M extbook 5.1

Lecture Overview Recap: CSP planning Intro to Logic Propositional Definite Clause Logic: Syntax Propositional Definite Clause Logic: Semantics 2

What is the difference between CSP and Planning? CSP: static Find a single total variable assignment that satisfies all constraints Planning: sequential Find a sequence of actions to get from start to goal CSPs don t even have the concept of actions Some similarities to CSP: Use of variables/values Can solve planning as CSP. But the CSP corresponding to a planning instance can be very large Make CSP variable for each SRIPS variable at each time step Make CSP variable for each SRIPS action at each time step 3

CSP Planning: Solving the problem Map SRIPS Representation into CSP for horizon 0,1, 2, 3, Solve CSP for horizon h = 0, 1, 2, 3, until solution found at the lowest possible horizon h = 0 Is there a solution for this horizon? If yes, DONE! If no, continue 4

CSP Planning: Solving the problem Map SRIPS Representation into CSP for horizon 0,1, 2, 3, Solve CSP for horizon h=0, 1, 2, 3, until solution found at the lowest possible horizon h = 1 Is there a solution for this horizon? If yes, DONE! If no, continue N.B. Notice the use of k-ary constraints, k= 1,2,3,4,.., so need GAC to solve CSP at each step, not just AC for binary constraints. 5

CSP Planning: Solving the problem Map SRIPS Representation into CSP for horizon 0,1, 2, 3, Solve CSP for horizon h=0, 1, 2, 3, until solution found at the lowest possible horizon h = 2: Is there a solution for this horizon? If yes, DONE! If no.continue 6

Solving Planning as CSP: pseudo code for horizon h=0,1,2, map SRIPS into a CSP csp with horizon h solve that csp if solution to the csp exists then return solution end for Solve each of the CSPs based on systematic search - Not SLS! SLS cannot determine that no solution exists! 7

Learning Goals for Planning SRIPS Represent a planning problem with the SRIPS representation Explain the SRIPS assumption Forward planning Solve a planning problem by search (forward planning). Specify states, successor function, goal test and solution. Construct and justify a heuristic function for forward planning CSP planning ranslate a planning problem represented in SRIPS into a corresponding CSP problem (and vice versa) Solve a planning problem with CSP by expanding the horizon 8

Lecture Overview Recap: CSP planning Intro to Logic Propositional Definite Clause Logic: Syntax Propositional Definite Clause Logic: Semantics 9

Problem ype Static Sequential Constraint Satisfaction Logic Planning Back to static problems, but with richer representation Course Overview Deterministic Arc Consistency Variables + Search Constraints Logics SRIPS Search Environment Search As CSP (using arc consistency) Stochastic Bayesian Networks Variable Elimination Decision Networks Variable Elimination Markov Processes Value Iteration Course Module Representation Reasoning echnique Uncertainty Decision heory 10

Logics in AI: Similar slide to the one for planning Propositional Definite Clause Logics Datalog Semantics and Proof heory Propositional Logics First-Order Logics Satisfiability esting (SA) Description Logics Ontologies Production Systems Cognitive Architectures Hardware Verification Software Verification Product Configuration Semantic Web Video Games Applications Information Extraction Summarization utoring Systems 11

Logics in AI: Similar slide to the one for planning Propositional Definite Clause Logics Datalog Semantics and Proof heory Propositional Logics First-Order Logics Satisfiability esting (SA) Description Logics Ontologies Production Systems Cognitive Architectures Hardware Verification Software Verification Product Configuration You will know Semantic Web Video Games You will know a little Applications Information Extraction Summarization utoring Systems 12

What you already know about logic... From programming: Some logical operators If ((amount > 0) && (amount < 1000))!(age < 30)... You know what they mean in a procedural way Logic is the language of mathematics. o define formal structures (e.g., sets, graphs) and to prove statements about them (x)triangle(x) " " [A = B = C " α = β = γ] We use logic as a Representation and Reasoning System that can be used to formalize a domain and to reason about it 13

Logic: a framework for representation & reasoning When we represent a domain about which we have only partial (but certain) information, we need to represent. Objects, properties, sets, groups, actions, events, time, space, All these can be represented as Objects Relationships between objects Logic is the language to express knowledge about the world this way http://en.wikipedia.org/wiki/john_mccarthy (1927-2011) Logic and AI, he Advice aker, LISP, situation calculus, Coined Artificial Intelligence. Dartmouth W shop (1956) 14

Why Logics? Natural to express knowledge about the world (more natural than a flat set of variables & constraints) E.g. Every 322 student who works hard passes the course student(s) registered(s, c) course_name(c, 322) works_hard(s) passes(s,c) student(sam) registered(sam, c1) course_name(c1, 322) Query: passes(sam, c1)? Compact representation - Compared to, e.g., a CSP with a variable for each student - It is easy to incrementally add knowledge - It is easy to check and debug knowledge - Provides language for asking complex queries - Well understood formal properties 15

Logic: A general framework for reasoning Let's think about how to represent a world about which we have only partial (but certain) information Our tool: propositional logic General problem: tell the computer how the world works tell the computer some facts about the world ask a yes/no question about whether other facts must be true 16

Representation and Reasoning System (RRS) Definition (RRS) A Representation and Reasoning System (RRS) consists of: syntax: specifies the symbols used, and how they can be combined to form legal sentences semantics: specifies the meaning of the symbols reasoning theory or proof procedure: a (possibly nondeterministic) specification of how an answer can be produced. We have seen several representations and reasoning procedures: State space graph + search CSP + search/arc consistency SRIPS + search/arc consistency 17

Using a Representation and Reasoning System 1. Begin with a task domain. 2. Distinguish those things you want to talk about (the ontology) 3. Choose symbols in the computer to denote propositions 4. ell the system knowledge about the domain 5. Ask the system whether new statements about the domain are true or false 18

Example: Electrical Circuit /down" / up"

/down" / up"

Propositional Definite Clauses A simple representation and reasoning system wo kinds of statements: that a proposition is true that a proposition is true if one or more other propositions are true Why only propositions? We can exploit the Boolean nature for efficient reasoning Starting point for more complex logics o define this RRS, we'll need to specify: syntax semantics proof procedure 21

Lecture Overview Recap: CSP planning Intro to Logic Propositional Definite Clause (PDC) Logic: Syntax Propositional Definite Clause (PDC) Logic: Semantics 22

Propositional Definite Clauses: Syntax Definition (atom) An atom is a symbol starting with a lower case letter Definition (body) A body is an atom or is of the form b 1 b 2 where b 1 and b 2 are bodies. Definition (definite clause) A definite clause is an atom or is a rule of the form h b where h is an atom ( head ) and b is a body. (Read this as h if b.) Definition (KB) A knowledge base (KB) is a set of definite clauses Examples: p 1, live_l 1 Examples: p 1 p 2, ok_w 1 live_w 0 Examples: p 1 p 2, live_w 0 live_w 1 up_s 2 Example: {p 1 p 2, live_w 0 live_w 1 up_s 2 }

atoms definite clauses, KB rules

PDC Syntax: more examples Definition (definite clause) A definite clause is an atom or is a rule of the form h b where h is an atom ( head ) and b is a body. (Read this as h if b. ) Legal PDC clause Not a legal PDC clause a) ai_is_fun b) ai_is_fun ai_is_boring c) ai_is_fun learn_useful_techniques d) ai_is_fun learn_useful_techniques notoomuch_work e) ai_is_fun learn_useful_techniques oomuch_work f) ai_is_fun f(time_spent, material_learned) g) srtsyj errt gffdgdgd

PDC Syntax: more examples Legal PDC clause Not a legal PDC clause a) ai_is_fun b) ai_is_fun ai_is_boring c) ai_is_fun learn_useful_techniques d) ai_is_fun learn_useful_techniques notoomuch_work e) ai_is_fun learn_useful_techniques oomuch_work f) ai_is_fun f(time_spent, material_learned) g) srtsyj errt gffdgdgd Do any of these statements mean anything? Syntax doesn't answer this question!

Lecture Overview Recap: CSP planning Intro to Logic Propositional Definite Clause (PDC) Logic: Syntax Propositional Definite Clause (PDC) Logic: Semantics 27

Propositional Definite Clauses: Semantics Semantics allows you to relate the symbols in the logic to the domain you re trying to model. Definition (interpretation) An interpretation I assigns a truth value to each atom. If our domain has 5 atoms, how many interpretations are there? 5+2 5*2 5 2 2 5

Propositional Definite Clauses: Semantics Semantics allows you to relate the symbols in the logic to the domain you're trying to model. Definition (interpretation) An interpretation I assigns a truth value to each atom. If our domain has 5 atoms, how many interpretations are there? 2 values for each atom, so 2 5 combinations Similar to possible worlds in CSPs

Propositional Definite Clauses: Semantics Semantics allows you to relate the symbols in the logic to the domain you're trying to model. Definition (interpretation) An interpretation I assigns a truth value to each atom. We can use the interpretation to determine the truth value of clauses Definition (truth values of statements) A body b 1 b 2 is true in I if and only if b 1 is true in I and b 2 is true in I. A rule h b is false in I if and only if b is true in I and h is false in I.

PDC Semantics: Example ruth values under different interpretations F=false, =true a 1 a 2 a 1 a 2 h b h b I 1 F F F I 1 F F F I 2 F F I 2 F F F F I 3 F F I 3 F F F I 4 I 4 31

PDC Semantics: Example ruth values under different interpretations F=false, =true h a 1 a 2 h a 1 a 2 h b h b I 1 F F F F I 1 F F I 2 F F I 2 F F I 3 F F F I 3 F I 4 F F F I 4 I 5 F F F h b is only false if b is true and h is false I 6 F I 7 F I 8 F F F 32

PDC Semantics: Example for truth values ruth values under different interpretations F=false, =true h a 1 a 2 h a 1 a 2 h b h b I 1 F F I 2 F F I 3 F I 4 h a 1 a 2 Body of the clause: a 1 a 2 Body is only true if both a 1 and a 2 are true in I I 1 F F F I 2 F F I 3 F F I 4 F F I 5 F F I 6 F I 7 F I 8 33

Propositional Definite Clauses: Semantics Semantics allows you to relate the symbols in the logic to the domain you're trying to model. Definition (interpretation) An interpretation I assigns a truth value to each atom. We can use the interpretation to determine the truth value of clauses and knowledge bases: Definition (truth values of statements) A body b 1 b 2 is true in I if and only if b 1 is true in I and b 2 is true in I. A rule h b is false in I if and only if b is true in I and h is false in I. A knowledge base KB is true in I if and only if every clause in KB is true in I.

Propositional Definite Clauses: Semantics Definition (interpretation) An interpretation I assigns a truth value to each atom. Definition (truth values of statements) A body b 1 b 2 is true in I if and only if b 1 is true in I and b 2 is true in I. A rule h b is false in I if and only if b is true in I and h is false in I. A knowledge base KB is true in I if and only if every clause in KB is true in I. Definition (model) A model of a knowledge base KB is an interpretation in which KB is true. Similar to CSPs: a model of a set of clauses is an interpretation that makes all of the clauses true

PDC Semantics: Example for models Definition (model) A model of a knowledge base KB is an interpretation in which every clause in KB is true. KB = p q q r s Which of the interpretations below are models of KB? I 1, I 3 I 1, I 3, I 4 All of them I 3 p q r s I 1 I 2 F F F F I 3 F F I 4 F I 5 F F 36

PDC Semantics: Example for models Definition (model) A model of a knowledge base KB is an interpretation in which every clause in KB is true. KB = p q q r s Which of the interpretations below are models of KB? I 1, I 3 I 1, I 3, I 4 All of them I 3 p q r s p q q r s KB I 1 I 2 F F F F F I 3 F F I 4 F I 5 F F F F 37

PDC Semantics: Example for models Definition (model) A model of a knowledge base KB is an interpretation in which every clause in KB is true. KB = p q q r s Which of the interpretations below are models of KB? All interpretations where KB is true: I 1, I 3, and I 4 p q r s p q q r s KB I 1 I 2 F F F F F F I 3 F F I 4 F I 5 F F F F F 38

Next class We ll start using all these definitions for automated proofs! 39