Web Science & Technologies University of Koblenz ▪ Landau, Germany Advanced Data Modeling Minimal Models Steffen Staab TexPoint fonts used in EMF. Read.

Slides:



Advertisements
Similar presentations
Information Systems & Semantic Web University of Koblenz Landau, Germany Advanced Data Modeling Relational Data Model continued Steffen Staab with Simon.
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Lecture 11: Datalog Tuesday, February 6, Outline Datalog syntax Examples Semantics: –Minimal model –Least fixpoint –They are equivalent Naive evaluation.
First Order Logic Resolution
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
11 November 2005 Foundations of Logic and Constraint Programming 1 Negation: Declarative Interpretation ­An overview First Order Formulas and Logical Truth.
Exam #3 is Friday. It will consist of proofs, plus symbolizations in predicate logic.
CS240A: Databases and Knowledge Bases Fixpoint Semantics of Datalog Carlo Zaniolo Department of Computer Science University of California, Los Angeles.
1 Lecture 5 Topics –Closure Properties for REC Proofs –2 examples Applications.
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.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
Binary Decision Diagrams for First Order Predicate Logic By: Jan Friso Groote Afsaneh Shirazi.
Herbrand Models Logic Lecture 2. Example: Models  X(  Y((mother(X)  child_of(Y,X))  loves(X,Y))) mother(mary) child_of(tom,mary)
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
1st-order Predicate Logic (FOL)
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Web Science & Technologies University of Koblenz ▪ Landau, Germany Stable Models See Bry et al 2007.
Steffen Staab Advanced Data Modeling 1 of 32 WeST Häufungspunkte Bifurkation: x n+1 = r x n (1-x n ) Startwert x 0 = 0,25.
First Order Predicate Logic
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.
CSE 544 Relational Calculus Lecture #2 January 11 th, Dan Suciu , Winter 2011.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Bertram Ludäscher Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Mathematical Preliminaries
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
KR A Principled Framework for Modular Web Rule Bases and its Semantics Anastasia Analyti Institute of Computer Science, FORTH-ICS, Greece Grigoris.
No new reading for Wednesday. Keep working on chapter 5, section 3. Exam #3 is next Monday.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Relational Data Model.
LDK R Logics for Data and Knowledge Representation ClassL (part 2): Reasoning with a TBox 1.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models of Definite Programs.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
Syntax of First-Order Predicate Calculus (FOPC): 1. Alphabet Countable set of predicate symbols, each with specified arity  0. Countable set of function.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk.
Extensions of Datalog Wednesday, February 13, 2001.
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk TexPoint fonts used in.
Models of Definite Programs
Introduction to Logic for Artificial Intelligence Lecture 2
Logics for Data and Knowledge Representation
Formal Modeling Concepts
Completeness of the SLD-Resolution
Chapter 7: Beyond Definite Knowledge
Logics for Data and Knowledge Representation
Logic: Top-down proof procedure and Datalog
Models of Definite Programs
Computer Security: Art and Science, 2nd Edition
Models of Definite Programs
Advanced Data Modeling Minimal Models
Logics for Data and Knowledge Representation
Presentation transcript:

Web Science & Technologies University of Koblenz ▪ Landau, Germany Advanced Data Modeling Minimal Models Steffen Staab TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AAA

Steffen Staab Advanced Data Modeling 2 of 37 WeST Overview  Logic as query language.  Grounding.  Minimal Herbrand models.  Completion.

Steffen Staab Advanced Data Modeling 3 of 37 WeST Logic as query language Given:  first-order formula A[x 1, …, x n ]  Herbrand interpretation I  This first-order formula can be considered as a definition of a relation R A on T n § as follows:  (t 1, …, t n ) 2 R A := I ² A[t 1, …, t n ]

Steffen Staab Advanced Data Modeling 4 of 37 WeST Clauses as definitions We say that a clause p(t 1, …, t m ) :- L 1, …, L n defines the relation symbol p. Let C be a set of clauses and p be a relation symbol. We call the definition of p in C the set of all clauses in C that define p.

Steffen Staab Advanced Data Modeling 5 of 37 WeST Principles of semantics A deductive database is a set of clauses. This set of clauses is regarded as a collection of definitions of relations. The semantics defines the meaning of this definitions by associating with them an interpretation, or a class of interpretations. Query answering is based on the semantics.

Steffen Staab Advanced Data Modeling 6 of 37 WeST Two key assumptions  the unique name assumption: each name denotes a unique object.  the closed world assumption:  a negative statement : A holds if the corresponding positive one A does not hold. Both assumptions are not supported by (Tarskian) models for first-order logics (why not?)  One solution: minimal models

Steffen Staab Advanced Data Modeling 7 of 37 WeST Minimal Herbrand Models Let I be a Herbrand model of a set of formulas S. We call I a minimal Herbrand model of S if it is minimal w.r.t. the subset relation, i.e. for every Herbrand model I´of S of the same signature we have I´ ¶ I. I is called the least Herbrand model of S if for every Herbrand model I´ of S of the same signature we have I µ I´.

Steffen Staab Advanced Data Modeling 8 of 37 WeST Does every set of formulas S have a least Herbrand model?

Steffen Staab Advanced Data Modeling 9 of 37 WeST Does every set of formulas S have a least Herbrand model? Counterexample for normal clauses: person(a). man(X) :- person(X), not woman(X). woman(X) :- person(X), not man(X).

Steffen Staab Advanced Data Modeling 10 of 37 WeST Does every set of formulas S have a least Herbrand model? What about definite clauses?

Steffen Staab Advanced Data Modeling 11 of 37 WeST Instance and variant Let E, E´ be a pair of terms or formulas. E´ is an instance of E, denoted E > E´, if there exists a substitution µ such that E µ = E´. ground instance: instance that is ground, E´ is a variant of E if E´ is an instance of E and E is an instance of E´.

Steffen Staab Advanced Data Modeling 12 of 37 WeST Examples  P(x,a) is instance of P(x,y) because of P(x,y)[y|a]  P(b,a) is a ground instance  P(x,y) and P(u,v) are variants of each other, because of  [x|u, y|v] and  [u|x, v|y]

Steffen Staab Advanced Data Modeling 13 of 37 WeST Grounding  Let C be a set of clauses and § be any signature containing all symbols used in C. The grounding of C w.r.t. §, denoted C * is the set of all ground instances of the signature § of clauses in C.  Lemma. Let I be a Herbrand interpretation and C be a set of clauses. Then I ² C if and only if I ² C *.

Steffen Staab Advanced Data Modeling 14 of 37 WeST General proof scheme First order formula (all possible ways of) grounding Propositional formula Propositional Consequences First order Consequences lifting calculus

Steffen Staab Advanced Data Modeling 15 of 37 WeST  Proof

Steffen Staab Advanced Data Modeling 16 of 37 WeST Logic with equality  Additional atomic formulas s = t, where s, t are terms.  Abbreviation: x  y := : (x = y).  Unlike other relations, the semantics of s = t is predefined in all Herbrand interpretations: I ² s = t if s coincides with t.

Steffen Staab Advanced Data Modeling 17 of 37 WeST Example valid formulas  f(x 1, …, x n ) = f(y 1, … y n ) ! x 1 = y 1 Æ … Æ x n = y n  f(x 1, …, x n )  g(y 1, …, y n )  f(x 1, …,x n )  c  d  c  A[t] $ 8 x(x = t ! A[x])

Steffen Staab Advanced Data Modeling 18 of 37 WeST Semantics of definitions Consider a definition of a relation r What is the meaning of this definition? Is there a largest Herbrand model? Especially in the light of negation as failure?

Steffen Staab Advanced Data Modeling 19 of 37 WeST Idea of completion man(hans). man(adam). person(eva). woman(X) :- person(X), not man(X). Is eva a woman? She might be a man and we just don‘t know! Minimal model says that she is not a woman! Trick: Completion: man(X) $ (X=hans Ç X=adam). woman(X) $ X=eva. I.e. hans and adam are the only men.

Steffen Staab Advanced Data Modeling 20 of 37 WeST Idea of Completion man(hans). man(X) :- lovesBeer(X,Y). Completion: man(X) $ X=hans Ç ( 9 Y: X=U Æ lovesBeer(U,Y)) A man is a man only if he is hans or if he loves some brand of beer.

Steffen Staab Advanced Data Modeling 21 of 37 WeST Completion. Step 1. Replace every clause by an equivalent one such that the arguments of r are x 1, …, x n : Given: r(t 1, …, t n ) :- G Replace by: r(x 1, …, x n ) :- x 1 = t 1 Æ … Æ x n = t n Æ G

Steffen Staab Advanced Data Modeling 22 of 37 WeST Completion. Step 2. If there are variables y 1, …, y k occurring in a body but not in the head, apply 9 to these variables, i.e., Given r(x 1, …, x n ) :- G Modify to r(x 1, …, x n ) :- 9 y 1 … 9 y k G

Steffen Staab Advanced Data Modeling 23 of 37 WeST Completion. Step 3. If there are several definitions, replace them by one Given r(x 1, …,x n ) :- G 1 … r(x 1, …, x n ) :- G m Replace by r(x 1, …, x n ) :- G 1 Ç … Ç G m

Steffen Staab Advanced Data Modeling 24 of 37 WeST Completion. Step 4. Replace :- by $ : Given r(x 1, …, x n ) :- G 1 Ç … Ç G m Replace by r(x 1, …, x n ) $ G 1 Ç … Ç G m The formula r(x 1, …, x n ) $ G 1 Ç … Ç G m is called the completed definition of the original set of clauses.

Steffen Staab Advanced Data Modeling 25 of 37 WeST Example r(u,v):-p(u,1,z). r(v,u):-p(2,u,z). r(x,y) :- x=u Æ y=v Æ p(u,1,z). r(x,y) :- x=v Æ y=u Æ p(2,v,z). r(x,y) :- 9 z,u,v x=u Æ y=v Æ p(u,1,z). r(x,y) :- 9 z,u,v x=u Æ y=v Æ p(2,v,z). r(x,y) $ ( 9 z,u,v x=u Æ y=v Æ p(u,1,z)) Ç ( 9 z,u,v x=u Æ y=v Æ p(2,v,z))

Steffen Staab Advanced Data Modeling 26 of 37 WeST Properties  All steps preserve Herbrand models, except for the last one.  Why?  Gives a unique semantics to non-recursive definitions  What about recursive definitions?  Logic programming semantics and first-order semantics coincide for definite programs

Steffen Staab Advanced Data Modeling 27 of 37 WeST Recursive definitions odd(1). even(f(X)) :- odd(X). odd(f(X)) :- even(X). Completion: odd(X) $ X=1 Ç (X=f(Y) Æ even(Y)). even(X) $ X=f(Y) Æ odd(Y).

Steffen Staab Advanced Data Modeling 28 of 37 WeST Recursive definitions person(adam). person(eva). woman(X) :- person(X), not man(X). man(X) :- person(X), not woman(X). Completion: woman(X) $ (Y=X Æ person(Y) Æ not man(Y)). man(X) $ (Y=X Æ person(Y) Æ not woman(Y)). Semantics not unique in logic programming: Models are I={woman(adam),woman(eva)} I={man(adam),man(eva)} I={woman(adam),man(eva)} I={man(adam),woman(eva)} What is the semantics in first order logics?

Steffen Staab Advanced Data Modeling 29 of 37 WeST Recursive definitions person(adam). person(eva). woman(X) :- person(X), not man(X). man(X) :- person(X), not woman(X). Completion: woman(X) $ (Y=X Æ person(Y) Æ not man(Y)). man(X) $ (Y=X Æ person(Y) Æ not woman(Y)). Semantics not unique in logic programming: Models are (add {person(adam),person(eva)} to each) I={woman(adam),woman(eva)} I={man(adam),man(eva)} I={woman(adam),man(eva)} I={man(adam),woman(eva)} What is the semantics in first order logics? Models are: woman I ={}=man I

Steffen Staab Advanced Data Modeling 30 of 37 WeST Simple characterization of completion Let C be a definition of r, I be a Herbrand model of the corresponding completed definition, and r(t 1, …, t n ) be a ground atom. Then I ² r(t 1, …, t n ), 9 (r(t 1, …, t n ) :- L 1, …, L m ) 2 C * (I ² L 1 Æ … Æ L n ):

Steffen Staab Advanced Data Modeling 31 of 37 WeST Immediate consequence operator T C (I) := { A | there exists (A :- G) 2 C * such that I ² G } Fixpoint: an interpretation such that T C (I) = I.

Steffen Staab Advanced Data Modeling 32 of 37 WeST Definite clauses have the least model Let C be a set of definite clauses. Define I 0 := {} I n+1 := T C (I n ), for all n ¸ 0, I ! := [ ! i=0 I i Then I ! is the least fixpoint of T C and also the least Herbrand model of C.

Steffen Staab Advanced Data Modeling 33 of 37 WeST Non-recursive databases Let C be a non-recursive database and K be an arbitrary interpretation. Define I 0 := K I n+1 := T C (I n ), for all n ¸ 0, I ! := [ ! i=0 I i Then I ! is the only fixpoint of T C. Moreover, for some n we have I ! = I n.

Steffen Staab Advanced Data Modeling 34 of 37 WeST Non-recursive sets of clauses  Let C be a set of clauses.  Its dependency graph consists of pairs p ! r such that p occurs in the body of a clause which defines r in C.  A set of clauses is non-recursive if the dependency graph contains no cycles.

Steffen Staab Advanced Data Modeling 35 of 37 WeST Non-recursive sets of clauses Let C be a set of clauses. Its dependency graph consists of pairs p ! r such that p occurs in the body of a clause which defines r in C. A set of clauses is non-recursive if the dependency graph contains no cycles. Person(a). Woman(X) :- Person(X), Not Man(X). Man(X) :- Person(X), Not Woman(X). WomanMan Person

Steffen Staab Advanced Data Modeling 36 of 37 WeST Non-recursive sets of clauses Dependency graph of C consists of pairs p ! r such that p occurs in the body of a clause which defines r in C. C is non-recursive if the dependency graph contains no cycles. A relation p depends on a relation q in C if there exists a path of length ¸ 1 from q to p in the dependency graph of C. A set of clauses is non-recursive if and only if no relation depends on itself.