Logic Programming (PLP 11) Predicate Calculus Clocksin-Mellish Procedure Horn Clauses

Similar documents
Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure

An Early (1971) Conversation. Logic Programming (PLP 11.3) Horn Clauses Introduction to Prolog: Resolution, Unification.

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

Logic. Stephen G. Ware CSCI 4525 / 5525

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017


CSC Discrete Math I, Spring Propositional Logic

2.2: Logical Equivalence: The Laws of Logic

Advanced Topics in LP and FP

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

Compound Propositions

Introduction to Sets and Logic (MATH 1190)

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Logic: Propositional Logic (Part I)

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Propositional Logic Language

Part 1: Propositional Logic

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Logic: First Order Logic

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

α-formulas β-formulas

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

CSC165 Mathematical Expression and Reasoning for Computer Science

Inference in Propositional Logic

Propositional Logic: Models and Proofs

Logic and Proofs. (A brief summary)

Learning Goals of CS245 Logic and Computation

Propositional Logic: Review

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Language of Propositional Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Propositional natural deduction

AMTH140 Lecture 8. Symbolic Logic

CSC384: Intro to Artificial Intelligence Knowledge Representation II. Required Readings: 9.1, 9.2, and 9.5 Announcements:

1.1 Language and Logic

1.1 Language and Logic

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Part Two: The Basic Components of the SOFL Specification Language

ICS141: Discrete Mathematics for Computer Science I

A. Propositional Logic

Math 10850, fall 2017, University of Notre Dame

Introduction to Decision Sciences Lecture 2

Recall that the expression x > 3 is not a proposition. Why?

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Propositional Logic Part 1

Propositional Logic Resolution (6A) Young W. Lim 12/12/16


Propositional logic (revision) & semantic entailment. p. 1/34

Comp487/587 - Boolean Formulas

Tautologies, Contradictions, and Contingencies

Discrete Mathematics. Instructor: Sourav Chakraborty. Lecture 4: Propositional Logic and Predicate Lo

Propositional Logic Not Enough

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Discrete Mathematics and Its Applications

Mat 243 Exam 1 Review

Propositional Resolution Introduction

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Propositional Logic and Semantics

Predicate Calculus lecture 1

CS156: The Calculus of Computation

Logic and Resolution Representation and Reasoning

CS 730/730W/830: Intro AI

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

2-4: The Use of Quantifiers

It rains now. (true) The followings are not propositions.

CISC-102 Winter 2016 Lecture 17

Logic (3A) Young W. Lim 11/2/13

Predicate Calculus - Syntax

A statement is a sentence that is definitely either true or false but not both.

Chapter 4: Classical Propositional Semantics

Logic (3A) Young W. Lim 10/31/13

PROPOSITIONAL CALCULUS

Logic and Proofs. (A brief summary)

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

Tecniche di Verifica. Introduction to Propositional Logic

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

Logic Overview, I. and T T T T F F F T F F F F

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

COMP9414: Artificial Intelligence First-Order Logic

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

Propositional Equivalence

Chapter 2: Basic Notions of Predicate Logic

Inference Methods In Propositional Logic

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Part 1: Propositional Logic

Strong AI vs. Weak AI Automated Reasoning

THE LOGIC OF QUANTIFIED STATEMENTS

software design & management Gachon University Chulyun Kim

Logic (3A) Young W. Lim 10/29/13

Convert to clause form:

Supplementary exercises in propositional logic

2. Use quantifiers to express the associative law for multiplication of real numbers.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Transcription:

Logic Programming (PLP 11) Predicate Calculus Clocksin-Mellish Procedure Horn Clauses Carlos Varela Rennselaer Polytechnic Institute January 29, 2015 C. Varela 1

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 2

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 False F F T T T False True F T F T T True False F T F F F True True T T T T F C. Varela 3

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 4

First Order Predicate Calculus Adds variables, terms, and (first-order) quantification of variables. Predicate syntax: a ::= p(v 1, v 2,,v n ) predicate f ::= a atom v = p(v 1, v 2,,v n ) equality v 1 = v 2 f f f f f f f f f v.f universal quantifier v.f existential quantifier C. Varela 5

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 6

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 7

Structural Congruence Laws P 1 P 2 P 1 P 2 X [P(X)] X [ P(X)] X [P(X)] X [ P(X)] (P 1 P 2 ) P 1 P 2 (P 1 P 2 ) P 1 P 2 P P (P 1 P 2 ) (P 1 P 2 ) (P 2 P 1 ) P 1 (P 2 P 3 ) (P 1 P 2 ) (P 1 P 3 ) P 1 (P 2 P 3 ) (P 1 P 2 ) (P 1 P 3 ) P 1 P 2 P 2 P 1 C. Varela 8

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 9

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

Example A [ student(a) ( dorm_resident(a) B [takes(a,b) class(b)])] 1. Eliminate implication ( ) and equivalence ( ). A [student(a) ( dorm_resident(a) B [takes(a,b) class(b)])] 2. Move negation ( ) inwards to individual terms. A [student(a) ( dorm_resident(a) B [ (takes(a,b) class(b))])] A [student(a) ( dorm_resident(a) B [ takes(a,b) class(b)])] C. Varela 11

Example Continued A [student(a) ( dorm_resident(a) B [ takes(a,b) class(b)])] 3. Skolemization: eliminate existential quantifiers ( ). 4. 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))) 5. 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 12

Clausal Form to Prolog (student(a) dorm_resident(a)) (student(a) takes(a,b) class(b)) 6. Use commutativity of to move negated terms to the right of each clause. 7. Use P 1 P 2 P 2 P 1 P 1 P 2 (student(a) dorm_resident(a)) (student(a) ( takes(a,b) class(b))) 8. Move Horn clauses to Prolog: student(a) :- dorm_resident(a). student(a) :- takes(a,b),class(b). C. Varela 13

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 ( ): X [ dorm_resident(x) campus_address_of(x,f(x)] C. Varela 14

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 15

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