Simply Logical – Chapter 2© Peter Flach, 2000 Clausal logic Propositional clausal logic Propositional clausal logic expressions that can be true or false.

Slides:



Advertisements
Similar presentations
Mathematical Preliminaries
Advertisements

Applications Computational LogicLecture 11 Michael Genesereth Spring 2004.
1 Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms Inference in propositional.
First-Order Logic Chapter 8.
Inference in First-Order Logic
Artificial Intelligence 8. The Resolution Method
Logic databases 1. 2 Overview motivation and informal introduction of deductive databases components of deductive databases domains and axioms queries.
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Knowledge Representation using First-Order Logic CS 271: Fall 2007 Instructor: Padhraic Smyth.
First-Order Logic.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 5.
MAT 205 F08 Chapter 12 Complex Numbers.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
1 Decision Procedures An algorithmic point of view Equality Logic and Uninterpreted Functions.
1 Logic Programming Technical Foundation Second part of Cmput325 Fall 2004 R Greiner + B Price.
Simply Logical – Chapter 3© Peter Flach, 2000 :-teaches(peter,ai_techniques) :-teaches(peter,expert_systems) :-teaches(peter,computer_science) ?-student_of(S,peter)
Query Answering for OWL-DL with Rules Boris Motik Ulrike Sattler Rudi Studer.
Note to the teacher: Was 28. A. to B. you C. said D. on Note to the teacher: Make this slide correct answer be C and sound to be “said”. to said you on.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
12 System of Linear Equations Case Study
Mathematics1 Mathematics 1 Applied Informatics Štefan BEREŽNÝ.
PSSA Preparation.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
The Pumping Lemma for CFL’s
SAT Solver CS 680 Formal Methods Jeremy Johnson. 2 Disjunctive Normal Form  A Boolean expression is a Boolean function  Any Boolean function can be.
SLD-resolution Introduction Most general unifiers SLD-resolution
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
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),
Standard Logical Equivalences
Resolution.
Automated Reasoning Systems For first order Predicate Logic.
First Order Logic Resolution
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.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
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.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Inference and Resolution for Problem Solving
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Chapter 3 Propositional Logic
Predicate Calculus.
FIRST ORDER LOGIC Levent Tolga EREN.
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.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
Propositional calculus
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
Automated Reasoning Systems For first order Predicate Logic.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
1-1 An Introduction to Logical Programming Sept
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
Resolution Theorem Proving in Predicate Calculus Lecture No 10 By Zahid Anwar.
6/11/2016 Linear Resolution and Introduction to First Order Logic Michael Leuschel Softwaretechnik und Programmiersprachen Lecture 5.
Knowledge Based Systems
Completeness of the SLD-Resolution
Resolution in the Propositional Calculus
Propositional Logic Resolution
Propositional Resolution
Soundness of SLD-Resolution
Horn Clauses and Unification
Herbrand Semantics Computational Logic Lecture 15
Presentation transcript:

Simply Logical – Chapter 2© Peter Flach, 2000 Clausal logic Propositional clausal logic Propositional clausal logic expressions that can be true or false expressions that can be true or false Relational clausal logic Relational clausal logic constants and variables refer to objects constants and variables refer to objects Full clausal logic Full clausal logic functors aggregate objects functors aggregate objects Definite clause logic = pure Prolog Definite clause logic = pure Prolog no disjunctive heads no disjunctive heads

Simply Logical – Chapter 2© Peter Flach, 2000 Propositional clausal logic: syntax married;bachelor:-man,adult. Somebody is married or a bachelor if he is a man and an adult.clause married bachelor man adult atoms head = positive literals body = negative literals p.18

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.1 Persons are happy or sad Persons are happy or sad happy;sad:-person. No person is both happy and sad No person is both happy and sad :-person,happy,sad. Sad persons are not happy Sad persons are not happy :-person,sad,happy. Non-happy persons are sad Non-happy persons are sad sad;happy:-person. p.18

Simply Logical – Chapter 2© Peter Flach, 2000 Propositional clausal logic: semantics Herbrand base: set of atoms Herbrand base: set of atoms{married,bachelor,man,adult} Herbrand interpretation: set of true atoms Herbrand interpretation: set of true atoms {married,man,adult} A clause is false in an interpretation if all body-literals are true and all head-literals are false… A clause is false in an interpretation if all body-literals are true and all head-literals are false… bachelor:-man,adult. …and true otherwise: the interpretation is a model of the clause. …and true otherwise: the interpretation is a model of the clause. :-married,bachelor. p.19

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.2 A clause C is a logical consequence of a program (set of clauses) P iff every model of P is a model of C. A clause C is a logical consequence of a program (set of clauses) P iff every model of P is a model of C. Let P be Let P be married;bachelor:-man,adult. man. :-bachelor. married:-adult is a logical consequence of P; married:-adult is a logical consequence of P; married:-bachelor is a logical consequence of P; married:-bachelor is a logical consequence of P; bachelor:-man is not a logical consequence of P; bachelor:-man is not a logical consequence of P; bachelor:-bachelor is a logical consequence of P. bachelor:-bachelor is a logical consequence of P. p.20

Simply Logical – Chapter 2© Peter Flach, 2000 Propositional resolution square:-rectangle,equal_sidesrectangle:-parallelogram,right_angles has_wife:-man,marriedmarried;bachelor:-man,adult p.22 has_wife;bachelor:-man,adult square:-parallelogram,right_angles,equal_sides

Simply Logical – Chapter 2© Peter Flach, 2000 Propositional clausal logic: meta-theory Propositional resolution is Propositional resolution is sound: it derives only logical consequences. sound: it derives only logical consequences. incomplete: it cannot derive arbitrary tautologies like a:-a… incomplete: it cannot derive arbitrary tautologies like a:-a… …but refutation-complete: it derives the empty clause from any inconsistent set of clauses. …but refutation-complete: it derives the empty clause from any inconsistent set of clauses. Proof by refutation: add the negation of the assumed logical consequence to the program, and prove inconsistency by deriving the empty clause. Proof by refutation: add the negation of the assumed logical consequence to the program, and prove inconsistency by deriving the empty clause. p.23

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.4 teacher;wise teacher:-wise happy;friendly:-teacherfriendly:-teacher,happy friendly:-teacher teacher friendly p.23

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.5 friendly:-happyhappy:-has_friends p.24 :-friendlyfriendly:-happy happy:-has_friends has_friends :-happy :-has_friends [] friendly:-has_friends Direct proof: Proof by refutation: ÿ(friendly:-has_friends) ÿ(friendly ÿhas_friends) (ÿfriendly) (has_friends) :-friendly and has_friends

Simply Logical – Chapter 2© Peter Flach, 2000 Relational clausal logic: syntax likes(peter,S):-student_of(S,peter). Peter likes anybody who is his student. clause atoms constantvariable terms p.25

Simply Logical – Chapter 2© Peter Flach, 2000Substitutions A substitution maps variables to terms: A substitution maps variables to terms: {S->maria} A substitution can be applied to a clause: A substitution can be applied to a clause: likes(peter,maria):-student_of(maria,peter). The resulting clause is said to be an instance of the original clause, and a ground instance if it does not contain variables. The resulting clause is said to be an instance of the original clause, and a ground instance if it does not contain variables. Each instance of a clause is among its logical consequences. Each instance of a clause is among its logical consequences. p.26

Simply Logical – Chapter 2© Peter Flach, 2000 Relational clausal logic: semantics Herbrand universe: set of ground terms (i.e. constants) Herbrand universe: set of ground terms (i.e. constants){peter,maria} Herbrand base: set of ground atoms Herbrand base: set of ground atoms {likes(peter,peter),likes(peter,maria),likes(maria,peter), likes(maria,maria),student_of(peter,peter),student_of(peter,maria), student_of(maria,peter),student_of(maria,maria)} Herbrand interpretation: set of true ground atoms Herbrand interpretation: set of true ground atoms {likes(peter,maria),student_of(maria,peter)} An interpretation is a model for a clause if it makes all of its ground instances true An interpretation is a model for a clause if it makes all of its ground instances true likes(peter,maria):-student_of(maria,peter). likes(peter,peter):-student_of(peter,peter). p.26

Simply Logical – Chapter 2© Peter Flach, 2000 Relational resolution :-likes(peter,N)likes(peter,S):-student_of(S,peter) student_of(S,T):-follows(S,C),teaches(T,C) follows(maria,ai_techniques) teaches(peter,ai_techniques) :-student_of(N,peter) :-follows(N,C),teaches(peter,C) :-teaches(peter,ai_techniques) [] {S->N} {S->N,T->peter} {N->maria,C->ai_techniques} p.29

Simply Logical – Chapter 2© Peter Flach, 2000 Full clausal logic: syntax loves(X,person_loved_by(X)). Everybody loves somebody. termfunctor complex term loves(peter,person_loved_by(peter)). loves(anna,person_loved_by(anna)). loves(paul,person_loved_by(paul)). … p.30

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.9 Every mouse has a tail Every mouse has a tail tail_of(tail(X),X):-mouse(X). Somebody loves everybody Somebody loves everybody loves(person_who_loves_everybody,X). Every two numbers have a maximum Every two numbers have a maximum maximum_of(X,Y,max(X,Y)):-number(X),number(Y). p.31

Simply Logical – Chapter 2© Peter Flach, 2000 Full clausal logic: semantics Herbrand universe: set of ground terms Herbrand universe: set of ground terms{0,s(0),s(s(0)),s(s(s(0))),…} Herbrand base: set of ground atoms Herbrand base: set of ground atoms {plus(0,0,0), plus(s(0),0,0), …, plus(0,s(0),0), plus(s(0),s(0),0), …, …, plus(s(0),s(s(0)),s(s(s(0)))), …} Herbrand interpretation: set of true ground atoms Herbrand interpretation: set of true ground atoms {plus(0,0,0), plus(s(0),0,s(0)), plus(0,s(0),s(0))} Some programs have only infinite models Some programs have only infinite modelsplus(0,X,X). plus(s(X),Y,s(Z)):-plus(X,Y,Z). p.31-3

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.11 plus(X,Y,s(Y)) and plus(s(V),W,s(s(V))) unify to plus(s(V),s(V),s(s(V))) plus(X,Y,s(Y)) and plus(s(V),W,s(s(V))) unify to plus(s(V),s(V),s(s(V))) length([X|Y],s(0)) and length([V],V) unify to length([s(0)],s(0)) length([X|Y],s(0)) and length([V],V) unify to length([s(0)],s(0)) larger(s(s(X),X) and larger(V,s(V)) do not unify (occur check!) larger(s(s(X),X) and larger(V,s(V)) do not unify (occur check!) p.35

Simply Logical – Chapter 2© Peter Flach, 2000Summary Propositional Relational Full clausal logic {a, b}{a, f(a), f(f(a)),…} (finite)(infinite) {a, b}{a, f(a), f(f(a)),…} (finite)(infinite) {p, q}{p(a,a), p(b,a),…}{p(a,f(a)), p(f(a), f(f(a))),…} (finite)(infinite) p:-q.p(X,Z):-q(X,Y),p(Y,Z).p(X,f(X)):-q(X). {p}{p(a,a)}{p(a,f(a)), q(a)} {p, q}{p(a,a), p(b,a), q(b,a)}{p(f(a), f(f(a))), q(f(a))} …… (finite number of(infinite number of finite models) finite or infinite models) {p}{p(a,a)}{p(a,f(a)), q(a)} {p, q}{p(a,a), p(b,a), q(b,a)}{p(f(a), f(f(a))), q(f(a))} …… (finite number of(infinite number of finite models) finite or infinite models) soundsoundsound (if unifying with occur check) refutation-completerefutation-completerefutation-complete decidabledecidablesemi-decidable Herbrand universe Herbrand base clause Herbrand models Meta- theory

Simply Logical – Chapter 2© Peter Flach, 2000 Exercise 2.12 man(peter) adult(peter)married(peter);bachelor(peter):-adult(peter) married(peter);bachelor(peter) married(X);bachelor(X):-man(X),adult(X):-married(maria) :-bachelor(maria)bachelor(maria):-man(maria),adult(maria) :-man(maria),adult(maria) married(X);bachelor(X):-man(X),adult(X)man(paul) :-bachelor(paul)married(paul);bachelor(paul):-adult(paul) married(paul):-adult(paul) married(X);bachelor(X):-man(X),adult(X) married(X);bachelor(X):-man(X),adult(X) p.36

Simply Logical – Chapter 2© Peter Flach, 2000 From indefinite to general clauses am,m,b am,m m,b am,b m m am b b am,m,b am,b m,b am,m b b am m m married;bachelor:-adult_man. adult_man. married:-adult_man,not bachelor.bachelor:-adult_man,not married. p.37

Simply Logical – Chapter 2© Peter Flach, 2000 From first-order logic to clausal logic Everyone has a mother, but not every woman has a child. Everyone has a mother, but not every woman has a child. Y X:mother_of(X,Y) Z W:woman(Z) mother_of(Z,W) Y X:mother_of(X,Y) Z W:woman(Z) mother_of(Z,W) push negation inside push negation inside Y X:mother_of(X,Y) Z W:woman(Z) mother_of(Z,W) Y X:mother_of(X,Y) Z W:woman(Z) mother_of(Z,W) drop quantifiers (Skolemisation) drop quantifiers (Skolemisation) mother_of(mother(Y),Y) woman(childless_woman) mother_of(childless_woman,W) (convert to CNF and) rewrite as clauses (convert to CNF and) rewrite as clauses mother_of(mother(Y),Y). woman(childless_woman). :-mother_of(childless_woman,W). p.40-1