Carlos Varela Rensselaer Polytechnic Institute November 10, 2017

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Automated Reasoning Systems For first order Predicate Logic.
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.
Models and Propositional Logic In propositional logic, a model in general simply fixes the truth value – true or false – for every proposition symbol.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Logic Languages Source: Scott, Michael Programming Language Pragmatics 3rd Ed.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Logic Programming Languages. Objective To introduce the concepts of logic programming and logic programming languages To introduce a brief description.
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
Discrete Mathematics Math 6A Instructor: M. Welling.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Predicates and Quantifiers
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
Logic Programming Languages Session 13 Course : T Programming Language Concept Year : February 2011.
CS6133 Software Specification and Verification
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
C. Varela1 Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure Carlos Varela Rennselaer Polytechnic Institute November.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
Propositional Logic Predicate Logic
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
1-1 An Introduction to Logical Programming Sept
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Chapter 1 Logic and proofs
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
Advanced Algorithms Analysis and Design
CSE15 Discrete Mathematics 01/23/17
CSNB 143 Discrete Mathematical Structures
Propositional Logic Resolution
Proposition & Predicates
Horn Clauses and Unification
Logical Inference: Through Proof to Truth
Logic Programming Languages
Logic Programming Languages
Logics for Data and Knowledge Representation
CSE 311 Foundations of Computing I
Propositional Equivalences
Horn Clauses and Unification
Prolog IV Logic, condensed.
Horn Clauses and Unification
Horn Clauses and Unification
Negations of quantifiers
CSNB234 ARTIFICIAL INTELLIGENCE
Horn Clauses and Unification
Predicates and Quantifiers
RESOLUTION.
Predicate Logic: Syntax.
Carlos Varela Rennselaer Polytechnic Institute August 30, 2007
Presentation transcript:

Carlos Varela Rensselaer Polytechnic Institute November 10, 2017 Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure Carlos Varela Rensselaer Polytechnic Institute November 10, 2017 C. Varela

An Early (1971) “Conversation” USER: Cats kill mice. Tom is a cat who does not like mice who eat cheese. Jerry is a mouse who eats cheese. Max is not a mouse. What does Tom do? COMPUTER: Tom does not like mice who eat cheese. Tom kills mice. Who is a cat? Tom. USER: What does Jerry eat? COMPUTER: Cheese. Who does not like mice who eat cheese? Tom. What does Tom eat? What cats who do not like mice who eat cheese eat. C. Varela

Another Conversation USER: Every psychiatrist is a person. Every person he analyzes is sick. Jacques is a psychiatrist in Marseille. Is Jacques a person? Where is Jacques? Is Jacques sick? COMPUTER: Yes. In Marseille. I don’t know. C. Varela

Logic programming A program is a collection of axioms, from which theorems can be proven. A goal states the theorem to be proved. A logic programming language implementation attempts to satisfy the goal given the axioms and built-in inference mechanism. C. Varela

Propositional Logic Assigning truth values to logical propositions. Formula syntax: f ::= v symbol | f  f and | f  f or | f  f if and only if | f  f implies | f not C. Varela

Truth Values To assign a truth values to a propositional formula, we have to assign truth values to each of its atoms (symbols). Formula semantics: a b a  b a  b a  b a  b  a False F T True C. Varela

Tautologies A tautology is a formula, true for all possible assignments. For example: p  p The contrapositive law: (p  q )  (q  p) De Morgan’s law: (p  q)  (p  q) C. Varela

First Order Predicate Calculus Adds variables, terms, and (first-order) quantification of variables. Predicate syntax: a ::= p(v1, v2,…,vn) predicate f ::= a atom | v = p(v1, v2,…,vn) equality | v1 = v2 | ff | ff | ff | ff |f | v.f universal quantifier | v.f existential quantifier C. Varela

Predicate Calculus In mathematical logic, a predicate is a function that maps constants or variables to true and false. Predicate calculus enables reasoning about propositions. For example: C [rainy(C)  cold(C)  snowy(C)] Quantifier (, ) Operators (,,,,) C. Varela

Quantifiers Universal () quantifier indicates that the proposition is true for all variable values. Existential () quantifier indicates that the proposition is true for at least one value of the variable. For example: A B [(C [ takes(A,C)  takes(B,C)])  classmates(A,B) ] C. Varela

Structural Congruence Laws P1  P2  P1  P2 X [P(X)]  X [P(X)] X [P(X)]  X [P(X)] (P1  P2)  P1  P2 (P1  P2)  P1  P2 P  P (P1  P2)  (P1  P2)  (P2  P1) P1  (P2  P3)  (P1  P2)  (P1  P3) P1  (P2  P3)  (P1  P2)  (P1  P3) P1  P2  P2  P1 C. Varela

Clausal Form Looking for a minimal kernel appropriate for theorem proving. Propositions are transformed into normal form by using structural congruence relationship. One popular normal form candidate is clausal form. Clocksin and Melish (1994) introduce a 5-step procedure to convert first-order logic propositions into clausal form. C. Varela

Clocksin and Melish Procedure Eliminate implication () and equivalence (). Move negation () inwards to individual terms. Skolemization: eliminate existential quantifiers (). Move universal quantifiers () to top-level and make implicit , i.e., all variables are universally quantified. Use distributive, associative and commutative rules of , , and , to move into conjuctive normal form, i.e., a conjuction of disjunctions (or clauses.) C. Varela

Example Eliminate implication () and equivalence (). A [student(A)  (dorm_resident(A)  B [takes(A,B)  class(B)])] Eliminate implication () and equivalence (). A [student(A)  (dorm_resident(A)  Move negation () inwards to individual terms. B [(takes(A,B)  class(B))])] B [takes(A,B)  class(B)])] C. Varela

Example Continued A [student(A)  (dorm_resident(A)  B [takes(A,B)  class(B)])] Skolemization: eliminate existential quantifiers (). Move universal quantifiers () to top-level and make implicit , i.e., all variables are universally quantified. student(A)  (dorm_resident(A)  (takes(A,B)  class(B))) Use distributive, associative and commutative rules of , , and , to move into conjuctive normal form, i.e., a conjuction of disjunctions (or clauses.) (student(A)  dorm_resident(A))  (student(A)  takes(A,B)  class(B)) C. Varela

Horn clauses A standard form for writing axioms, e.g.: father(X,Y)  parent(X,Y), male(X). The Horn clause consists of: A head or consequent term H, and A body consisting of terms Bi H  B0 , B1 , …, Bn The semantics is: « If B0 , B1 , …, and Bn, then H » C. Varela

Clausal Form to Prolog (student(A)  dorm_resident(A))  (student(A)  takes(A,B)  class(B)) Use commutativity of  to move negated terms to the right of each clause. Use P1  P2  P2  P1  P1  P2 (student(A)  dorm_resident(A))  (student(A)  (takes(A,B)  class(B))) Move Horn clauses to Prolog: student(A) :- dorm_resident(A). student(A) :- takes(A,B),class(B). C. Varela

Skolemization X [takes(X,cs101)  class_year(X,2)] introduce a Skolem constant to get rid of existential quantifier (): takes(x,cs101)  class_year(x,2) X [dorm_resident(X)  A [campus_address_of(X,A)]] introduce a Skolem function to get rid of existential quantifier (): campus_address_of(X,f(X)] C. Varela

Limitations If more than one non-negated (positive) term in a clause, then it cannot be moved to a Horn clause (which restricts clauses to only one head term). If zero non-negated (positive) terms, the same problem arises (Prolog’s inability to prove logical negations). For example: « every living thing is an animal or a plant » animal(X)  plant(X)  living(X) animal(X)  plant(X)  living(X) C. Varela

Exercises What is the logical meaning of the second Skolemization example if we do not introduce a Skolem function? Convert the following predicates into Conjunctive Normal Form, and if possible, into Horn clauses: C [rainy(C)  cold(C)  snowy(C)] C [snowy(C)] C [snowy(C)] PLP Exercise 11.5 (pg 571). PLP Exercise 11.6 (pg 571). C. Varela