SLIDE 1 Paraconsistent Modular ASP
Paraconsistent Modular Answer Set Programming
Thomas Eiter joint with M. Dao-Tran, M. Fink, T. Krennwallner
Institut für Informationsysteme, TU Wien 2nd Datalog 2.0 Workshop, Vienna, September 13, 2012
Austrian Science Fund (FWF) grant P20841 Vienna Science and Technology Fund (WWTF) grant ICT08-020. 1/58
SLIDE 2 Paraconsistent Modular ASP
Needs for Knowledge Representation
Wanted: Interlink knowledge sources Cope with heterogeneity Modularization Handle inconsistency, incompleteness Dynamics, openness Issues: Frameworks, formal semantics Algorithms, implementations modular representation inconsistency management
Datalog 2.0 12, 13.09.2012 2/58
SLIDE 3 Paraconsistent Modular ASP
1.1 Modularity in LP
Modularity in Logic Programming
Goal: Structured programming Gaifman and Shapiro [1989]: module architecture, interaction via input/output interfaces Different directions in general LP [Brogi et al., 1994]:
- Programming in the large:
compositional operators to build complex programs
- Programming in the small:
abstraction and scoping (e.g., macros, templates, . . . )
Issue: Modularity in Nonmonotonic LP
Stratified logic programs [Apt et al., 1988]. Splitting Sets [Lifschitz and Turner, 1994]
- more recent interest: module concepts [E_ et al., 1997b], [Janhunen
et al., 2007], [Dao-Tran et al., 2009a]
Datalog 2.0 12, 13.09.2012 3/58
SLIDE 4 Paraconsistent Modular ASP
1.2 Paraconsistency
Paraconsistent Reasoning
Knowledge explosion: A, ¬A ⊢ B Belnap’s 4-valued logic: bilattice Paraconsistent Logic Programming: [Blair and Subrahmanian, 1989] Answer Set Programming: e.g. [Sakama and Inoue, 1995], [Alcântara et al. 2002,2004], [Arieli, 2002], [Odintsov and Pearce, 2005]
Datalog 2.0 12, 13.09.2012 4/58
SLIDE 5 Paraconsistent Modular ASP
1.2 Paraconsistency
Roadmap
This talk: modularity and paraconsistency in nonmonotonic LP Focus: Answer Set Semantics, work at KBS
- Modular Answer Set Programming (MLP)
- Paraconsistent Answer Set Programming (ASP)
- Combination of Modular and Paraconsistent ASP
- Conclusion
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 5/58
SLIDE 6 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.1 Replacement
Modular Replacement in NonMon LP
Problem: Replacement property (substitution) does not hold If P ≡ P ′ then Q ∪ P ≡ Q ∪ P ′ Counterexample: P = { a ← not b }, P ′ = { a }, Q = { b ← not a }. P and P ′ have the same model (answer set) {a} Q ∪ P ′ has the same model, but Q ∪ P in addition {b} Solution: Notion of strong equivalence [Lifschitz et al., 2001]: P ≡s P ′ iff Q ∪ P ≡ Q ∪ P ′ for all programs Q Refined notions (survey [Woltran, 2008]): uniform equivalence (restrict Q to sets of facts), modular equivalence [Oikarinen and Janhunen, 2006], projection equivalence [Oetsch et al., 2007], . . . Still not fully explored; computational complexity may be high
Datalog 2.0 12, 13.09.2012 6/58
SLIDE 7 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Modular Answer Set Programming
Aim: [E_ et al., 1997b], [Dao-Tran et al., 2009a]
Provide module (“procedure”) concept as in ordinary programming realize libraries, code reuse establish call by value mechanism allow the use of recursive calls
Datalog 2.0 12, 13.09.2012 7/58
SLIDE 8 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Program Modules
Conventional programming: Definition:
proc p(x, y: int): int begin ... a := ... return a end p;
Use: x := p(y, z); Nonmonotonic LP: Definition: Module m = (P[q1, q2], R), where
- P is a module name
- q1, q2 are predicate names
- R is a set of rules
Use: p(X) ← P[r, s].a
Modular Logic Programs
A modular (nonmon.) logic program (MLP) P = (m1, . . . , mn), consists
qi], Ri) where at least one mi has void qi (=main). Rule bodies may contain module atoms P[p1, . . . , pk].o(t1, . . . , tl), where p1, . . . , pk are predicate names and o(t1, . . . , tl) is an ordinary atom.
Datalog 2.0 12, 13.09.2012 8/58
SLIDE 9 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Semantics
[E_ et al., 1997b]: view modules as generalized quantifiers:
access a module P2 from module P1 by module atoms of the form P2[ p].q(X), using the extension of p as input from P1.
For an MLP P as above, answer sets were defined using a generalization of the GL-reduct [Gelfond and Lifschitz, 1991].
Drawbacks
Calls of modules must be acyclic (similar in other approaches). Lack of groundedness (minimality). Handling multiple models of called modules difficult.
Datalog 2.0 12, 13.09.2012 9/58
SLIDE 10 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Example: Odd/Even
Canonical example of mutual recursion in LP
even(0) ← . even(f(X)) ← odd(X).
Datalog version: Given unary relation q, decide whether |q| is even. Not expressible in plain datalog, nor in monadic ASP, but with an
- rdering (successor) on q using recursion
Use choice in a recursive module: P[q]:
q′(X) ← q(X), rem(Y ), X = Y . rem(X) ← q(X), not q′(X).
even ← not odd.
Datalog 2.0 12, 13.09.2012 10/58
SLIDE 11 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Example: Order
Similar: generate an ordering (successor) Pord[q/1]: define relations succ, first, last
q′(X) ∨ q′(Y ) ← q(X), q(Y ), X = Y. rem(X) ← q(X), not q′(X). first(X) ← rem(X). succ(X, Y ) ← first(X), Pord[q′].first(Y ). succ(X, Y ) ← Pord[q′].succ(X, Y ). n_last(X) ← succ(X, Y ). last(X) ← q(X), not n_last(X).
No guess on binary predicates Answer sets correspond to orderings
Datalog 2.0 12, 13.09.2012 11/58
SLIDE 12 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Example: Positive Loop
Consider P = (m1, m2), where m1 = (P1[], R1), with R1 = { a ← P2[ ].b } m2 = (P2[], R2),with R2 = { b ← P1[ ].a } Thus, has a loop via positive mutual calls. Desired semantics: an “empty” model
- Neither a in P1 nor b in P2 should be true.
Proposals like DLP functions [Janhunen et al., 2007] exclude positive recursion. Yet useful e.g. for modular embedding of nonmonotonic dl-programs into datalog (cf. [E_ et al., 2012])
Datalog 2.0 12, 13.09.2012 12/58
SLIDE 13 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Syntax of MLPs
Datalog language (function-free first order) Module names P, each with a fixed associated list q = q1, . . . , qk (k ≥ 0) of predicates qi (the formal input parameters). Atoms:
- Ordinary atoms: o(t1, . . . , tℓ)
- Module atoms P[p1, . . . , pk].o(t1, . . . , tℓ)
p1, . . . , pk are predicates matching q1, . . . , qk (call input parameters)
Rules: α1 ∨ · · · ∨ αk ← β1, . . . , βj, not βj+1, . . . , not βm, k ≥ 1 where the αi are ordinary atoms, the βj are atoms Module: m = (P[ q], R), where R is finite set of rules
P[ q] R
Modular Nonmonotonic Logic Program: P = (m1, . . . , mn)
Datalog 2.0 12, 13.09.2012 13/58
SLIDE 14 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Odd/Even: Mutual Recursion
P = (m1, m2, m3), where m1 = (P1, R1), m2 = (P2[q2], R2), m3 = (P3[q3], R3). R1 = {q(a). q(b).
R2 = q′
2(X)∨q′ 2(Y ) ← q2(X), q2(Y ),
X = Y. rem2 ← q2(X), not q′
2(X).
even2 ← not rem2. even2 ← rem2, P3[q′
2].odd.
R3 = q′
3(X)∨q′ 3(Y ) ← q3(X), q3(Y ),
X = Y. rem3 ← q3(X), not q′
3(X).
← rem3, P2[q′
3].even2.
main(): n := |q| ; if even(n) then return ok ; even(n): n′ := n − 1 ; if n′ < 0 then return true ; if n′ = 0 then return false ; if odd(n′) then return true ; else return false ;
n′ := n − 1 ; if even(n′) then return true ; else return false ;
Datalog 2.0 12, 13.09.2012 14/58
SLIDE 15 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Semantics of MLPs
Defined by grounding as usual, over the constants (Herbrand universe) of an MLP P. For a rule, set of rules, module, MLP X let gr(X) denote the grounding of X. In the sequel, we assume grounded modules / MLPs The Herbrand base of P, HBP, consists of all ground atoms An interpretation of a (ground) rule set R is a subset M ⊆ HBP containing only ordinary atoms. To interpret a (ground) module m = (P[ q, R]), we need to consider its instantiations
Datalog 2.0 12, 13.09.2012 15/58
SLIDE 16 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Module Instantiation
Schema Instantiation
P [q1,q2] R ∅ P [q1,q2] R {q1(a)} P [q1,q2] R {q2(a)} P [q1,q2] R {q1(a) ,q2(a) } P [q1,q2] R
Value call: P[S], with input S ⊆ HBP|
q
VC(P) = set of all value calls P[S] in P IP(P[S]) = R ∪ S is an instantiation of m = (P[ q], R) with S ⊆ HBP|
q
I(P) = (IP(Pi[S]) | Pi[S] ∈ VC(P)) is the instantiation of P
Datalog 2.0 12, 13.09.2012 16/58
SLIDE 17 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Interpretations and Models
Notation: Mi/S stands for MPi[S] M
Mi/S
S
Pi[ qi] Pk[ p].o( c) r( a) Mi/S r( a) Mk/T
c) T = (Mi/S)|
qk
Instantiation: I(P) = (IP(Pi[S]) | Pi[S] ∈ VC(P)) Interpretation: M = (Mi/S | Pi[S] ∈ VC(P)) M, Pi[S] | = r( a) iff r( a) ∈ Mi/S M, Pi[S] | = Pk[ p].o( c) iff o( c) ∈ Mk/T
Informally, T assigns the formal parameters qk the value of p in Mi/S
Datalog 2.0 12, 13.09.2012 17/58
SLIDE 18 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Answer Sets (Stable Models)
For rules r and set R of rules, define M, P[S] | = r and M, P[S] | = R as usual Analgously, M | = r iff M, P[S] | = r, resp. M, P[S] | = R iff M | = R, for all P[S] ∈ V C For answer sets, we require stability of M at all P[S] using the FLP reduct [Faber et al., 2004]. For any P[S] ∈ VC(P), the FLP reduct of P wrt. M is fP(P[S])M = {H ← B ∈ Igr(P)(P[S]) | M, P[S] | = B}
Definition
M is an answer set (stable model) of P iff M is a ⊆-minimal model of fPM, where ⊆ is componentwise. (N ⊆ M iff NP[S] ⊆ MP[S] for all P[S] ∈ VC)
Datalog 2.0 12, 13.09.2012 18/58
SLIDE 19 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Example
Loop (reconsidered): P1 : a ← P2[ ].b P2 : b ← P1[ ].a Answer set: M1 = (∅, ∅)
- fP(P1[])M1 = {}
- fP(P2[])M1 = {}
- Clearly, M1 is a minimal model of fPM1
Non-answer set: M2 = ({a}, {b})
= P
- As M1 ⊂ M2, M2 is not an answer set of P.
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 19/58
SLIDE 20 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Odd/Even (cont’d)
P = (m1, m2, m3), where m1 = (P1, R1), m2 = (P2[q2], R2), m3 = (P3[q3], R3). R1 = {q(a). q(b).
R2 = q′
2(X)∨q′ 2(Y ) ← q2(X), q2(Y ),
X = Y. rem2 ← q2(X), not q′
2(X).
even2 ← not rem2. even2 ← rem2, P3[q′
2].odd3.
R3 = q′
3(X)∨q′ 3(Y ) ← q3(X), q3(Y ),
X = Y. rem3 ← q3(X), not q′
3(X).
← rem3, P2[q′
3].even2.
M M1/∅ : {ok, q(a), q(b)} M2/{q2(a), q2(b)} : even2, rem2, q2(a), q2(b), q′
2(b)
. . . M3/{q3(b)} : {odd3, rem3, q3(b)} . . .
Datalog 2.0 12, 13.09.2012 20/58
SLIDE 21 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Semantic Properties
Horn MLPs P (rules α1 ← β1, . . . , βj):
- P satisfies model intersection M ∩ N, where
(M ∩ N)P [S] =
S′⊇S(MP [S′] ∩ NP [S′]).
- P has a unique answer set (minimal model), LM(P)
- LM(P) = lfp(TP) for the natural TP operator.
The answer sets of a not-free MLP P are its minimal models. For a generalized notion of stratification Σ = Σ1, . . . , Σl [Apt et al., 1988], the iterative model semantics (computable via operators T Σi
P )
coincides with the answer set semantics. Generalizes the concept of DLP-function of Janhunen et al. [2007]
- Allow for positive recursion through modules
- Value call mechanism (i.e., not only empty inputs P[ ].o)
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 21/58
SLIDE 22 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Computational Complexity
Horn MLP P Computing lfp(P) Deciding α ∈ lfp(P) propositional, empty inputs polynomial time P-c propositional exponential time EXP-c non-ground double exponential time 2EXP-c MLP P Answer set existence / brave inference propositional, normal, empty inputs NP-c propositional, empty inputs Σp
2-c
propositional, normal NEXP-c propositional NEXPNP-c non-ground, normal 2NEXP-c non-ground 2NEXPNP-c
In general, one exponential higher than for ordinary programs Intuitively, input p1, . . . , pk encodes k·nm bits (m = max. arity of pi) Also exponentially higher data complexity No increase for constant bound on input arities (m)
Datalog 2.0 12, 13.09.2012 22/58
SLIDE 23 Paraconsistent Modular ASP
- 2. Modularity in NonMon LP
2.2 Modular ASP
Implementation
Top-Down evaluation algorithm TD-MLP [Dao-Tran et al., 2009b]
- for ic-stratified MLPs (e.g., the odd/even example)
- works in exponential space
- exploits Splitting Sets extended to MLPs
- implementation (+ optimizations): [Wijaya, 2011]
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 23/58
SLIDE 24 Paraconsistent Modular ASP
Sources of Inconsistency
Contradiction
☞ Example P = {p; −p ← q q}.
Ako paraconsistency may be supported in implementations of ASP:
X) is viewed as atom with predicate name “−p”
- the constraint false ← p(
X), “−p”( X), not false is added ☞ disable this constraint
Unfoundedness / Instability: Due to nonmonotonicity, programs may be incoherent, i.e., no answer set due to cyclic dependencies of an atom from its default negation.
☞ Example P = { p ← not p }.
Datalog 2.0 12, 13.09.2012 24/58
SLIDE 25 Paraconsistent Modular ASP
Sources of Inconsistency (cont’d)
Focus: genuine problem of unfoundedness ☞paracoherence contradiction (“classical negation”) can be “added on top” (cf. ordinary ASP)
Datalog 2.0 12, 13.09.2012 25/58
SLIDE 26 Paraconsistent Modular ASP
Desiderata
Ideally, a paraconsistent semantics for ASP satisfies the following properties:
- 1. Classical Coherence: If a program has a classical model,
then it has a model.
- 2. Answer Set Coverage: Every (consistent) answer set of a program
corresponds to some model.
- 3. Answer Set Incidence (aka Congruence): If a (consistent) answer
set exists for a program, then every model corresponds to some answer set. Widely-known semantics satisfy only part of these requirements:
- 3-valued stable models [Przymusinski 91], L-stable models [Eiter et
- al. 95], revised stable models [Pereira & Pinto 95],
- regular models [You & Yuan 94], pstable models [Osorio et al. 08].
Semi-stable models [Inoue & Sakama 95] satisfy all three properties.
Datalog 2.0 12, 13.09.2012 26/58
SLIDE 27 Paraconsistent Modular ASP
3.1 Semi-Stable Models
Semi-Stable Models
Semi-stable models [Sakama and Inoue, 1995]: an approach to paraconsistent answer set semantics. Consider an extended propositional language Lκ = L ∪ {Ka | a ∈ L}. Interpretations Iκ are subsets of Lκ assigning truth values
- false ⊥,
- believed (assumed) true bt, and
- true t,
where ⊥ bt t. The truth value assigned by Iκ to a variable a is defined by Iκ(a) = t if a ∈ Iκ, bt if Ka ∈ Iκ and a ∈ Iκ, ⊥ otherwise. Definition via epistemic transformation (syntactic transformation)
Datalog 2.0 12, 13.09.2012 27/58
SLIDE 28 Paraconsistent Modular ASP
3.1 Semi-Stable Models
Semi-Stable Models (cont’d)
Definition (P κ [Sakama and Inoue, 1995])
The epistemic transformation of a program P is the positive program P κ
- btained from P by replacing each rule r of the form
a1 ∨ · · · ∨ al ←b1, . . . , bm, not bm+1, . . . , not bn, (1) in P, such that B−(r) = ∅, with: λr,1 ∨ . . . ∨ λr,l ∨ Kbm+1 ∨ . . . ∨ Kbn ← b1, . . . , bm, ai ← λr,i, ← λr,i, bj, λr,i ← ai, λr,k, for 1 ≤ i ≤ l, m < j ≤ n, and 1 ≤ k ≤ l. Note that P κ is positive for every program P.
Datalog 2.0 12, 13.09.2012 28/58
SLIDE 29 Paraconsistent Modular ASP
3.1 Semi-Stable Models
Semi-Stable Models (cont’d)
Semi-stable models are maximal canonical answer sets of P κ: Given an interpretation Iκ over L′ ⊇ Lκ, let gap(Iκ) = {Ka | Ka ∈ Iκ and a ∈ Iκ}. An interpretation Iκ ∈ S is maximal canonical in S iff no interpretation Jκ ∈ S such that gap(Jκ) ⊂ gap(Iκ) exists. Let mc(S) denote maximal canonical interpretations in S and let SST (P) be the semi-stable models of a program P. Then, we can paraphrase the definition of semi-stable models:
Definition
Let P be a program over L. Then, SST (P) = {Iκ ∩ Lκ | Iκ ∈ mc(AS(P κ))}.
Datalog 2.0 12, 13.09.2012 29/58
SLIDE 30 Paraconsistent Modular ASP
3.1 Semi-Stable Models
Examples
☞ Example 1: incoherent program The program P = {a ← not a} is incoherent, with signle semi- stable model {Ka}. ☞ Example 2: incoherent program, II The program P = {b ← a; a ← not a} has the single semi-stable model {Ka}. ☞ Example 3: many to one coverage The program P = {a; b; c; d ← not a, not b; d ← not b, not c}. is coherent and has the single answer set {a, b, c}. As SST (P) = {{a, b, c, Kb},{a, b, c, Ka, Kc}}, the semi-stable models do not not uniquely cover answer sets.
Datalog 2.0 12, 13.09.2012 30/58
SLIDE 31 Paraconsistent Modular ASP
3.1 Semi-Stable Models
Anomalies
The examples exhibit anomalies wrt. desirable rationality properties. knowledge generalization (or necessitation, resp. modal axiom N): Property N: a ∈ Iκ implies Ka ∈ Iκ, for all a ∈ L. This property does not hold as witnessed by Example 3. distribution axiom (modal axiom K): a1 ∨ · · · ∨ al ← b1, . . . , bm, not bm+1, . . . , not bn. Property K: If Iκ | = Kb1 ∧ . . . ∧ Kbm and Iκ | = Kbm+1 ∨ . . . ∨ Kbn (that is Iκ | = K not bm+1, . . . , Iκ | = K not bn) then Iκ | = Ka1 ∨ . . . ∨ Kal. Note that this does not hold for rule b ← a in Example 2.
Datalog 2.0 12, 13.09.2012 31/58
SLIDE 32 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Alternative Paracoherent Semantics
Alternative: semi-equilibrium models [E_ et al., 2010] Aim: Enforce Properties N and K. Have a nice model-theoretic definition resp. characterization of the semantics, rather than an transformational definition. Approach: use Equilibrium Logic [Pearce, 2006]
Datalog 2.0 12, 13.09.2012 32/58
SLIDE 33 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Equilibrium Logic
Basis for semantic charachterization of answer sets: the logic of here-and-there (HT) (Heyting, 1930), i.e., 2-world intuitionistic logic. We restrict our attention to program-like theories T (sets of formulas) of the form b1 ∧ . . . ∧ bm ∧ ¬bm+1 ∧ . . . ∧ ¬bn → a1 ∨ · · · ∨ al, (2) Semantically characterized by Kripke models of two worlds, h(ere) ≤ t(here).
➥ Propositional HT-interpretations are pairs (X, Y ) of sets of atoms,
such that X ⊆ Y .
Datalog 2.0 12, 13.09.2012 33/58
SLIDE 34 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Satisfaction
Satisfaction at the world w of an HT model M = (X, Y ): Notation: (X, Y ) (X, Y )|h = X, (X, Y )|t = Y
= a if a ∈ M|w, for any atom a,
= ⊥,
= φ ∧ ψ if M, w | = φ and M, w | = ψ,
= φ ∨ ψ if M, w | = φ or M, w | = ψ,
= φ → ψ if for every w′ ≥ w: M|w′ | = φ or M|w′ | = ψ,
where ¬φ is φ → ⊥ M | = φ iff M, w | = φ for all w ∈ {h, t} As M, w | = φ is monotonic in w, M | = φ iff M, h | = φ Thus M | = ¬φ iff M|t | = φ.
Datalog 2.0 12, 13.09.2012 34/58
SLIDE 35 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Satisfaction (cont’d)
Alternatively define M | = φ, M = (X, Y ), straight:
= a if a ∈ X, for any atom a,
= ⊥,
= φ ∧ ψ if (X, Y ) | = φ and (X, Y ) | = ψ,
= φ ∨ ψ if (X, Y ) | = φ or (X, Y ) | = ψ,
= φ → ψ if (i) (X, Y ) | = φ or (X, Y ) | = ψ, and (ii) Y | = φ → ψ.
where ¬φ is φ → ⊥; thus (X, Y ) | = ¬φ iff Y | = φ. An HT-interpretation (X, Y ) satisfies a theory T, iff it satisfies all formulas Axiomatic proof system: e.g. [Lifschitz et al., 2007]
Datalog 2.0 12, 13.09.2012 35/58
SLIDE 36 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Equilibrium Models
Definition
An HT-interpretation (Y, Y ) is an equilibrium model of a theory T, iff (Y, Y ) | = T and for all X ⊂ Y , (X, Y ) | = T. (h-minimality) ☞ Examples P = {a ← not b; a ← not b} has the eq. models (a, a) and (b, b) P = {a ← not a} has no equilibrium model
Theorem ([Pearce, 2006])
M is an answer set of P iff (M, M) is an equilibrium model of P. The use of HT/Equilibrium Logic has many attractive features: easy generalization to richer syntax (strong negation, nesting etc). lifts to non-ground programs (under suitable provisos) HT captures strong equivalence: P ≡s Q iff | =HT P ↔ Q
Datalog 2.0 12, 13.09.2012 36/58
SLIDE 37 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Semi-Equilibrium Models
In a HT-model (X, Y ), we may view Y as believed (assumed) atoms and X as a possible model of the rules under this belief The atoms in Y \ X of an HT-model (X, Y ) of P are “unfounded” In an equilibrium model X = Y , i.e., all atoms are founded By allowing (minimal) gaps Y \ X, coherence is ensured.
Definition
Let P be a program over L. An semi-equilibrium (seq) model of P is any HT-model (X, Y ) of P such that (i) (X′, Y ) | = P, for all X′ ⊂ X, and (h-minimality) (ii) there is no HT-model (X′, Y ′) of P that satisfies (i) and Y ′ \ X′ ⊂ Y \ X. (gap-minimality) SEQ(P) denotes the set of semi-equilibrium models of P.
Datalog 2.0 12, 13.09.2012 37/58
SLIDE 38 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Desiterata, Revisited
Semi-equilibrium models satisfy the desiderata 1-3:
- 1. Classical Coherence: If a program has a classical model,
then it has a semi-equilibrium model (as some HT-model (X, Y ) exists).
- 2. Answer Set Coverage: Every answer set X of a program P
corresponds to a semi-equilibrum model (X, X) of P (zero gap)
- 3. Answer Set Incidence: If an answer set X exists for a program,
then every seq-model (X, Y ) of P corresponds to some answer set of P (Y , and X = Y ) Furthermore: generalization from programs to theories is straightforward.
Datalog 2.0 12, 13.09.2012 38/58
SLIDE 39 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Examples
☞ Example: coherent (cont’d) Reconsider P = {a; b; c; d ← not a, not b; d ← not b, not c}. Its unique semi-equilibrium model is (abc, abc), corresponding to the single answer set {a, b, c}. As a consequence of Property K, semi-equilibrium semantics differs from semi-stable semantics not only with respect to believed consequences. ☞ Example Consider P = {a ← b; b ← not b; c ← not a}.
- SST (P) = {{c, Kb}}
- SEQ(P) = {(∅, ab)}
Note that c is not even believed to be true.
Datalog 2.0 12, 13.09.2012 39/58
SLIDE 40 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
SEQ Transformation
A transformation to standard ASP is possible by an extension of the epistemic program transformation P κ.
Definition (P HT)
The epistemic HT-transformation of program P over L, P HT , is P κ plus all rules: Ka ←a, Ka1 ∨ . . . ∨ Kal ∨ Kbm+1 ∨ . . . ∨ Kbn ←Kb1, . . . , Kbm, for a ∈ L, respectively for every rule r ∈ P of the form (1): a1 ∨ · · · ∨ al ← b1, . . . , bm, not bm+1, . . . , not bn. The maximal canonical answer sets of P HT coincide with SEQ(P).
Theorem
Let P be a program over L, and let Iκ be an interpretation over Lκ. Then, Iκ ∈ SEQ(P) iff Iκ ∈ {M ∩ Lκ | M ∈ mc(AS(P HT ))}.
Datalog 2.0 12, 13.09.2012 40/58
SLIDE 41 Paraconsistent Modular ASP
3.2 Semi-Equilibrium Models
Computational Complexity of SEQ
Computational complexity of major reasoning tasks (propositional case): Problem normal P disjunctive P SEQ(P) = ∅ ? NP-c NP-c (X, Y ) ∈ SEQ(P) ? co-NP-c Πp
2-c
P | =v
b a
Σp
2-c
Σp
3-c
P | =v
c a
Πp
2-c
Πp
3-c
| =v
b / |
=v
c: a has value v ∈ {⊥, bt, t} in some / every seq-model of P.
- ne level up in the polyonmial hierarchy (global gap minimization)
seq-model existence is trivial if no constraints (empty heads) are present
Datalog 2.0 12, 13.09.2012 41/58
SLIDE 42 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
Paraconsistent Modular ASP
Issue: Combine modular + paraconsistent ASP Can this be done easily? Challenges, problems? Evaluation / Efficiency ?
Datalog 2.0 12, 13.09.2012 42/58
SLIDE 43 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
HT Logic
Approach: formulate HT-Logic on MLPs, do gap minimization Interpretations: M = (MP[S] | P[S] ∈ V C) ❀ M = (MP[S] | P[S] ∈ V C) where MP[S] = (XP[S], YP[S]) is an HT-interpretation. Satisfaction: M, P[S] | = P ❀ M, P[S], w | = P, w ∈ {h, t} Key Issue: M, P[S], w | = Pj[ p].o ? handled in intuitionistic manner Notation: h- resp. t-projection M|h = (XP[S] | P[S] ∈ VC) and M|t = (YP[S] | P[S] ∈ VC) M, P[S], t | = Pj[ p].o iff M|t , P[S], | = Pj[ p].o M, P[S], h | = Pj[ p].o iff M|h , P[S], | = Pj[ p].o and M, P[S], t | = Pj[ p].o Thus M, P[S] | = Pj[ p].o iff M|w , P[S] | = Pj[ p].o for w ∈ {h, t}
Datalog 2.0 12, 13.09.2012 43/58
SLIDE 44 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.1 Equilibrium MLP Models
Equilibrium MLP Models
Define equilibrium models as usual
Definition
An MLP HT-interpretation M = (M, M) is an equilibrium model of an MLP theory T, iff M | = T and for every M′ ⊂ M, it holds that (M′, M) | = T. (h-minimality) Correspondence result:
Theorem
M is an answer set of P iff M = (M, M) is an equilibrium model of P. Thus, we have an EQ-Logic view of MLPs Generalizes to richer MLP language Next: formulate semi-equilibrium models
Datalog 2.0 12, 13.09.2012 44/58
SLIDE 45 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.2 Semi-Equilibrium MLP Models
Semi-Equilibrium MLP Models
Notation: for MLP HT-model M = (X, Y), let gap(M) = (YP[S] − XP[S] | P[S] ∈ V C)
Definition
Let P be a program over L. An semi-equilibrium (seq) model of an MLP P is any HT-model M = (X, Y) of P such that (i) for every P[S] ∈ V C and formal input atom q, q ∈ S iff q ∈ YP[S] (input congruence) (ii) (X, Y) | = P, for all X′ ⊂ X, and (h-minimality) (iii) there is no HT-model M′ = (X′, Y′) of P that satisfies (i), (ii) and gap(M′) ⊂ gap(M). (gap-minimality) SEQ(P) denotes the set of semi-equilibrium models of P.
Datalog 2.0 12, 13.09.2012 45/58
SLIDE 46 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.2 Semi-Equilibrium MLP Models
SEQ MLP Transformation
Modify and adapt P HT above for P:
Definition (PHT)
For each rule r a1 ∨ · · · ∨ al ← b1, . . . , bm, not bm+1, . . . , not bn, in P, set up (1) a1 ∨ · · · ∨ al ∨ Kbm+1 ∨ . . . ∨ Kbn ← b1, . . . , bm, (2) Ka1 ∨ · · · ∨ Kal ∨ . . . ∨ Kbm+1 ∨ . . . ∨ Kbn ← Kb1, . . . , Kbm, (3)
(4) ← Ka, not Ka, module atom a (5) ← Kq, not q, formal input atom q where
b Ka = Kp a = p KoP.[
p] a = P.[
p].o Ka = Kp a = p P.[Kp1, . . . , Kpk].Ko a = P.[p1, . . . , pk].o
Datalog 2.0 12, 13.09.2012 46/58
SLIDE 47 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.2 Semi-Equilibrium MLP Models
SEQ MLP Transformation (cont’d)
The answer sets of PHT provide the basis for
Lemma
The equilibrium models of PHT , projected to the original language L, coincide with the HT-models of P that fulfill (i) and (ii). Perform gap minimization on top. Let M ∩ L be the projection of M to L, and Let mc(S) = {M ∈ S | ∀M′ ∈ S : gap(M′ ∩ L) ⊂ gap(M ∩ L)} The maximal canonical answer sets of PHT yield SEQ(P).
Theorem
For any MLP program P over L, SEQ(P) = {ML | M ∈ mc(EQ(PHT )).
Datalog 2.0 12, 13.09.2012 47/58
SLIDE 48 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.3 Computational Complexity
Computational Complexity
Gap minimization adds for ordinary answer set programs a guess for refutation (recognition) For MLPs, an anlog increase is plausible Expected results:
MLP P pseq-model existence brave inference propositional, normal, empty inputs NP-c Σp
2-c
propositional, empty inputs NP-c Σp
3-c
propositional, normal NEXP-c NEXPNP-c propositional NEXP-c NEXPΣp
2 -c
non-ground, normal 2NEXP-c 2NEXPNP-c non-ground 2NEXP-c 2NEXPΣp
2 -c
pseq-model existence is trivial, if no constraints (empty heads) are present
Datalog 2.0 12, 13.09.2012 48/58
SLIDE 49 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.4 Classical Negation
Classical Negation
Classical (strong) negation ∼φ can be added using paraconsistent Nelson logic (N9), a 9-valued logic with explicit strong negation. Can be semantically described by Routley models: (X, Y, X∗, Y ∗) [Odintsov and Pearce, 2005]:
- (X, Y ) is an HT interpretation.
- (X∗, Y ∗) is an HT interpretation to evaluate ∼φ.
- Intuition: truth of ∼φ at w is equivalent to falsity at w∗ (and
w∗∗ = w).
A quantified version of N9 (with static domain), QN9, is available (cf. [Fink, 2012]). For foundedness, (i) minimize X, X∗ in parallel (keeping the there-worlds Y , Y ∗ fixed) On top, (ii) minimize gaps Y \ X, Y ∗ \ X∗ in parallel
Datalog 2.0 12, 13.09.2012 49/58
SLIDE 50 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.4 Classical Negation
Bilattice NINE
The nine truth values form a bilatice wrt. truth order (≤t) and knowledge
Where bt = (0, 1), t = (1, 1), f = (1, 0), ⊥ = (0, 0)
Datalog 2.0 12, 13.09.2012 50/58
SLIDE 51 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.4 Classical Negation
Properties
Paraconsistent semi-equilibrium (pseq) models (defined using (i) and (ii)) for MLPs has desirable properties:
If a program has a classical model, MLP P has some pseq-model if P has some model
If M is an equilibrium model (answer set) of MLP P, then ((X, X, X, X) | X = MP[S], P[S] ∈ V C) is a pseq-model of P
If an MLP P has some equilibrium model (answer set) M, then the pseq models of P correspond to the answer sets of P. No increase in complexity
Datalog 2.0 12, 13.09.2012 51/58
SLIDE 52 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.5 Structured Rule Sets
Structured Rule Sets
Gap minimization is too weak! P = c ← b, not c. b ← not a.
- Two semi equilibrium models: (b, bc) and (∅, a)
(b, bc) is more appealing than (∅, a):
- a can not be derived for sure (no rule with a in the head),
- P1 = {b ← not a} is a “lower” part feeding into the “upper” part
P2 = {c ← b, not c}
- The lower program part is coherent
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 52/58
SLIDE 53 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.5 Structured Rule Sets
Splitting Sets
Splitting sets [Lifschitz and Turner, 1994] capture implicit program modularity A set U of atoms is a splitting set of (propositional) program P, if for every rule r ∈ P: ] head(r) ∩ U = ∅ implies Ats(r) ⊆ U. Split program into P = bU(P) ∪ tU(P) ☞ Example (cont’d) U = {a, b}, bU(P) = P1, tU(P) = P2. Splitting sets allow for a compositional evaluation (bottom up) Datalog: P2 ⊲ P1 E_ et al. [1994,1997a] They generalize (local) stratification Easy to recognize Dilemma: not unique
Datalog 2.0 12, 13.09.2012 53/58
SLIDE 54 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.5 Structured Rule Sets
Explicit Modularity
Reformulate P as MLP P = (P1, P2): P1 = { b ← not a }, P2 = { c ← P1[ ].b, not c } Semi-equilibrium models: ((b, b), (∅, c)), ((∅, a), (∅, ∅)) Preferred: ((b, b), (∅, c)). In structured programming, the semantics of basic modules (at least) should be invariant and compositional.
Datalog 2.0 12, 13.09.2012 54/58
SLIDE 55 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.5 Structured Rule Sets
Structural Gap Minimization
Recipe: refine gap minimization For explicit modularity, preference respecting modules
- minimize gap on bottom modules
For implicit modularity, optional preference of parts
- minimize gap on bottom parts
Uniqueness ? ☞ use strongly connected components (SCCs) of a (syntactic) dependency graph
- module call dependency graph
- atom dependency graph
The SCCs of the ordinary dependency graph induce canonical splitting sets.
Datalog 2.0 12, 13.09.2012 55/58
SLIDE 56 Paraconsistent Modular ASP
- 4. Paraconsistent Modular ASP
4.5 Structured Rule Sets
SSCs
atom dependency graph vs module call dependency graph More about dependency graphs: [Dao-Tran et al., 2011]
Datalog 2.0 12, 13.09.2012 56/58
SLIDE 57 Paraconsistent Modular ASP
- 5. Related Work & Conclusion
Related Work
Semi-stable models [Sakama and Inoue, 1995] Paraconsistent Answer-Set Semantics (PAS) [Alcântara et al., 2004]
- logical axiomatization in [Odintsov and Pearce, 2005] using Routley
models
Consistency Restoring Rules (CR-Prolog) [Balduccini and Gelfond, 2003] Paraconsistent hybrid theories [Fink, 2012], hybrid theories [Fink and Pearce, 2010] First-order stable models [Ferraris et al., 2007], [Lee and Meng, 2012]
Datalog 2.0 12, 13.09.2012 57/58
SLIDE 58 Paraconsistent Modular ASP
- 5. Related Work & Conclusion
Conclusion
Modularity in NonMon LP: MLPs Paracoherence / -consistency: HT gap minimization
- lifts to MLPs
- shows versatility of HT / Equilibrium Logic
Issues
- Semantics: refine paracoherence
Preference on (gap-minimal) HT-models
modular composition implicit vs. explicit modularity
- Complexity: low cost paracoherent / -consistent fragments
- Implementation
- T. Eiter / TU Wien
Datalog 2.0 12, 13.09.2012 58/58
SLIDE 59
References I
João Alcântara, Carlos Viegas Damásio, and Luís Moniz Pereira. Paraconsistent logic programs. In Sergio Flesca, Sergio Greco, Nicola Leone, and Giovambattista Ianni, editors, JELIA, volume 2424 of Lecture Notes in Computer Science, pages 345–356. Springer, 2002. João Alcântara, Carlos Viegas Damásio, and Luís Moniz Pereira. A declarative characterization of disjunctive paraconsistent answer sets. In ECAI 2004, pages 951–952, 2004. K.R. Apt, H.A. Blair, and A. Walker. Towards a Theory of Declarative Knowledge. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 89–148. Morgan Kaufman, Washington DC, 1988.
SLIDE 60 References II
Ofer Arieli. Paraconsistent declarative semantics for extended logic programs.
- Ann. Math. Artif. Intell., 36(4):381–417, 2002.
Marcello Balduccini and Michael Gelfond. Logic programs with consistency-restoring rules. In Proceedings AAAI 2003 Spring Symposium, pages 9–18. AAAI Press, 2003. Howard A. Blair and V. S. Subrahmanian. Paraconsistent logic programming.
- Theor. Comput. Sci., 68(2):135–154, 1989.
Antonio Brogi, Paolo Mancarella, Dino Pedreschi, and Franco Turini. Modular logic programming. ACM Trans. Program. Lang. Syst., 16(4):1361–1398, 1994.
SLIDE 61
References III
Minh Dao-Tran, Thomas Eiter, Michael Fink, and Thomas Krennwallner. Modular nonmonotonic logic programming revisited. In P.M. Hill and D.S. Warren, editors, Proceedings 25th International Conference on Logic Programming (ICLP 2009), number 5649 in Lecture Notes in Computer Science, pages 145–159. Springer, 2009. Minh Dao-Tran, Thomas Eiter, Michael Fink, and Thomas Krennwallner. Relevance-driven evaluation of modular nonmonotonic logic programs. In Esra Erdem, Fangzhen Lin, and Torsten Schaub, editors, Proceedings of the 10th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR 2009), volume 5753 of LNCS, pages 87–100. Springer, 2009.
SLIDE 62 References IV
Minh Dao-Tran, Thomas Eiter, Michael Fink, and Thomas Krennwallner. First-order encodings for modular nonmonotonic datalog programs. In O. de Moor et al., editor, Proc. Workshop on Datalog 2.0, Magdalen College, Oxford, March 2010, number 6702 in LNCS, pages 59–77. Springer Verlag, 2011.
- T. Eiter, G. Gottlob, and H. Mannila.
Adding Disjunction to Datalog. In Proceedings of the Thirteenth ACM SIGACT SIGMOD-SIGART Symposium on Principles of Database Systems (PODS-94), pages 267–278, May 1994. Thomas Eiter, Georg Gottlob, and Heikki Mannila. Disjunctive Datalog. ACM Transactions on Database Systems, 22(3):364–417, September 1997.
SLIDE 63
References V
Thomas Eiter, Georg Gottlob, and Helmuth Veith. Modular Logic Programming and Generalized Quantifiers. In LPNMR-1997, volume 1265 of LNCS, pages 290–309. Springer, 1997. Thomas Eiter, Michael Fink, and Joao Moura. Paracoherent answer set programming. In Proceedings 12th International Conference on Principles of Knowledge Representation and Reasoning (KR 2010), May 9-13, 2010, Toronto, Canada, 2010. Thomas Eiter, Thomas Krennwallner, Patrik Schneider, and Guohui Xiao. Uniform evaluation of nonmonotonic dl-programs. In T. Lukasiewicz and A. Sali, editors, Proceedings 7th International Symposium on Foundations of Information and Knowledge Systems (FoIKS 2012), Kiel, Germany, March 5–9, 2012, number 7153 in LNCS, pages 1–22. Springer, 2012.
SLIDE 64
References VI
Wolfgang Faber, Nicola Leone, and Gerald Pfeifer. Recursive aggregates in disjunctive logic programs: Semantics and complexity. In JELIA 2004, volume 3229 of LNCS, pages 200–212. Springer, September 2004. Paolo Ferraris, Joohyung Lee, and Vladimir Lifschitz. A new perspective on stable models. In Manuela M. Veloso, editor, IJCAI, pages 372–379, 2007. Michael Fink and David Pearce. A logical semantics for description logic programs. In Tomi Janhunen and Ilkka Niemelä, editors, JELIA, volume 6341 of Lecture Notes in Computer Science, pages 156–168. Springer, 2010.
SLIDE 65 References VII
Michael Fink. Paraconsistent hybrid theories. In Gerhard Brewka, Thomas Eiter, and Sheila A. McIlraith, editors, KR. AAAI Press, 2012. Haim Gaifman and Ehud Y. Shapiro. Fully abstract compositional semantics for logic programs. In POPL, pages 134–142. ACM Press, 1989.
- M. Gelfond and V. Lifschitz.
Classical negation in logic programs and disjunctive databases. New Generation Computing, 9:365–385, 1991.
SLIDE 66
References VIII
Tomi Janhunen, Emilia Oikarinen, Hans Tompits, and Stefan Woltran. Modularity Aspects of Disjunctive Stable Models. In Proceedings of the 9th International Conference on Logic Programming and Nonmonotonic Reasoning, volume 4483 of LNCS, pages 175–187. Springer, May 2007. Joohyung Lee and Yunsong Meng. Stable models of formulas with generalized quantifiers (preliminary report). In Agostino Dovier and Vítor Santos Costa, editors, ICLP (Technical Communications), volume 17 of LIPIcs, pages 61–71. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2012. Vladimir Lifschitz and Hudson Turner. Splitting a Logic Program. In ICLP’94, pages 23–37. MIT Press, 1994.
SLIDE 67
References IX
Vladimir Lifschitz, David Pearce, and Agustín Valverde. Strongly equivalent logic programs. ACM Trans. Comput. Log., 2(4):526–541, 2001. Vladimir Lifschitz, David Pearce, and Agustín Valverde. A characterization of strong equivalence for logic programs with variables. In Chitta Baral, Gerhard Brewka, and John S. Schlipf, editors, LPNMR, volume 4483 of Lecture Notes in Computer Science, pages 188–200. Springer, 2007. Sergei P. Odintsov and David Pearce. Routley semantics for answer sets. In Chitta Baral, Gianluigi Greco, Nicola Leone, and Giorgio Terracina, editors, LPNMR, volume 3662 of Lecture Notes in Computer Science, pages 343–355. Springer, 2005.
SLIDE 68 References X
Johannes Oetsch, Hans Tompits, and Stefan Woltran. Facts do not cease to exist because they are ignored: Relativised uniform equivalence with answer-set projection. In AAAI, pages 458–464. AAAI Press, 2007. Emilia Oikarinen and Tomi Janhunen. Modular equivalence for normal logic programs. In Gerhard Brewka, Silvia Coradeschi, Anna Perini, and Paolo Traverso, editors, ECAI, volume 141 of Frontiers in Artificial Intelligence and Applications, pages 412–416. IOS Press, 2006. David Pearce. Equilibrium logic.
- Ann. Math. Artif. Intell., 47(1-2):3–41, 2006.
SLIDE 69 References XI
Chiaki Sakama and Katsumi Inoue. Paraconsistent stable semantics for extended disjunctive programs.
- J. Log. Comput., 5(3):265–285, 1995.
Tri Kurniawan Wijaya. Top-down evaluation techniques for modular nonmonotonic logic programs. Master’s thesis, TU Wien, August 2011. Stefan Woltran. A common view on strong, uniform, and other notions of equivalence in answer-set programming. TPLP, 8(2):217–234, 2008.