SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Downloaden Sie, um offline zu lesen
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Aggregates in Recursion: Issues and
Solutions
Wolfgang Faber
Alpen-Adria-Universität Klagenfurt
RuleML Webinar, 2018-05-25
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Outline
1 Motivation
2 Basics: Answer Set Programming and Aggregates
3 Semantics
Stratified Aggregates
Unstratified Aggregates
4 Properties
Coincidence Results
Complexity Results
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Motivation: Aggregates
Aggregates facilitate problem representation
Standard in database query languages
For example:
SELECT company.name FROM company,employee
WHERE company.id = employee.cid AND
COUNT(employee.id) < 10
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Motivation: Aggregates and Logic Programming
In this talk: Combination of Logic Programming and
Aggregates
For example:
SELECT company.name FROM company,employee
WHERE company.id = employee.cid AND
COUNT(employee.id) < 10
using Logic Programming (here ASP/Datalog):
result(N) :- company(N, Y), #count{X : employee(X, Y)} < 10.
Does this look innocent?
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Recursion
A main feature of Logic Programming is recursion
Example:
tc(A, B) :- p(A, B).
tc(A, B) :- p(A, X), tc(X, B).
defines the transitive closure of p
Supported also in SQL
Recent (since SQL-99)
Not particularly well-known
Common Table Expressions (CTE)
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Recursion and Aggregates
Combination of recursion and aggregates?
Explicitly forbidden in SQL!
Meaning of
p(a) :- #count{X : p(X)} > 0.
Meaning of
p(a) :- #count{X : p(X)} < 1.
Meaning of
p(1) :- #avg{X : p(X)}! = 1.
p(−1) :- #avg{X : p(X)}! = 1.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
ASP Semantics
Herbrand interpretations
Reduct for interpretation I:
1 Delete rules whose negative body is true in I.
2 Delete negative body from all other rules.
Interpretations I which are minimal models of the reduct for
I are answer sets.
[Gelfond, Lifschitz 1988] (nondisjunctive)
[Przymusinski 1991] (disjunctive)
[Gelfond, Lifschitz 1991] (disjunctive, 2 kinds of negation)
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
ASP Semantics
Herbrand interpretations
Reduct for interpretation I:
1 Delete rules whose negative body is true in I.
2 Delete negative body from all other rules.
Interpretations I which are minimal models of the reduct for
I are answer sets.
[Gelfond, Lifschitz 1988] (nondisjunctive)
[Przymusinski 1991] (disjunctive)
[Gelfond, Lifschitz 1991] (disjunctive, 2 kinds of negation)
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Aggregates
Aggregate Functions: Functions over ground term
(multi)sets
(Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .}
Evaluate Conj w.r.t. an interpretation
Aggregate Atoms: Aggregate Function plus comparison
Important: Aggregate atoms depend on truth values of a set of
standard atoms!
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Aggregates
Aggregate Functions: Functions over ground term
(multi)sets
(Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .}
Evaluate Conj w.r.t. an interpretation
Aggregate Atoms: Aggregate Function plus comparison
Important: Aggregate atoms depend on truth values of a set of
standard atoms!
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Aggregates
Aggregate Functions: Functions over ground term
(multi)sets
(Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .}
Evaluate Conj w.r.t. an interpretation
Aggregate Atoms: Aggregate Function plus comparison
Important: Aggregate atoms depend on truth values of a set of
standard atoms!
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Aggregates
Aggregate Functions: Functions over ground term
(multi)sets
(Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .}
Evaluate Conj w.r.t. an interpretation
Aggregate Atoms: Aggregate Function plus comparison
Important: Aggregate atoms depend on truth values of a set of
standard atoms!
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Outline
1 Motivation
2 Basics: Answer Set Programming and Aggregates
3 Semantics
Stratified Aggregates
Unstratified Aggregates
4 Properties
Coincidence Results
Complexity Results
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Aggregate Stratification
Definition
A program P is stratified on an aggregate atom A if there exists
a level mapping || || from its predicates to ordinals, such that for
each rule and for each of its head atoms a the following holds:
1 For each predicate b of standard body literals: ||b|| ≤ ||a||,
2 for each predicate b inside an aggregate body atom:
||b|| < ||a||, and
3 for each predicate b in the head: ||b|| = ||a||.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Aggregate Stratification
Note: Stratification is relative to a program
Unstratified aggregate atoms occur recursively
Example
a :- #count{ t : b } > 0.
is stratified on the aggregate atom.
a :- #count{ t : b } > 0.
b :- a.
is not stratified on the aggregate atom.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Answer Sets for Aggregate-stratified Programs
Basic Idea: Treat aggregate atoms like negative literals
Reduct:
1 Delete rules containing unsatisfied aggregates and
negative literals
2 Delete aggregates and negative literals from all other rules
[Kemp, Stuckey 1991], [Gelfond 2002],
[Dell’Armi, F., Ielpa, Leone, Pfeifer 2003]
Many programs are aggregate stratified
Use of aggregates often yields computational advantages
But: Not all programs are aggregate stratified
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Answer Sets for Aggregate-stratified Programs
Basic Idea: Treat aggregate atoms like negative literals
Reduct:
1 Delete rules containing unsatisfied aggregates and
negative literals
2 Delete aggregates and negative literals from all other rules
[Kemp, Stuckey 1991], [Gelfond 2002],
[Dell’Armi, F., Ielpa, Leone, Pfeifer 2003]
Many programs are aggregate stratified
Use of aggregates often yields computational advantages
But: Not all programs are aggregate stratified
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Answer Sets for Aggregate-stratified Programs
Basic Idea: Treat aggregate atoms like negative literals
Reduct:
1 Delete rules containing unsatisfied aggregates and
negative literals
2 Delete aggregates and negative literals from all other rules
[Kemp, Stuckey 1991], [Gelfond 2002],
[Dell’Armi, F., Ielpa, Leone, Pfeifer 2003]
Many programs are aggregate stratified
Use of aggregates often yields computational advantages
But: Not all programs are aggregate stratified
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Outline
1 Motivation
2 Basics: Answer Set Programming and Aggregates
3 Semantics
Stratified Aggregates
Unstratified Aggregates
4 Properties
Coincidence Results
Complexity Results
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Unstratification
What happens when we consider unstratified aggregates?
Can we just keep the simple semantic definition?
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control
Input: Set of companies and shares companies hold of other
companies.
Output: Companies controlled (direct or indirect shares > 50%)
by other companies
Encoding from the literature:
controlsStk(C1, C1, C2, P) :- ownsStk(C1, C2, P).
controlsStk(C1, C2, C3, P) :- controls(C1, C2), ownsStk(C2, C3, P).
controls(C1, C3) :- company(C1), company(C3),
#sum{P, C2 : controlsStk(C1, C2, C3, P)} > 50.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 1
Example (Company Control, Instance 1)
30%
40%
60%
35%
15%
a
c
d
b
{controlsStk(a,a,b,60),
controlsStk(a,a,c,30),
controlsStk(a,a,d,15),
controlsStk(b,b,d,40),
controlsStk(c,c,d,35),
controlsStk(a,b,d,40),
controls(a,b),
controls(a,d)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 1
Example (Company Control, Instance 1)
30%
40%
60%
35%
15%
a
c
d
b
{controlsStk(a,a,b,60),
controlsStk(a,a,c,30),
controlsStk(a,a,d,15),
controlsStk(b,b,d,40),
controlsStk(c,c,d,35),
controlsStk(a,b,d,40),
controls(a,b),
controls(a,d)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 2
Example (Company Control, Instance 2)
a
cb
40% 40%
20%
20%
{controlsStk(a,a,b,40),
controlsStk(a,a,c,40),
controlsStk(b,b,c,20),
controlsStk(c,c,b,20)}
But also:
{controlsStk(a,b,c,20),
controlsStk(a,c,b,20),
controls(a,b),
controls(a,c)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 2
Example (Company Control, Instance 2)
a
cb
40% 40%
20%
20%
{controlsStk(a,a,b,40),
controlsStk(a,a,c,40),
controlsStk(b,b,c,20),
controlsStk(c,c,b,20)}
But also:
{controlsStk(a,b,c,20),
controlsStk(a,c,b,20),
controls(a,b),
controls(a,c)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 2
Example (Company Control, Instance 2)
a
cb
40% 40%
20%
20%
{controlsStk(a,a,b,40),
controlsStk(a,a,c,40),
controlsStk(b,b,c,20),
controlsStk(c,c,b,20)}
But also:
{controlsStk(a,b,c,20),
controlsStk(a,c,b,20),
controls(a,b),
controls(a,c)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Essence
Example
a :- #count{ t : a } < 1.
No answer sets.
a :- #count{ t : a } > 0.
Answer sets: ∅, {a}?
#count{ t : a } < 1 behaves like not a
#count{ t : a } > 0 behaves like a
⇒ aggregates should not be treated like negative literals, but
also not like positive literals
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Essence
Example
a :- #count{ t : a } < 1.
No answer sets.
a :- #count{ t : a } > 0.
Answer sets: ∅, {a}?
#count{ t : a } < 1 behaves like not a
#count{ t : a } > 0 behaves like a
⇒ aggregates should not be treated like negative literals, but
also not like positive literals
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Monotonicity and Antimonotonicity
Monotone Literals:
truth for interpretation I implies truth for all J ⊇ I
Antimonotone Literals:
truth for interpretation J implies truth for all I ⊆ J
Nonmonotone Literals:
neither monotone nor antimonotone
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Monotonicity: Examples
#count{. . .} ≥ 1 is monotone
#count{. . .} < 1 is antimonotone
#avg{. . .} < 3 is nonmonotone
Positive standard literals are monotone
Negative standard literals are antimonotone
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
FLP Semantics: Novel Reduct Definition
Definition of reduct according to [F.,Leone,Pfeifer 2004, F.,
Leone, Pfeifer 2011]:
Delete rules with a false body literal.
That’s it!
Answer Set: Subset-minimal model of the reduct
Theorem
For aggregate-free programs, answer sets under this definition
coincide with the ones defined in [Gelfond, Lifschitz 1991].
(Mostly) equivalent semantics defined in [Ferraris 2005],
[Ferraris 2011].
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
FLP Semantics: Novel Reduct Definition
Definition of reduct according to [F.,Leone,Pfeifer 2004, F.,
Leone, Pfeifer 2011]:
Delete rules with a false body literal.
That’s it!
Answer Set: Subset-minimal model of the reduct
Theorem
For aggregate-free programs, answer sets under this definition
coincide with the ones defined in [Gelfond, Lifschitz 1991].
(Mostly) equivalent semantics defined in [Ferraris 2005],
[Ferraris 2011].
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
FLP Semantics: Novel Reduct Definition
Definition of reduct according to [F.,Leone,Pfeifer 2004, F.,
Leone, Pfeifer 2011]:
Delete rules with a false body literal.
That’s it!
Answer Set: Subset-minimal model of the reduct
Theorem
For aggregate-free programs, answer sets under this definition
coincide with the ones defined in [Gelfond, Lifschitz 1991].
(Mostly) equivalent semantics defined in [Ferraris 2005],
[Ferraris 2011].
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 1
Example (Company Control, Instance 1)
30%
40%
60%
35%
15%
a
c
d
b
{controlsStk(a,a,b,60),
controlsStk(a,a,c,30),
controlsStk(a,a,d,15),
controlsStk(b,b,d,40),
controlsStk(c,c,d,35),
controlsStk(a,b,d,40),
controls(a,b),
controls(a,d)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 1
Example (Company Control, Instance 1)
30%
40%
60%
35%
15%
a
c
d
b
{controlsStk(a,a,b,60),
controlsStk(a,a,c,30),
controlsStk(a,a,d,15),
controlsStk(b,b,d,40),
controlsStk(c,c,d,35),
controlsStk(a,b,d,40),
controls(a,b),
controls(a,d)}
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 2
Example (Company Control, Instance 2)
a
cb
40% 40%
20%
20%
{controlsStk(a,a,b,40),
controlsStk(a,a,c,40),
controlsStk(b,b,c,20),
controlsStk(c,c,b,20)}
Only this answer set.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Company Control, Instance 2
Example (Company Control, Instance 2)
a
cb
40% 40%
20%
20%
{controlsStk(a,a,b,40),
controlsStk(a,a,c,40),
controlsStk(b,b,c,20),
controlsStk(c,c,b,20)}
Only this answer set.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Small examples
Example
a :- #count{ t : a } < 1.
No answer sets.
a :- #count{ t : a } > 0.
Answer sets: only ∅
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
PSP Semantics
Alternative semantics for unstratified aggregates:
[Pelov 2004], [Son, Pontelli 2007], [Shen, Wang 2012]
Definitions use different operator-based techniques
Evaluate aggregates for a pair of interpretations
(I, J) |= A iff K |= A for all I ⊆ K ⊆ J.
PSP answer sets are those I that are fixpoints of KI
Π ⇑ ∅
Operator KI
Π(X) collects heads of rules for which
(X, I) |= A for all body atoms
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Stratified Aggregates
Unstratified Aggregates
Small examples: PSP
Example
a :- #count{ t : a } < 1.
No answer sets.
K∅
Π(∅) = {a}
K∅
Π({a}) = {a}
K
{a}
Π (∅) = ∅
a :- #count{ t : a } > 0.
Answer sets: only ∅
K∅
Π(∅) = ∅
K
{a}
Π (∅) = ∅
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Outline
1 Motivation
2 Basics: Answer Set Programming and Aggregates
3 Semantics
Stratified Aggregates
Unstratified Aggregates
4 Properties
Coincidence Results
Complexity Results
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
FLP and PSP
Small examples could suggest that they coincide.
But this is not true in general.
Example
p(1) :- #avg{X : p(X)} ≥ 0.
p(1) :- p(−1).
p(−1) :- p(1).
FLP answer sets: {p(1), p(−1)}
PSP answer sets: none
In general: each PSP answer set is also FLP, but not
necessarily vice versa.
Classes on which the semantics coincide?
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Aggregate-stratified Programs
Easy observation:
Theorem
FLP and PSP semantics coincide on aggregate-stratified
programs.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
1 ≤ #count{a, b, c, d}
S is monotone if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
1 ≤ #count{a, b, c, d}
S is monotone if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
#count{a, b, c, d} ≤ 3
S is antimonotone if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
#count{a, b, c, d} ≤ 3
S is antimonotone if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
1 ≤ #count{a, b, c, d} ≤ 3
S is convex if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Monotone, antimonotone, convex
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
{a, b, c, d}
{a, b, c} {a, b, d} {a, c, d} {b, c, d}
{a, b} {a, c} {a, d} {b, c} {b, d} {c, d}
{a} {b} {c} {d}
∅
1 ≤ #count{a, b, c, d} ≤ 3
S is convex if
I |= S ∧ J |= S =⇒
K |= S ∀K ∈ ↑I ∩ ↓J
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Convex Programs
Implicit in [Liu, Truszczy´nski 2006]:
Theorem
FLP and PSP semantics coincide on programs containing only
convex aggregates.
Corollary
FLP and PSP semantics coincide on programs containing only
monotone and antimonotone aggregates.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Outline
1 Motivation
2 Basics: Answer Set Programming and Aggregates
3 Semantics
Stratified Aggregates
Unstratified Aggregates
4 Properties
Coincidence Results
Complexity Results
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Problem
Cautious reasoning over variable-free programs and
polynomial-time computable aggregate functions.
Input: A ground program P and a ground standard atom A.
Output: Is A true in all FLP answer sets of P?
Similar results for related problems (answer set existence,
brave reasoning).
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Problem
Cautious reasoning over variable-free programs and
polynomial-time computable aggregate functions.
Input: A ground program P and a ground standard atom A.
Output: Is A true in all FLP answer sets of P?
Similar results for related problems (answer set existence,
brave reasoning).
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Complexity of Cautious Reasoning
{} {not} {∨} {not, ∨}
{M} P co-NP co-NP ΠP
2
{S} P co-NP ΠP
2 ΠP
2
{C} co-NP co-NP ΠP
2 ΠP
2
{N} ΠP
2 ΠP
2 ΠP
2 ΠP
2
{M}: monotone aggregates {S}: stratified aggregates {C}:
convex aggregates {N}: non-convex aggregates
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Complexity: FLP and PSP
Results for PSP: analogous to FLP
Slight difference for non-convex aggregates [Alviano, F.
2013]:
One non-convex aggregate is sufficient to express any
problem in ΠP
2 with FLP
Arbitrarily many are needed to do the same with PSP
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Only Aggregates?
All of the results presented here also apply to other extensions
of ASP that have constructs that evaluate truth on sets of basic
atoms, for example:
Abstract Constraint Atoms (U, V) [Marek, Remmel 2004]
HEX programs [Eiter et al. 2005]
Nested Expressions [Lifschitz et al. 1999]
Generalized Quantifiers [Lindström 1966]
Cardinality and Weight Constraints [Simons 2000]
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
Summary
Aggregates in ASP
FLP and PSP Semantics
Properties: Coincidence and Complexity
Wolfgang Faber Aggregates in Recursion: Issues and Solutions
Motivation
Basics: Answer Set Programming and Aggregates
Semantics
Properties
Coincidence Results
Complexity Results
More
Beyond FLP and PSP? [Alviano, F. 2015]
Example
a :- #count{a, b}! = 1.
b :- #count{a, b}! = 1.
No FLP, no PSP answer sets! Unintuitive?
Reduce programs with non-convex aggregates to
programs with monotone aggregates in a compact way.
[Alviano, F., Gebser 2015]
System support: results in [Alviano, F., Gebser 2015] allow
for non-convex aggregates in gringo ≥ 4.5.
Wolfgang Faber Aggregates in Recursion: Issues and Solutions

Weitere ähnliche Inhalte

Ähnlich wie Aggregates in Recursion: Issues and Solutions

Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
Janeve George
 
Answer-set programming
Answer-set programmingAnswer-set programming
Answer-set programming
net2-project
 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
Simplilearn
 

Ähnlich wie Aggregates in Recursion: Issues and Solutions (20)

Search and Optimization Strategies
Search and Optimization StrategiesSearch and Optimization Strategies
Search and Optimization Strategies
 
Cis068 08
Cis068 08Cis068 08
Cis068 08
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher Queries
 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher Queries
 
Answer-set programming
Answer-set programmingAnswer-set programming
Answer-set programming
 
language testing and evaluation
language testing and evaluationlanguage testing and evaluation
language testing and evaluation
 
9781285852744 ppt ch15
9781285852744 ppt ch159781285852744 ppt ch15
9781285852744 ppt ch15
 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
 
Efficient Solving Techniques for Answer Set Programming
Efficient Solving Techniques for Answer Set ProgrammingEfficient Solving Techniques for Answer Set Programming
Efficient Solving Techniques for Answer Set Programming
 
An Introduction to Functional Programming at the Jozi Java User Group
An Introduction to Functional Programming at the Jozi Java User GroupAn Introduction to Functional Programming at the Jozi Java User Group
An Introduction to Functional Programming at the Jozi Java User Group
 
An Introduction to Functional Programming - DeveloperUG - 20140311
An Introduction to Functional Programming - DeveloperUG - 20140311An Introduction to Functional Programming - DeveloperUG - 20140311
An Introduction to Functional Programming - DeveloperUG - 20140311
 
Presentation
PresentationPresentation
Presentation
 
Basics of reflection in java
Basics of reflection in javaBasics of reflection in java
Basics of reflection in java
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Tbs910 linear programming
Tbs910 linear programmingTbs910 linear programming
Tbs910 linear programming
 
Functional programming (Let's fall back in love with Programming)
Functional programming (Let's fall back in love with Programming)Functional programming (Let's fall back in love with Programming)
Functional programming (Let's fall back in love with Programming)
 
Portfolio Planning
Portfolio PlanningPortfolio Planning
Portfolio Planning
 
Software Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and MetricsSoftware Measurement: Lecture 1. Measures and Metrics
Software Measurement: Lecture 1. Measures and Metrics
 

Mehr von RuleML

A software agent controlling 2 robot arms in co-operating concurrent tasks
A software agent controlling 2 robot arms in co-operating concurrent tasksA software agent controlling 2 robot arms in co-operating concurrent tasks
A software agent controlling 2 robot arms in co-operating concurrent tasks
RuleML
 

Mehr von RuleML (20)

A software agent controlling 2 robot arms in co-operating concurrent tasks
A software agent controlling 2 robot arms in co-operating concurrent tasksA software agent controlling 2 robot arms in co-operating concurrent tasks
A software agent controlling 2 robot arms in co-operating concurrent tasks
 
Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...
Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...
Port Clearance Rules in PSOA RuleML: From Controlled-English Regulation to Ob...
 
RuleML 2015: When Processes Rule Events
RuleML 2015: When Processes Rule EventsRuleML 2015: When Processes Rule Events
RuleML 2015: When Processes Rule Events
 
RuleML 2015: Ontology Reasoning using Rules in an eHealth Context
RuleML 2015: Ontology Reasoning using Rules in an eHealth ContextRuleML 2015: Ontology Reasoning using Rules in an eHealth Context
RuleML 2015: Ontology Reasoning using Rules in an eHealth Context
 
RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
RuleML 2015: Semantics of Notation3 Logic: A Solution for Implicit Quantifica...
 
Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...
Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...
Challenge@RuleML2015 Developing Situation-Aware Applications for Disaster Man...
 
Rule Generalization Strategies in Incremental Learning of Disjunctive Concepts
Rule Generalization Strategies in Incremental Learning of Disjunctive ConceptsRule Generalization Strategies in Incremental Learning of Disjunctive Concepts
Rule Generalization Strategies in Incremental Learning of Disjunctive Concepts
 
RuleML 2015 Constraint Handling Rules - What Else?
RuleML 2015 Constraint Handling Rules - What Else?RuleML 2015 Constraint Handling Rules - What Else?
RuleML 2015 Constraint Handling Rules - What Else?
 
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
 
RuleML2015 PSOA RuleML: Integrated Object-Relational Data and Rules
RuleML2015 PSOA RuleML: Integrated Object-Relational Data and RulesRuleML2015 PSOA RuleML: Integrated Object-Relational Data and Rules
RuleML2015 PSOA RuleML: Integrated Object-Relational Data and Rules
 
Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...
Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...
Industry@RuleML2015: Norwegian State of Estate A Reporting Service for the St...
 
A Service for Improving the Assignments of Common Agriculture Policy Funds to...
A Service for Improving the Assignments of Common Agriculture Policy Funds to...A Service for Improving the Assignments of Common Agriculture Policy Funds to...
A Service for Improving the Assignments of Common Agriculture Policy Funds to...
 
Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-
Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-
Datalog+-Track Introduction & Reasoning on UML Class Diagrams via Datalog+-
 
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function SymbolsRuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
 
RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge PlatformsRuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
 
RuleML2015: Rule-Based Exploration of Structured Data in the Browser
RuleML2015: Rule-Based Exploration of Structured Data in the BrowserRuleML2015: Rule-Based Exploration of Structured Data in the Browser
RuleML2015: Rule-Based Exploration of Structured Data in the Browser
 
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
RuleML2015: Ontology-Based Multidimensional Contexts with Applications to Qua...
 
RuleML2015: Compact representation of conditional probability for rule-based...
RuleML2015:  Compact representation of conditional probability for rule-based...RuleML2015:  Compact representation of conditional probability for rule-based...
RuleML2015: Compact representation of conditional probability for rule-based...
 
RuleML2015: Learning Characteristic Rules in Geographic Information Systems
RuleML2015: Learning Characteristic Rules in Geographic Information SystemsRuleML2015: Learning Characteristic Rules in Geographic Information Systems
RuleML2015: Learning Characteristic Rules in Geographic Information Systems
 
RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...
RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...
RuleML2015: Using Substitutive Itemset Mining Framework for Finding Synonymou...
 

Kürzlich hochgeladen

Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
NazaninKarimi6
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
Areesha Ahmad
 
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
Scintica Instrumentation
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
MohamedFarag457087
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
1301aanya
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
Silpa
 

Kürzlich hochgeladen (20)

Chemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdfChemistry 5th semester paper 1st Notes.pdf
Chemistry 5th semester paper 1st Notes.pdf
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdf
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical Science
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
 
Digital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptxDigital Dentistry.Digital Dentistryvv.pptx
Digital Dentistry.Digital Dentistryvv.pptx
 
biology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGYbiology HL practice questions IB BIOLOGY
biology HL practice questions IB BIOLOGY
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
 

Aggregates in Recursion: Issues and Solutions

  • 1. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Aggregates in Recursion: Issues and Solutions Wolfgang Faber Alpen-Adria-Universität Klagenfurt RuleML Webinar, 2018-05-25 Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 2. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Outline 1 Motivation 2 Basics: Answer Set Programming and Aggregates 3 Semantics Stratified Aggregates Unstratified Aggregates 4 Properties Coincidence Results Complexity Results Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 3. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Motivation: Aggregates Aggregates facilitate problem representation Standard in database query languages For example: SELECT company.name FROM company,employee WHERE company.id = employee.cid AND COUNT(employee.id) < 10 Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 4. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Motivation: Aggregates and Logic Programming In this talk: Combination of Logic Programming and Aggregates For example: SELECT company.name FROM company,employee WHERE company.id = employee.cid AND COUNT(employee.id) < 10 using Logic Programming (here ASP/Datalog): result(N) :- company(N, Y), #count{X : employee(X, Y)} < 10. Does this look innocent? Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 5. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Recursion A main feature of Logic Programming is recursion Example: tc(A, B) :- p(A, B). tc(A, B) :- p(A, X), tc(X, B). defines the transitive closure of p Supported also in SQL Recent (since SQL-99) Not particularly well-known Common Table Expressions (CTE) Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 6. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Recursion and Aggregates Combination of recursion and aggregates? Explicitly forbidden in SQL! Meaning of p(a) :- #count{X : p(X)} > 0. Meaning of p(a) :- #count{X : p(X)} < 1. Meaning of p(1) :- #avg{X : p(X)}! = 1. p(−1) :- #avg{X : p(X)}! = 1. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 7. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties ASP Semantics Herbrand interpretations Reduct for interpretation I: 1 Delete rules whose negative body is true in I. 2 Delete negative body from all other rules. Interpretations I which are minimal models of the reduct for I are answer sets. [Gelfond, Lifschitz 1988] (nondisjunctive) [Przymusinski 1991] (disjunctive) [Gelfond, Lifschitz 1991] (disjunctive, 2 kinds of negation) Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 8. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties ASP Semantics Herbrand interpretations Reduct for interpretation I: 1 Delete rules whose negative body is true in I. 2 Delete negative body from all other rules. Interpretations I which are minimal models of the reduct for I are answer sets. [Gelfond, Lifschitz 1988] (nondisjunctive) [Przymusinski 1991] (disjunctive) [Gelfond, Lifschitz 1991] (disjunctive, 2 kinds of negation) Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 9. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Aggregates Aggregate Functions: Functions over ground term (multi)sets (Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .} Evaluate Conj w.r.t. an interpretation Aggregate Atoms: Aggregate Function plus comparison Important: Aggregate atoms depend on truth values of a set of standard atoms! Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 10. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Aggregates Aggregate Functions: Functions over ground term (multi)sets (Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .} Evaluate Conj w.r.t. an interpretation Aggregate Atoms: Aggregate Function plus comparison Important: Aggregate atoms depend on truth values of a set of standard atoms! Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 11. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Aggregates Aggregate Functions: Functions over ground term (multi)sets (Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .} Evaluate Conj w.r.t. an interpretation Aggregate Atoms: Aggregate Function plus comparison Important: Aggregate atoms depend on truth values of a set of standard atoms! Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 12. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Aggregates Aggregate Functions: Functions over ground term (multi)sets (Multi)sets specified as {A, B : Conj} or { c, d : Conj , . . .} Evaluate Conj w.r.t. an interpretation Aggregate Atoms: Aggregate Function plus comparison Important: Aggregate atoms depend on truth values of a set of standard atoms! Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 13. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Outline 1 Motivation 2 Basics: Answer Set Programming and Aggregates 3 Semantics Stratified Aggregates Unstratified Aggregates 4 Properties Coincidence Results Complexity Results Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 14. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Aggregate Stratification Definition A program P is stratified on an aggregate atom A if there exists a level mapping || || from its predicates to ordinals, such that for each rule and for each of its head atoms a the following holds: 1 For each predicate b of standard body literals: ||b|| ≤ ||a||, 2 for each predicate b inside an aggregate body atom: ||b|| < ||a||, and 3 for each predicate b in the head: ||b|| = ||a||. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 15. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Aggregate Stratification Note: Stratification is relative to a program Unstratified aggregate atoms occur recursively Example a :- #count{ t : b } > 0. is stratified on the aggregate atom. a :- #count{ t : b } > 0. b :- a. is not stratified on the aggregate atom. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 16. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Answer Sets for Aggregate-stratified Programs Basic Idea: Treat aggregate atoms like negative literals Reduct: 1 Delete rules containing unsatisfied aggregates and negative literals 2 Delete aggregates and negative literals from all other rules [Kemp, Stuckey 1991], [Gelfond 2002], [Dell’Armi, F., Ielpa, Leone, Pfeifer 2003] Many programs are aggregate stratified Use of aggregates often yields computational advantages But: Not all programs are aggregate stratified Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 17. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Answer Sets for Aggregate-stratified Programs Basic Idea: Treat aggregate atoms like negative literals Reduct: 1 Delete rules containing unsatisfied aggregates and negative literals 2 Delete aggregates and negative literals from all other rules [Kemp, Stuckey 1991], [Gelfond 2002], [Dell’Armi, F., Ielpa, Leone, Pfeifer 2003] Many programs are aggregate stratified Use of aggregates often yields computational advantages But: Not all programs are aggregate stratified Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 18. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Answer Sets for Aggregate-stratified Programs Basic Idea: Treat aggregate atoms like negative literals Reduct: 1 Delete rules containing unsatisfied aggregates and negative literals 2 Delete aggregates and negative literals from all other rules [Kemp, Stuckey 1991], [Gelfond 2002], [Dell’Armi, F., Ielpa, Leone, Pfeifer 2003] Many programs are aggregate stratified Use of aggregates often yields computational advantages But: Not all programs are aggregate stratified Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 19. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Outline 1 Motivation 2 Basics: Answer Set Programming and Aggregates 3 Semantics Stratified Aggregates Unstratified Aggregates 4 Properties Coincidence Results Complexity Results Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 20. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Unstratification What happens when we consider unstratified aggregates? Can we just keep the simple semantic definition? Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 21. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control Input: Set of companies and shares companies hold of other companies. Output: Companies controlled (direct or indirect shares > 50%) by other companies Encoding from the literature: controlsStk(C1, C1, C2, P) :- ownsStk(C1, C2, P). controlsStk(C1, C2, C3, P) :- controls(C1, C2), ownsStk(C2, C3, P). controls(C1, C3) :- company(C1), company(C3), #sum{P, C2 : controlsStk(C1, C2, C3, P)} > 50. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 22. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 1 Example (Company Control, Instance 1) 30% 40% 60% 35% 15% a c d b {controlsStk(a,a,b,60), controlsStk(a,a,c,30), controlsStk(a,a,d,15), controlsStk(b,b,d,40), controlsStk(c,c,d,35), controlsStk(a,b,d,40), controls(a,b), controls(a,d)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 23. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 1 Example (Company Control, Instance 1) 30% 40% 60% 35% 15% a c d b {controlsStk(a,a,b,60), controlsStk(a,a,c,30), controlsStk(a,a,d,15), controlsStk(b,b,d,40), controlsStk(c,c,d,35), controlsStk(a,b,d,40), controls(a,b), controls(a,d)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 24. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 2 Example (Company Control, Instance 2) a cb 40% 40% 20% 20% {controlsStk(a,a,b,40), controlsStk(a,a,c,40), controlsStk(b,b,c,20), controlsStk(c,c,b,20)} But also: {controlsStk(a,b,c,20), controlsStk(a,c,b,20), controls(a,b), controls(a,c)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 25. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 2 Example (Company Control, Instance 2) a cb 40% 40% 20% 20% {controlsStk(a,a,b,40), controlsStk(a,a,c,40), controlsStk(b,b,c,20), controlsStk(c,c,b,20)} But also: {controlsStk(a,b,c,20), controlsStk(a,c,b,20), controls(a,b), controls(a,c)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 26. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 2 Example (Company Control, Instance 2) a cb 40% 40% 20% 20% {controlsStk(a,a,b,40), controlsStk(a,a,c,40), controlsStk(b,b,c,20), controlsStk(c,c,b,20)} But also: {controlsStk(a,b,c,20), controlsStk(a,c,b,20), controls(a,b), controls(a,c)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 27. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Essence Example a :- #count{ t : a } < 1. No answer sets. a :- #count{ t : a } > 0. Answer sets: ∅, {a}? #count{ t : a } < 1 behaves like not a #count{ t : a } > 0 behaves like a ⇒ aggregates should not be treated like negative literals, but also not like positive literals Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 28. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Essence Example a :- #count{ t : a } < 1. No answer sets. a :- #count{ t : a } > 0. Answer sets: ∅, {a}? #count{ t : a } < 1 behaves like not a #count{ t : a } > 0 behaves like a ⇒ aggregates should not be treated like negative literals, but also not like positive literals Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 29. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Monotonicity and Antimonotonicity Monotone Literals: truth for interpretation I implies truth for all J ⊇ I Antimonotone Literals: truth for interpretation J implies truth for all I ⊆ J Nonmonotone Literals: neither monotone nor antimonotone Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 30. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Monotonicity: Examples #count{. . .} ≥ 1 is monotone #count{. . .} < 1 is antimonotone #avg{. . .} < 3 is nonmonotone Positive standard literals are monotone Negative standard literals are antimonotone Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 31. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates FLP Semantics: Novel Reduct Definition Definition of reduct according to [F.,Leone,Pfeifer 2004, F., Leone, Pfeifer 2011]: Delete rules with a false body literal. That’s it! Answer Set: Subset-minimal model of the reduct Theorem For aggregate-free programs, answer sets under this definition coincide with the ones defined in [Gelfond, Lifschitz 1991]. (Mostly) equivalent semantics defined in [Ferraris 2005], [Ferraris 2011]. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 32. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates FLP Semantics: Novel Reduct Definition Definition of reduct according to [F.,Leone,Pfeifer 2004, F., Leone, Pfeifer 2011]: Delete rules with a false body literal. That’s it! Answer Set: Subset-minimal model of the reduct Theorem For aggregate-free programs, answer sets under this definition coincide with the ones defined in [Gelfond, Lifschitz 1991]. (Mostly) equivalent semantics defined in [Ferraris 2005], [Ferraris 2011]. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 33. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates FLP Semantics: Novel Reduct Definition Definition of reduct according to [F.,Leone,Pfeifer 2004, F., Leone, Pfeifer 2011]: Delete rules with a false body literal. That’s it! Answer Set: Subset-minimal model of the reduct Theorem For aggregate-free programs, answer sets under this definition coincide with the ones defined in [Gelfond, Lifschitz 1991]. (Mostly) equivalent semantics defined in [Ferraris 2005], [Ferraris 2011]. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 34. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 1 Example (Company Control, Instance 1) 30% 40% 60% 35% 15% a c d b {controlsStk(a,a,b,60), controlsStk(a,a,c,30), controlsStk(a,a,d,15), controlsStk(b,b,d,40), controlsStk(c,c,d,35), controlsStk(a,b,d,40), controls(a,b), controls(a,d)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 35. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 1 Example (Company Control, Instance 1) 30% 40% 60% 35% 15% a c d b {controlsStk(a,a,b,60), controlsStk(a,a,c,30), controlsStk(a,a,d,15), controlsStk(b,b,d,40), controlsStk(c,c,d,35), controlsStk(a,b,d,40), controls(a,b), controls(a,d)} Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 36. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 2 Example (Company Control, Instance 2) a cb 40% 40% 20% 20% {controlsStk(a,a,b,40), controlsStk(a,a,c,40), controlsStk(b,b,c,20), controlsStk(c,c,b,20)} Only this answer set. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 37. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Company Control, Instance 2 Example (Company Control, Instance 2) a cb 40% 40% 20% 20% {controlsStk(a,a,b,40), controlsStk(a,a,c,40), controlsStk(b,b,c,20), controlsStk(c,c,b,20)} Only this answer set. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 38. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Small examples Example a :- #count{ t : a } < 1. No answer sets. a :- #count{ t : a } > 0. Answer sets: only ∅ Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 39. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates PSP Semantics Alternative semantics for unstratified aggregates: [Pelov 2004], [Son, Pontelli 2007], [Shen, Wang 2012] Definitions use different operator-based techniques Evaluate aggregates for a pair of interpretations (I, J) |= A iff K |= A for all I ⊆ K ⊆ J. PSP answer sets are those I that are fixpoints of KI Π ⇑ ∅ Operator KI Π(X) collects heads of rules for which (X, I) |= A for all body atoms Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 40. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Stratified Aggregates Unstratified Aggregates Small examples: PSP Example a :- #count{ t : a } < 1. No answer sets. K∅ Π(∅) = {a} K∅ Π({a}) = {a} K {a} Π (∅) = ∅ a :- #count{ t : a } > 0. Answer sets: only ∅ K∅ Π(∅) = ∅ K {a} Π (∅) = ∅ Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 41. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Outline 1 Motivation 2 Basics: Answer Set Programming and Aggregates 3 Semantics Stratified Aggregates Unstratified Aggregates 4 Properties Coincidence Results Complexity Results Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 42. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results FLP and PSP Small examples could suggest that they coincide. But this is not true in general. Example p(1) :- #avg{X : p(X)} ≥ 0. p(1) :- p(−1). p(−1) :- p(1). FLP answer sets: {p(1), p(−1)} PSP answer sets: none In general: each PSP answer set is also FLP, but not necessarily vice versa. Classes on which the semantics coincide? Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 43. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Aggregate-stratified Programs Easy observation: Theorem FLP and PSP semantics coincide on aggregate-stratified programs. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 44. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ 1 ≤ #count{a, b, c, d} S is monotone if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 45. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ 1 ≤ #count{a, b, c, d} S is monotone if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 46. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ #count{a, b, c, d} ≤ 3 S is antimonotone if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 47. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ #count{a, b, c, d} ≤ 3 S is antimonotone if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 48. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ 1 ≤ #count{a, b, c, d} ≤ 3 S is convex if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 49. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Monotone, antimonotone, convex Wolfgang Faber Aggregates in Recursion: Issues and Solutions {a, b, c, d} {a, b, c} {a, b, d} {a, c, d} {b, c, d} {a, b} {a, c} {a, d} {b, c} {b, d} {c, d} {a} {b} {c} {d} ∅ 1 ≤ #count{a, b, c, d} ≤ 3 S is convex if I |= S ∧ J |= S =⇒ K |= S ∀K ∈ ↑I ∩ ↓J
  • 50. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Convex Programs Implicit in [Liu, Truszczy´nski 2006]: Theorem FLP and PSP semantics coincide on programs containing only convex aggregates. Corollary FLP and PSP semantics coincide on programs containing only monotone and antimonotone aggregates. Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 51. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Outline 1 Motivation 2 Basics: Answer Set Programming and Aggregates 3 Semantics Stratified Aggregates Unstratified Aggregates 4 Properties Coincidence Results Complexity Results Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 52. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Problem Cautious reasoning over variable-free programs and polynomial-time computable aggregate functions. Input: A ground program P and a ground standard atom A. Output: Is A true in all FLP answer sets of P? Similar results for related problems (answer set existence, brave reasoning). Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 53. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Problem Cautious reasoning over variable-free programs and polynomial-time computable aggregate functions. Input: A ground program P and a ground standard atom A. Output: Is A true in all FLP answer sets of P? Similar results for related problems (answer set existence, brave reasoning). Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 54. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Complexity of Cautious Reasoning {} {not} {∨} {not, ∨} {M} P co-NP co-NP ΠP 2 {S} P co-NP ΠP 2 ΠP 2 {C} co-NP co-NP ΠP 2 ΠP 2 {N} ΠP 2 ΠP 2 ΠP 2 ΠP 2 {M}: monotone aggregates {S}: stratified aggregates {C}: convex aggregates {N}: non-convex aggregates Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 55. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Complexity: FLP and PSP Results for PSP: analogous to FLP Slight difference for non-convex aggregates [Alviano, F. 2013]: One non-convex aggregate is sufficient to express any problem in ΠP 2 with FLP Arbitrarily many are needed to do the same with PSP Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 56. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Only Aggregates? All of the results presented here also apply to other extensions of ASP that have constructs that evaluate truth on sets of basic atoms, for example: Abstract Constraint Atoms (U, V) [Marek, Remmel 2004] HEX programs [Eiter et al. 2005] Nested Expressions [Lifschitz et al. 1999] Generalized Quantifiers [Lindström 1966] Cardinality and Weight Constraints [Simons 2000] Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 57. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results Summary Aggregates in ASP FLP and PSP Semantics Properties: Coincidence and Complexity Wolfgang Faber Aggregates in Recursion: Issues and Solutions
  • 58. Motivation Basics: Answer Set Programming and Aggregates Semantics Properties Coincidence Results Complexity Results More Beyond FLP and PSP? [Alviano, F. 2015] Example a :- #count{a, b}! = 1. b :- #count{a, b}! = 1. No FLP, no PSP answer sets! Unintuitive? Reduce programs with non-convex aggregates to programs with monotone aggregates in a compact way. [Alviano, F., Gebser 2015] System support: results in [Alviano, F., Gebser 2015] allow for non-convex aggregates in gringo ≥ 4.5. Wolfgang Faber Aggregates in Recursion: Issues and Solutions