Inference Methods Propositional and Predicate Calculus.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Logic & Critical Reasoning
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Introduction to Theorem Proving
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.
1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: The Moon is made of green cheese. Trenton.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Discussion #18 1/13 Discussion #18 Resolution with Propositional Calculus; Prenex Normal Form.
CS128 – Discrete Mathematics for Computer Science
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
From Chapter 4 Formal Specification using Z David Lightfoot
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) March, 5, 2010.
Knoweldge Representation & Reasoning
Chapter 3 Propositional Logic
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
Adapted from Discrete Math
3.2 – Truth Tables and Equivalent Statements
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 3.2 Truth Tables for Negation, Conjunction, and Disjunction.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Validity: Long and short truth tables Sign In! Week 10! Homework Due Review: MP,MT,CA Validity: Long truth tables Short truth table method Evaluations!
The Foundations: Logic and Proofs
Intro to Discrete Structures
The Foundations: Logic and Proofs
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Normal Forms, Tautology and Satisfiability 2/3/121.
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Chapter 7 Logic, Sets, and Counting
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
CS6133 Software Specification and Verification
Conditional Statements – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Conditional Statements Reading: Kolman, Section 2.2.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Outline Logic Propositional Logic Well formed formula Truth table
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Chapter 1 Logic and proofs
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Biointelligence Lab School of Computer Sci. & Eng.
Presentation transcript:

Inference Methods Propositional and Predicate Calculus

Propositional Logic A declarative statement such as “Bill is a CS student” has a truth value of T or F and is denoted by P (a truth variable) Propositions may be combined with logical operators and the composite statement has value as shown below. –P  Q is true if either P or Q are true and false if both are false –P  Q is true if both P and Q are true and false if either is false. –¬ P is true if P is false and false if P is true –P  Q is true if P and Q have the same truth value and false if their values differ –P  Q is false if P is true and Q is false and true otherwise. A tautology is always true. –P  Q  ¬ P  Q is a tautology. –P  (Q  R)  (P  Q)  (P  R) is a tautology.

Terminology  is negation,  is conjunction,  is disjunction,  is conditional,  is equivalence Atomic expression is P,Q,etc representing a declarative statement having value of True or False, or True or False A fully parenthesized expression fpe is a well-formed formula and is constructed according to following rules –Any atomic expression –If A is a fpe, so is  A –If A,B are fpe’s, so are (A  B), (A  B), (A  B) and (A  B)

Precedence Relations and Truth Tables  has highest precedence, then , , , and . Every logical operatior is left associative. A truth table gives the values of an logical expression for every combination of truth values of the atomic statements. It can be used to prove a tautology: –P  (Q  R)  (P  Q)  (P  R) PQR Q  RP  QP  RP  (Q  R)(P  Q)  (P  R)  FFF FFT FTF FTT TFF TFT TTF TTT

Proof by Truth Table P  (Q  R)  (P  Q)  (P  R) PQR Q  RP  QP  RP  (Q  R)(P  Q)  (P  R)  FFFFFFFFT FFTFFTFFT FTFFTFFFT FTTTTTTTT TFFFTTTTT TFTFTTTTT TTFFTTTTT TTTTTTTTT

Contradiction & Proof by Contradiction A contradiction is always false Suppose A are axioms assumed to be true. –Want to show A  T –If  T  A  False is a tautology, then  T  A must be false So, since A is true,  T must be false and so T is true.

Rules of Inference P, P  Q then Q - modus ponens ¬ Q, P  Q then ¬ P - modus tollens P  Q, Q  R then P  R - chaining (¬ P  Q), (P  R)  (Q  R) – resolution – P  R  ¬R  P –¬ P  Q  P  Q – ¬R  Q  Q  R

Resolution In Propositional Calculus Refutation –Resolution is not complete since P  Q  P  Q but cannot infer from P,Q. –However can show that  (P  Q) is inconsistent with P  Q.  (P  Q)   P,  Q which resolve with P,Q to give the empty clause Since P  Q is assumed to be true and the empty clause is false, P  Q follows from P  Q (proof by contradiction)

Resolution Refutation –Let W be a set of wffs. Want to show that W  t Convert W to clause form C. Convert  t to clause form c. Iteratively apply resolution to C U {c}, adding the resolvent until either no more resolvents can be added or until the empty clause Ø is produced. If Ø is produced, then W  t else t does not follow from W

(deftemplate term (slot cid) (slot tid) (slot sign) (slot pSym) (slot Proc) ) (deftemplate match-fact (multislot match)) (deffacts clauses (term (cid 1) (tid 1) (sign T) (pSym P) (Proc N)) (term (cid 1) (tid 2) (sign T) (pSym Q) (Proc N)) (term (cid 2) (tid 3) (sign F) (pSym P) (Proc N)) (term (cid 2) (tid 4) (sign T) (pSym R) (Proc N)) (term (cid 2) (tid 5) (sign T) (pSym S) (Proc N)) (maxCID 2) (not-matched) ) Modeling Clauses with CLIPS

(defrule match (term (cid ?i) (tid ?r1) (sign T) (pSym ?X) (Proc N)) (term (cid ?j) (tid ?r2) (sign F) (pSym ?X) (Proc N)) (test (not (= ?i ?j))) ?idx <- (not-matched) ?jdx <- (maxCID ?n) => (printout t "Matched clause " ?i " with clause " ?j crlf) (retract ?idx ) (retract ?jdx ) (assert (matched)) (assert (maxCID (+ ?n 1))) (assert (match ?i ?j)) (assert (omit1 ?r1)) (assert (omit2 ?r2)) ) Resolution Rule

(defrule mark-terms-in-resolved-clauses (match ?i ?j) ?mrk <- (term (cid ?c) (tid ?t) (sign ?s) (pSym ?p) (Proc N)) (test (or (= ?c ?i) (= ?c ?j))) => (retract ?mrk) (assert (term (cid ?c) (tid ?t) (sign ?s) (pSym ?p) (Proc Y))) ) Mark Terms in two clauses

(defrule build-resolventfrom1 (match ?i ?j) (term (cid ?i) (tid ?t) (sign ?s) (pSym ?X) (Proc Y)) (maxCID ?mc) (omit1 ?r1) (test (not (= ?t ?r1))) => (assert (term (cid ?mc) (tid ?t) (sign ?s) (pSym ?X) (Proc N))) (printout t "Resolvent clause " ?mc " with terms " ?t crlf) ) Add other terms to resolvent from 1 st clause

(defrule build-resolventfrom2 ?idx <- (match ?i ?j) (term (cid ?j) (tid ?t) (sign ?s) (pSym ?X) (Proc Y)) (maxCID ?mc) (omit2 ?r2) (test (not (= ?t ?r2))) => (assert (term (cid ?mc) (tid ?t) (sign ?s) (pSym ?X) (Proc N))) (printout t "Resolvent clause " ?mc " with terms " ?t crlf) ) Add other terms to resolvent from 2 nd clause