I NTRO TO L OGIC Dr Shlomo Hershkop March 23 2010.

Slides:



Advertisements
Similar presentations
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Advertisements

Introduction to Theorem Proving
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Logic Use mathematical deduction to derive new knowledge.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
Knowledge Representation I (Propositional Logic) CSE 473.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Chapter 3 Propositional Logic
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
SSK3003 DISCRETE STRUCTURES
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.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
CS6133 Software Specification and Verification
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
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.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #6
EA C461 Artificial Intelligence
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
ARTIFICIAL INTELLIGENCE
Logical Inference: Through Proof to Truth
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Logic Use mathematical deduction to derive new knowledge.
CS 270 Math Foundations of CS
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Back to “Serious” Topics…
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Presentation transcript:

I NTRO TO L OGIC Dr Shlomo Hershkop March

L OGICAL REASONING How do we know what we know ? Knowledge representation in AI How to represent knowledge in a specific domain Reason and make decisions about this knowledge Logic well studied area which is a formal language to describe facts (syntax and symantics) and the tools to perform reasoning about those facts.

W HY LOGIC ? Example of some facts: Someone throws a rock through your window You get more hate mail than usual Your telephone is always ringing Use logic to draw a conclusion Use logic to decide on how to move forward

Top down approach Deductive reasoning: take general rules/axioms and apply to logical conclusions Bottom up approach Inductive reasoning: moving from specifics to general

D EDUCTION E XAMPLE 1. If it is midterm time, Students feel they are being treated unfairly.

D EDUCTION E XAMPLE 1. If it is midterm time, Students feel they are being treated unfairly. 2. If Students feel they are being treated unfairly, they hate their Professor.

D EDUCTION E XAMPLE 1. If it is midterm time, Students feel they are being treated unfairly. 2. If Students feel they are being treated unfairly, they hate their Professor. 3. If Students hate their Professor, the Professor is unhappy.

D EDUCTION E XAMPLE 1. If it is midterm time, Students feel they are being treated unfairly. 2. If Students feel they are being treated unfairly, they hate their Professor. 3. If Students hate their Professor, the Professor is unhappy. Question: Is the Professor unhappy ??

P ROPOSITION L OGIC Variables/Symbols: P, Q, R Connectors ~ negation  conjunction  disjunction  implication  biconditional Sentences wffs

L OGIC Syntax: Legal symbols we can use Sentences WFFs Well formed formulas True and False are sentences Legal symbols are sentences Connectors + Symbols are sentences Meaning of sentence will be T/F

Interpretation / Evaluation: Specific set of t/f assignments to the set of atoms Model : Specific set of assignments to make the sentence true Valid: A valid wff is true under all interpretations It is raining Inconsistent / unsatisfiable False under all interpretations Raining AND ~Raining

D EDUCTION T HEORY G is a logical consequence of statements F 1,..,F n if a model of the statements is also a model of G i.e. A = (F 1  F 2  F 3  …F n )  G How to prove this ?

L OGICAL CONSEQUENCE G is a logical consequence of wwf’s F1..Fn iff for any model of (F1  F2 .. Fn)  G is valid Plain english: if all wff are true, the conclusion must be consistent.

Deductive Theorem: A follows from a logical consequence the premises F1,..,Fn iff (F1 ..  Fn )  S Interpretation Assignment of T/F to each proposition Satisfiability Finding the model where conclusion is true

E XAMPLE 2 P = Hot Q = Humid R = Raining Given Facts: (P ^ Q) => R) if its hot and humid its raining (Q => P) if its humid then its hot Q It is humid Question: IS IT RAINING ?

REFUTATION Sometimes can also prove the opposite Proof by contradiction Attempt to show ~S is inconsistent ~S = F 1  F 2 ..  F n  ~G

M ILLION DOLLAR QUESTION Given F1, F2,.., Fn can we conclude G ?? Mechanical way: (F 1  F 2 ..  F n )  G Establish it is valid: no matter what it evaluates to TRUE G is a logical consequence of F 1  F 2 ..  F n

E XAMPLE 3 P = “it is midterm season” Q = “Students feel treated unfairly” S = “Hate Prof” U = “Prof unhappy” Facts: P  Q Q  S S  U P ??U??

E XAMPLE 3 ( ( P  Q )  ( Q  S)  ( S  U )  (P) )=> (U) Most mechanical way: Truth Tables! 2 d decidable At worst would need to step through 2 n if enumerate every state PQSU TTTT TTTF

E XAMPLE 2

P ROVING Is propositional logic decidable ?

A BETTER METHOD Instead of listing the truth table Can use inference to deduce the truth Called natural deduction

N ATURAL D EDUCTION TOOLS Modus Ponens (i.e. forward chaining) If A, then B A is true Therefore B Unit resolution A or B is true ~B given, therefore A And Elimination (A and B) are true Therefore A is true Implication elimination If A then Bequivalent~A  B

U SEFUL TOOLS Double negation ~(~A) equivalent A De Morgan’s Rule ~(A  B) equivalent to (~A  ~B) ~(A  B )  (~A  ~B) Distribution F  (G  H)  (F  G )  (F  H )

P ROVING Proof is a sequence of wffs each given or derived 1. Q(premise) 2. Q => P(premise) 3. P(modus p) 4. (P ^ Q) => R(premise) 5. P ^ Q(and introduction) 6. R(conclusion)

N ORMAL F ORMS To expand the known facts, we can move to another logically equivalent form Biconditional: A  B (A =>B)  (B => A) (~A  B )  (A  ~B )

SATISFIABILITY Many problems can be framed as a list of constraints Some students want the final early Some students can’t take it before 11am Some can’t stay more than X hours except Tuesday Usually written as CNF (A  B)  (~B  C) ..

(A  B) is a clause A, B are literals Every sentence in Propositional Logic can be written as CNF Converting: Get rid of implications and conditionals Fold in negations using De Morgans Law Or’s insider, ands outside Will end up growing the sentence Used for input for resolution

E XAMPLE (A  B) -> ( C -> D) Can you convert this to CNF ??

E XAMPLE (A  B) -> ( C -> D) C -> D ~C  D ~(A  B)  (~C  D) (~A  ~B)  (~C  D) (~A  ~C  D )  (~B  ~C  D)

R ESOLUTION A  B ~B  C Conclude: A  C Algorithm: Convert everything to CNF Negate the desired state Apply resolution until get False or can’t go on

E XAMPLE A  B A => C B => C Is C true ?

1. A  B (known) 2. ~A  C (known) 3. ~B  C (known) 4. ~C (negate target) 5. B  C (combine first 2) 6. ~A (2,4) 7. ~B (3,4) 8. C (5,7) 9. (4,8)

H ORN C LAUSE Disjunction of literals with exactly one positive ~F 1  ~F 2  ~F 3 ….  ~F n  A P => Q L  M => P B  L => M A  P => L A  B => L A B

L IMITATIONS Proposition logic limits FOPL