cs345-2

cs345-2 - 1 Semantics of Datalog With Negation Local...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Semantics of Datalog With Negation Local Stratification Stable Models Well-Founded Models 2 The Story So Far --- 1 ¡ When there is no (IDB) negation, there is a unique minimal model (least fixedpoint), which is the accepted meaning of the Datalog program. ¡ With negation, we often have several minimal models, and we need to decide which one is meant by the program. 3 The Story So Far --- 2 ¡ When the program is stratified, one minimal model is the stratified model. ¢ This model appears in all cases to be the one we intuitively want. ¢ Important technical point: if the program actually has no negation, then the stratified model is the unique minimal model. ¢ Thus, stratified semantics extends least-fixedpoint semantics. 4 What About Unstratified Datalog? ¡ There are some more general conditions under which an “accepted” choice among models exists. ¡ From least to most general: Locally stratified models, modularly stratified models, stable/well-founded models. 5 Why Should We Care? 1. Solidify our understanding of when declarative assertions, like logical rules, lead to a meaningful description of something. 2. SQL recursion really deals with ambiguities of the same kind, especially regarding aggregations, as well as negation. 6 Ground Atoms ¡ All these approaches start by instantiating the rules: replace variables by constants in all possible ways, and throw away instances of the rules with a known false EDB subgoal. ¡ An atom with no variables is a ground atom. ¢ Like propositions in propositional calculus. 7 Example: Ground Atoms ¡ Consider the Win program: win(X) :-move(X,Y) & NOT win(Y) with the following moves: 1 3 2 win(1) :-move(1,2) & NOT win(2) win(1) :-move(1,3) & NOT win(3) win(2) :-move(2,3) & NOT win(3) 8 Example --- Continued win(1) :-move(1,2) & NOT win(2) win(1) :-move(1,3) & NOT win(3) win(2) :-move(2,3) & NOT win(3) ¡ Other instantiations of the rule have a false move subgoal and therefore cannot infer anything. ¡ win(1), win(2), and win(3) are the only relevant IDB ground atoms for this game. 9 Locally Stratified Models 1. Build dependency graph with: ¡ Nodes = relevant IDB ground atoms. ¡ Arc p -> q iff q appears in an instantiated body with head p. ¡ Label – on arc if q is negated. 2. Stratum of each node defined as before. 3. Locally stratified = finite strata only. 10 Example win(1) :-move(1,2) & NOT win(2) win(1) :-move(1,3) & NOT win(3) win(2) :-move(2,3) & NOT win(3) win(1) win(2) win(3)------Stratum 2 Stratum 1 Stratum 0 11 Locally Stratified Model Include all EDB ground atoms; FOR (stratum i = 0, 1, …) DO WHILE (changes occur) DO IF (some rule for some p at stratum i has a true body) THEN add p to model; 12 Example win(1) win(2) win(3)------win(1) :-move(1,2) & NOT win(2) win(1) :-move(1,3) & NOT win(3) win(2) :-move(2,3) & NOT win(3) 1. No rules for win(3); therefore false....
View Full Document

This document was uploaded on 01/06/2012.

Page1 / 55

cs345-2 - 1 Semantics of Datalog With Negation Local...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online