Download presentation
Presentation is loading. Please wait.
Published byJack Riley Modified over 9 years ago
1
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 1 of 32 WeST Häufungspunkte Bifurkation: x n+1 = r x n (1-x n ) Startwert x 0 = 0,25
2
Web Science & Technologies University of Koblenz ▪ Landau, Germany Implementing DLV
3
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 3 of 32 WeST DLV System Architecture
4
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 4 of 32 WeST RULE HANDLING AND INTELLIGENT GROUNDING
5
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 5 of 32 WeST Intelligent Grounding Ground Programm has exactly the same answer sets as the original programme For some syntactically restricted classes of programs (e.g. stratified programs), the “Intelligent Grounding” module already computes the corresponding answer sets. We assume “safe programmes”, i.e. no variables in the head that are not bound by positive literals in the body. We assume function-free programmes here. Thomas Eiter, Nicola Leone, Cristinel Mateis, Gerald Pfeifer, Franceseo Scarcello. A Deductive System for Non-Monotonic Reasoning. In: Logic Programming And Nonmonotonic Reasoning. Lecture Notes in Computer Science, 1997, Volume 1265/1997, 363-374, Springer.A Deductive System for Non-Monotonic ReasoningLogic Programming And Nonmonotonic Reasoning
6
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 6 of 32 WeST Rules and Graphs Handler Motivation: Overall problem of EDLP is co-NP hard, BUT many of its parts are much easier (e.g. stratified programms are polynomially computable)
7
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 7 of 32 WeST Ground Dependency Graph (GG ) Nodes: atoms Edges: E +, E -, E Ground Programme: p(2,3) :- t(2) :- q(1) q(3) :- p(2,3), NOT t(2). t(3) :- q(3), p(2,3).
8
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 8 of 32 WeST Ground Collapsed Positive Dependency Graph (GG + ) Strongly connected components form modules and become one node (not in the example here)
9
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 9 of 32 WeST Non-Ground Collapsed Positive Dependency Graph (G + P )
10
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 10 of 32 WeST Summarizing Steps for Analyzing Rules Given programme P, it computes G + P for the intelligent grounding module (IGM) Given from IGM it computes GG From and GG it sets apart the modules, syntactical properties (e.g. stratification) for the Model Generator It computes GG + for Model Checker to reduce search space For each component of GG + it analyzes syntactical properties (e.g. headcycle-freeness) for use by Model Checker
11
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 11 of 32 WeST Grounding Init NF = EDBP % Grounded facts initially= DB extension = % Grow grounded program from G + P % Analyze the collapsed ng rule graph Key steps of procedure: 1.Grow rule grounding from node C in G + P without incoming edges (i.e. non-recursive) 2.Grow rule grounding using positive literals (and remove them from the grounded rules!)
12
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 12 of 32 WeST
13
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 13 of 32 WeST
14
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 14 of 32 WeST Example Programme Programme P p(1,2) p(2,3) :- t(X) :- a(X). q(X) q(Z) :- p(X,Y), p(Y,Z), NOT t(Y). t(X) :- q(X), p(Y,X) a(2) :- Grounded Programme p(1,2) p(2,3) :- t(2) :- q(1) q(3) :- p(1,2), p(2,3), NOT t(2). t(3) :- q(3), p(2,3) a(2) :- Note: ground(P) contains 40 rule instances, but Instantiate generates only 4.
15
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 15 of 32 WeST Theorem Let P be a safe disjunctive datalog program, and be the ground program generated by Instantiat(P). Then, P and have the same stable models.
16
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 16 of 32 WeST Summary Grounding is a bit like forward chaining (applying immediate consequence operator). However, because of disjunction in the heads it is overgenerating and it is also not retracting implications that fail because of negation.
17
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 17 of 32 WeST MODEL GENERATOR
18
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 18 of 32 WeST Model Generator 1.Derive what is definitely derivable, 2.Make ‘educated’ guess for one of those literals which have not been decided yet. 3.IF further guesses can be made THEN GOTO 2 ELSE Call MODEL-CHECKER If candidate model is inconsistent or not stable then backtrack, taking knowledge about previous guesses into account to avoid redundancies Nicola Leone, Pasquale Rullo, Francesco Scarcello. Disjunctive Stable Models: Unfounded Sets, Fixpoint Semantics, and Computation. In: Information and Computation, 135(2): 69-112, 1997.Disjunctive Stable Models: Unfounded Sets, Fixpoint Semantics, and Computation
19
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 19 of 32 WeST Note The number of candidate models can be exponential Smart generation of candidate models is crucial Prune the search space! Special algorithms for: Polynomial-time algorithm for normal stratified programs Special algorithm for headcycle-free disjunctive programs General algorithm
20
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 20 of 32 WeST Unfounded Sets Intuitively An unfounded set for a disjunctive program P w.r.t. an interpretation I is a set of positive literals that cannot be derived from P assuming the facts in I. [generalization of a technique from well-founded semantics!]
21
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 21 of 32 WeST Unfounded Sets Formally: Let I be an interpretation for a program P. A set X of ground atoms is an unfounded set for P w.r.t. I if, for each a ∈ X, for each rule r ∈ ground(P) such that a ∈ H(r), at least one of the following conditions holds: 1.B(r) ∩ . I ≠ , that is, the body of r is false w.r.t. I 2.B + (r) ∩ X ≠ , that is, some positive body literal belongs to X 3.(H(r)-X) ∩ I ≠ , that is, an atom in the head of r, distinct from a and other elements in X, is true w.r.t. I [generalization of a technique from well-founded semantics!]
22
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 22 of 32 WeST Unfounded Sets: Example Program P: a b :- I = {b} Then {a} is an unfounded set of P wrt I (criterion 3 applies) Intuitively: there is no reason to believe that a is true given I
23
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 23 of 32 WeST Unfounded Sets: Example Program P: a b :- I = {a,b} Then both {a} and {b} are unfounded sets of P wrt I (i.e. we should not believe both!) However, {a,b} is not an unfounded set!
24
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 24 of 32 WeST Unfounded Sets: Example Program P: a b :- a :- b. b :- a. I = {a,b} Then is the only unfounded set of P wrt I
25
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 25 of 32 WeST Definition & Proposition Definition Let I be an interpretation for a program P. I is unfounded-free if I ∩ X = for each unfounded set X for P w.r.t. I. Proposition: Let I be an unfounded-free interpretation for a program P. Then P has the greatest unfounded set GUS P (I) GUS P (I) is computable in polynomial time
26
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 26 of 32 WeST Monotonic Operator W P Plan: Compute W P ( ) Either this is a unique stable model Otherwise move from W P ( ) towards the stable models
27
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 27 of 32 WeST Immediate Consequence Operator T P Definition: T P (I) = {a ∈ B P | ∃ r ∈ ground(P) s.t. a ∈ H(r), H(r) – {a} ⊆ .I, and B(r) ⊆ I} Note: T P is deterministic! Definition: W P (I) = T P (I) .GUS P (I)
28
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 28 of 32 WeST Theorem Let M be a total interpretation for program P. M is a stable model for P iff M is a fixpoint of W P. Proposition: Given a propositional program P, W P ( ) is computable in polynomial time.
29
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 29 of 32 WeST Examples Program P: a b :- W P ( ) = , i.e. not a model! Program P: b :- NOT c. a b :- W P ( ) = {NOT c, b, NOT a}, i.e. total, i.e. stable model
30
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 30 of 32 WeST Computing the Stable Models: Main Possibly true literals
31
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 31 of 32 WeST Computing the Stable Models: Compute-Stable
32
Steffen Staab staab@uni-koblenz.de Advanced Data Modeling 32 of 32 WeST FINIS This slide deck is not part of the material for examinations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.