CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.

Slides:



Advertisements
Similar presentations
Artificial Intelligence in the 21 st Century S. Lucci / D. Kopec Chapter 5: Logic in Artificial Intelligence 1.
Advertisements

UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Models and Propositional Logic In propositional logic, a model in general simply fixes the truth value – true or false – for every proposition symbol.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Logic Use mathematical deduction to derive new knowledge.
Logic.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Knowledge Representation I (Propositional Logic) CSE 473.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Let remember from the previous lesson what is Knowledge representation
CS 4700: Foundations of Artificial Intelligence
1 Knowledge Representation and Reasoning. 2 Knowledge Representation & Reasoning How knowledge about the world can be represented How knowledge about.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Intro to Discrete Structures
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Logical Agents Logic Propositional Logic Summary
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
S P Vimal, Department of CSIS, BITS, Pilani
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Review of Propositional Logic Syntax
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
CS2351 Artificial Intelligence Bhaskar.V Class Notes on Knowledge Representation - Logical Agents.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 05 : Knowledge Base & First Order Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Knowledge Representation Lecture 2 out of 5. Last Week Intelligence needs knowledge We need to represent this knowledge in a way a computer can process.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Propositional Logic (a.k.a. Sentential Logic)
DISCRETE MATHEMATICS CHAPTER I.
Knowledge Representation and Reasoning
Knowledge and reasoning – second part
The Propositional Calculus
ARTIFICIAL INTELLIGENCE
Logical Agents.
EA C461 – Artificial Intelligence Logical Agent
Semantics In propositional logic, we associate atoms with propositions about the world. We specify the semantics of our logic, giving it a “meaning”. Such.
Propositional Logic.
Logical Agents Reading: Russell’s Chapter 7
Logics for Data and Knowledge Representation
Logical Agents Chapter 7.
Logic Use mathematical deduction to derive new knowledge.
Artificial Intelligence
CS 416 Artificial Intelligence
Knowledge and reasoning – second part
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Logical Agents Chapter 7.
PROPOSITIONAL LOGIC - SYNTAX-
Logics for Data and Knowledge Representation
Propositional Logic Computational Logic Lecture 2
Presentation transcript:

CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic

2 Logic When we have too many states, we want a convenient way of dealing with sets of states. The sentence “It’s raining” stands for all the states of the world in which it is raining. Logic provides a way of manipulating big collections of sets by manipulating short descriptions instead. Instead of thinking about all the ways a world could be, we’re going to work in the a language of expressions that describe those sets.

3 What is logic A formal language –Syntax – what expressions are legal –Semantics – what legal expressions mean –Proof system – a way of manipulating syntactic expressions to get other syntactic expressions (which will tell us something new) Why proofs? Two kinds of inferences an agent might want to make: –Multiple percepts => conclusions about the world –Current state & operator => properties of next state

4 Propositional Logic Syntax Syntax: what you’re allowed to write –for (thing t = fizz; t == fuzz; t++){ … } –Colorless green ideas sleep furiously. Sentences (wffs: well formed formulas) –true and false are sentences –Propositional variables are sentences: P,Q,R,Z –If  and  are sentences, then so are (  ), ~ ,  ∨ ,  ∧ ,  → ,  ↔  –Nothing else is a sentence ((~P ∨ ((True ∧ R) ↔ Q)) → S) well formed (~(P ∨ Q) ∧ → S) not well formed

5 Precedence If the order is clear, you can leave off parenthesis. ~ ∧ ∨ → ↔ highest lowest A ∨ B ∧ C A ∨ (B ∧ C) A ∧ B → C ∨ D(A ∧ B) → (C ∨ D) A → B ∨ C ↔ D(A → (B ∨ C)) ↔ D

6 Try this Which of these are legal sentences? Give fully parenthesized expressions for the legal sentences.

7 Semantics An interpretation is a complete True / False assignment to propositional symbols The semantics (meaning) of a sentence is the set of interpretations in which the sentence evaluates to True. Example: the semantics of the sentence P ∨ Q is the set of three interpretations –P=True, Q=True –P=True, Q=False –P=False, Q=True

8 Evaluating a sentence under an interpretation Truth Tables PQ ~P~P P ∧ QP ∨ Q P → QQ → P P ↔ Q fftffttt fttfttff tffftftf ttfttttt

9 Logical equivalences

10 Terminology A sentence is valid iff its truth value is t in all interpretations. Valid sentences: true, : false, P ∨ ~ P A sentence is satisfiable iff its truth value is t in at least one interpretation –Satisfiable sentences: P, true, ~ P A sentence is unsatisfiable iff its truth value is f in all interpretations –Unsatisfiable sentences: P ∧ ~ P, false, ~ true

11 Examples smoke → smoke smoke Ç : smoke valid smoke fire satisfiable, not valid (s ! f) ! ( : s ! : f) satisfiable, not valid smoke = t, fire = f Interpretation that make sentence’s truth value = f Sentence Valid? s = f, f = t s ! f = t, : s ! : f = f (s ! f) ! ( : f ! : s) valid b Ç d Ç (b ! d) valid b Ç d Ç : b Ç d

12 Satisfiability Problems Many problems can be expressed as a list of constraints. Answer is assignment to variables that satisfy all the constraints. Examples: –Scheduling people to work in shifts at a hospital Some people don’t work at night No one can work more than x hours a week Some pairs of people can’t be on the same shift Is there assignment of people to shifts that satisfy all constraints?

13 Conjunctive Normal Form Satisfiability problems are written as conjunctive normal form (CNF) formulas: – is a clause, which is a disjunction of literals –A, B, and : C are literals, each of which is a variable or the negation of a variable. –Each clause is a requirement which must be satisfied and it has different ways of being satisfied. –Every sentence in propositional logic can be written in CNF

14 Converting to CNF

15 CNF Conversion Example

16 Try this Convert to CNF

17 Algorithms for Satisfiability Given a sentence in CNF, how can we prove it is satisfiable? Consider a search tree where at each level we consider the possible assignments to one variable, say P. On one branch, we assume P is f and on the other that it is t. Given an assignment for a variable, we can simplify the sentence and then repeat the process for another variable.

18 Assign and Simplify Example

19 Search Example

20 Search Example

21 Search Example

22 Search Example

23 Search Example

24 Try this Given a sentence find the satisfiability search tree