Professional Documents
Culture Documents
Torsten Schaub1
University of Potsdam
torsten@cs.uni-potsdam.de
Potassco Slide Packages are licensed under a Creative Commons Zero v1.0 Universal License.
1
Standing on the shoulders of a great research group and community!
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 1 / 359
Axiomatic characterization: Overview
1 Completion
2 Tightness
3 Loops and Loop Formulas
4 Summary
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 213 / 359
What is a stable model?
Reduct-based characterization
Logical characterization
Axiomatic characterization
Operational characterization
Proof-theoretic characterization
Constraint-based characterization
Algorithmic characterization
C++-based characterization
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 214 / 359
What is a stable model?
Reduct-based characterization
Logical characterization
Axiomatic characterization
Operational characterization
Proof-theoretic characterization
Constraint-based characterization
Algorithmic characterization
C++-based characterization
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 214 / 359
Completion
Outline
1 Completion
2 Tightness
3 Loops and Loop Formulas
4 Summary
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 215 / 359
Completion
Motivation
Clark’s Idea
The idea of program completion is to turn such implications into a
definition by adding the corresponding necessary counterpart
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 216 / 359
Completion
Motivation
Clark’s Idea
The idea of program completion is to turn such implications into a
definition by adding the corresponding necessary counterpart
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 216 / 359
Completion
Motivation
Clark’s Idea
The idea of program completion is to turn such implications into a
definition by adding the corresponding necessary counterpart
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 216 / 359
Completion
Program completion
where V V
BF (B(r )) = a∈B(r )+ a ∧ a∈B(r )− ¬a
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 217 / 359
Completion
An example
a←
a↔>
b ← ¬a
b ↔ ¬a
c ← a, ¬d c ↔ a ∧ ¬d
P= CF (P) =
d ← ¬c, ¬e
d ↔ ¬c ∧ ¬e
e ← b, ¬f e ↔ (b ∧ ¬f ) ∨ e
e←e f ↔⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 218 / 359
Completion
An example
a←
a↔>
b ← ¬a
b ↔ ¬a
c ← a, ¬d c ↔ a ∧ ¬d
P= CF (P) =
d ← ¬c, ¬e
d ↔ ¬c ∧ ¬e
e ← b, ¬f e ↔ (b ∧ ¬f ) ∨ e
e←e f ↔⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 218 / 359
Completion
A closer look
←− −→
CF (P) is equivalent to CF (P) ∪ CF (P), where
←− n W o
CF (P) = a ← r ∈P,h(r )=a BF (B(r )) | a ∈ A(P)
−→ n W o
CF (P) = a → r ∈P,h(r )=a BF (B(r )) | a ∈ A(P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 219 / 359
Completion
A closer look
←− −→
CF (P) is equivalent to CF (P) ∪ CF (P), where
←− n W o
CF (P) = a ← B∈BP (a) BF (B) | a ∈ A(P)
−→ n W o
CF (P) = a → B∈BP (a) BF (B) | a ∈ A(P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 219 / 359
Completion
A closer look
←− −→
CF (P) is equivalent to CF (P) ∪ CF (P), where
←− n W o
CF (P) = a ← B∈BP (a) BF (B) | a ∈ A(P)
−→ n W o
CF (P) = a → B∈BP (a) BF (B) | a ∈ A(P)
←−
CF (P) characterizes the models of P, providing sufficient conditions
−→
CF (P) completes P by adding necessary conditions for all atoms
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 219 / 359
Completion
A closer look
a←
b ← ¬a
c ← a, ¬d
P=
d ← ¬c, ¬e
e ← b, ¬f
e←e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
A closer look
a←
a←>
b ← ¬a
b ← ¬a
c ← a, ¬d
←−
c ← a ∧ ¬d
P= CF (P) =
d ← ¬c, ¬e
d ← ¬c ∧ ¬e
e ← b, ¬f e ← (b ∧ ¬f ) ∨ e
e←e f ←⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
A closer look
a←>
b ← ¬a
←−
c ← a ∧ ¬d
CF (P) =
d ← ¬c ∧ ¬e
e ← (b ∧ ¬f ) ∨ e
f ←⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
A closer look
a←>
a→>
b ← ¬a
b → ¬a
←−
−→
c ← a ∧ ¬d c → a ∧ ¬d
CF (P) = = CF (P)
d ← ¬c ∧ ¬e
d → ¬c ∧ ¬e
e ← (b ∧ ¬f ) ∨ e e → (b ∧ ¬f ) ∨ e
f ←⊥ f →⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
A closer look
a←>
a→>
b ← ¬a
b → ¬a
←−
−→
c ← a ∧ ¬d c → a ∧ ¬d
CF (P) = = CF (P)
d ← ¬c ∧ ¬e
d → ¬c ∧ ¬e
e ← (b ∧ ¬f ) ∨ e e → (b ∧ ¬f ) ∨ e
f ←⊥ f →⊥
a↔>
b ↔ ¬a
c ↔ a ∧ ¬d
CF (P) =
d ↔ ¬c ∧ ¬e
e ↔ (b ∧ ¬f ) ∨ e
f ↔⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
A closer look
a←>
a→>
b ← ¬a
b → ¬a
←−
−→
c ← a ∧ ¬d c → a ∧ ¬d
CF (P) = = CF (P)
d ← ¬c ∧ ¬e
d → ¬c ∧ ¬e
e ← (b ∧ ¬f ) ∨ e e → (b ∧ ¬f ) ∨ e
f ←⊥ f →⊥
a↔>
b ↔ ¬a
c ↔ a ∧ ¬d
←− −→
CF (P) = ≡ CF (P) ∪ CF (P)
d ↔ ¬c ∧ ¬e
e ↔ (b ∧ ¬f ) ∨ e
f ↔⊥
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 220 / 359
Completion
Supported models
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 221 / 359
Completion
Supported models
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 221 / 359
Completion
Supported models
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 221 / 359
Completion
Supported models
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 221 / 359
Completion
An example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
P has 21 models, including {a, c}, {a, d}, but also {a, b, c, d, e, f }
P has 3 supported models, namely {a, c}, {a, d}, and {a, c, e}
P has 2 stable models, namely {a, c} and {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 222 / 359
Completion
An example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
P has 21 models, including {a, c}, {a, d}, but also {a, b, c, d, e, f }
P has 3 supported models, namely {a, c}, {a, d}, and {a, c, e}
P has 2 stable models, namely {a, c} and {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 222 / 359
Completion
An example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
P has 21 models, including {a, c}, {a, d}, but also {a, b, c, d, e, f }
P has 3 supported models, namely {a, c}, {a, d}, and {a, c, e}
P has 2 stable models, namely {a, c} and {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 222 / 359
Completion
An example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
P has 21 models, including {a, c}, {a, d}, but also {a, b, c, d, e, f }
P has 3 supported models, namely {a, c}, {a, d}, and {a, c, e}
P has 2 stable models, namely {a, c} and {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 222 / 359
Tightness
Outline
1 Completion
2 Tightness
3 Loops and Loop Formulas
4 Summary
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 223 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
4
unless being “supported from outside the cycle”
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
The mismatch
Question What causes the mismatch between supported
and stable models?
å Consider the unstable yet supported model {a, c, e} above !
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 224 / 359
Tightness
Non-cyclic derivations
Let X be a stable model of normal logic program P
hr1 , . . . , rn i
such that
1 ri ∈ P X for 1 ≤ i ≤ n
+
2 B(ri ) ⊆ {h(rj ) | 0 ≤ j < i} for 1 ≤ i ≤ n
3 h(rn ) = a
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 225 / 359
Tightness
Non-cyclic derivations
Let X be a stable model of normal logic program P
hr1 , . . . , rn i
such that
1 ri ∈ P X for 1 ≤ i ≤ n
+
2 B(ri ) ⊆ {h(rj ) | 0 ≤ j < i} for 1 ≤ i ≤ n
3 h(rn ) = a
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 225 / 359
Tightness
Non-cyclic derivations
Let X be a stable model of normal logic program P
hr1 , . . . , rn i
such that
1 ri ∈ P X for 1 ≤ i ≤ n
+
2 B(ri ) ⊆ {h(rj ) | 0 ≤ j < i} for 1 ≤ i ≤ n
3 h(rn ) = a
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 225 / 359
Tightness
Non-cyclic derivations
Let X be a stable model of normal logic program P
hr1 , . . . , rn i
such that
1 ri ∈ P X for 1 ≤ i ≤ n
+
2 B(ri ) ⊆ {h(rj ) | 0 ≤ j < i} for 1 ≤ i ≤ n
3 h(rn ) = a
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 225 / 359
Tightness
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 226 / 359
Tightness
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 226 / 359
Tightness
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 226 / 359
Tightness
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 227 / 359
Tightness
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 227 / 359
Tightness
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 227 / 359
Tightness
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 227 / 359
Tightness
Fages’ Theorem
Let P be a tight normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= CF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 228 / 359
Tightness
Fages’ Theorem
Let P be a tight normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= CF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 228 / 359
Tightness
Fages’ Theorem
Let P be a tight normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= CF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 228 / 359
Tightness
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
G (P) = ({a, b, c, d, e}, {(a, c), (a, d), (b, c), (b, d), (c, d), (d, c)})
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 229 / 359
Tightness
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
G (P) = ({a, b, c, d, e}, {(a, c), (a, d), (b, c), (b, d), (c, d), (d, c)})
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 229 / 359
Tightness
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
G (P) = ({a, b, c, d, e}, {(a, c), (a, d), (b, c), (b, d), (c, d), (d, c)})
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 229 / 359
Tightness
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
G (P) = ({a, b, c, d, e}, {(a, c), (a, d), (b, c), (b, d), (c, d), (d, c)})
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 229 / 359
Loops and Loop Formulas
Outline
1 Completion
2 Tightness
3 Loops and Loop Formulas
4 Summary
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 230 / 359
Loops and Loop Formulas
Motivation
Question Is there a propositional formula F (P) such that
the models of F (P) correspond to the stable models of P ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 231 / 359
Loops and Loop Formulas
Motivation
Question Is there a propositional formula F (P) such that
the models of F (P) correspond to the stable models of P ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 231 / 359
Loops and Loop Formulas
Motivation
Question Is there a propositional formula F (P) such that
the models of F (P) correspond to the stable models of P ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 231 / 359
Loops and Loop Formulas
Motivation
Question Is there a propositional formula F (P) such that
the models of F (P) correspond to the stable models of P ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 231 / 359
Loops and Loop Formulas
Loops
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 232 / 359
Loops and Loop Formulas
Loops
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 232 / 359
Loops and Loop Formulas
Loops
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 232 / 359
Loops and Loop Formulas
Loops
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 232 / 359
Loops and Loop Formulas
Loops
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 232 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P =
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 233 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P =
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 233 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P =
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 233 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P {a,c,e} =
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 233 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P =
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 233 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 234 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 234 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 234 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P {b,c,d} =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 234 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 234 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 235 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 235 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 235 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Loop formulas
Let P be a normal logic program
For L ⊆ A(P), define the external supports of L for P as
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 236 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
LF (P) = {e → b ∧ ¬f }
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 237 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
Loop(P) = {{e}}
LF (P) = {e → b ∧ ¬f }
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 237 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
ESP ({c, d}) =
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 238 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 239 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 239 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 239 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 239 / 359
Loops and Loop Formulas
a c d e
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 239 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has stable models: {a, c}, {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has stable models: {a, c}, {a, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, c} |= e → b ∧ ¬f ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, c} |= e → b ∧ ¬f 4
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, d} |= e → b ∧ ¬f ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, d} |= e → b ∧ ¬f 4
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, c, e} |= e → b ∧ ¬f ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Example
a← c ← a, ¬d e ← b, ¬f
P=
b ← ¬a d ← ¬c, ¬e e←e
a c d
b e f
LF (P) = {e → b ∧ ¬f }
P has supported models: {a, c}, {a, d}, and {a, c, e}
{a, c, e} 6|= e → b ∧ ¬f 8
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 240 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has stable models: {a, c, d}, {b}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has stable models: {a, c, d}, {b}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{a, c, d} |= c ∨ d → (a ∧ b) ∨ a ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{a, c, d} |= c ∨ d → (a ∧ b) ∨ a 4
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{b} |= c ∨ d → (a ∧ b) ∨ a ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{b} |= c ∨ d → (a ∧ b) ∨ a 4
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{b, c, d} |= c ∨ d → (a ∧ b) ∨ a ?
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Another example
a ← ¬b c ← a, b d ← a e ← ¬a, ¬b
P=
b ← ¬a c ← d d ← b, c
d a c e
LF (P) = {c ∨ d → (a ∧ b) ∨ a}
P has supported models: {a, c, d}, {b}, and {b, c, d}
{b, c, d} 6|= c ∨ d → (a ∧ b) ∨ a 8
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 241 / 359
Loops and Loop Formulas
Logic programs
Lin-Zhao Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= CF (P) ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 242 / 359
Loops and Loop Formulas
Properties
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 243 / 359
Loops and Loop Formulas
Properties
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 243 / 359
Loops and Loop Formulas
Properties
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 243 / 359
Loops and Loop Formulas
Properties
4
Such that the stable models of the program coincide with the models of the formula
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 244 / 359
Loops and Loop Formulas
Properties
4
Such that the stable models of the program coincide with the models of the formula
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 244 / 359
Loops and Loop Formulas
Properties
4
Such that the stable models of the program coincide with the models of the formula
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 244 / 359
Loops and Loop Formulas
Loops reloaded
Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= P ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 245 / 359
Loops and Loop Formulas
Loops reloaded
Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= P ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 245 / 359
Loops and Loop Formulas
Loops reloaded
Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= P ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 245 / 359
Loops and Loop Formulas
Loops reloaded
Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= P ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 245 / 359
Loops and Loop Formulas
Loops reloaded
Theorem
Let P be a normal logic program and X ⊆ A(P)
Then, X is a stable model of P iff X |= P ∪ LF (P)
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 245 / 359
Summary
Outline
1 Completion
2 Tightness
3 Loops and Loop Formulas
4 Summary
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 246 / 359
Summary
Things to remember
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 247 / 359
Auf Wiedersehen!
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 358 / 359
Bibliography
https://github.com/krr-up/bibliography
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
[15] F. Calimeri et al. “The Design of the Fifth Answer Set Programming
Competition”. In: Technical Communications of the Thirtieth
International Conference on Logic Programming (ICLP’14). Ed. by
M. Leuschel and T. Schrijvers. Vol. arXiv:1405.3710v4. Theory and
Practice of Logic Programming, Online Supplement. 2014. url:
http://arxiv.org/abs/1405.3710v4.
[16] F. Calimeri et al. “The Third Answer Set Programming
Competition: Preliminary Report of the System Competition Track”.
In: Proceedings of the Eleventh International Conference on Logic
Programming and Nonmonotonic Reasoning (LPNMR’11). Ed. by
J. Delgrande and W. Faber. Vol. 6645. Lecture Notes in Artificial
Intelligence. Springer-Verlag, 2011, pp. 388–403.
[17] M. D’Agostino et al., eds. Handbook of Tableau Methods. Kluwer
Academic Publishers, 1999.
[18] J. Delgrande and W. Faber, eds. Proceedings of the Eleventh
International Conference on Logic Programming and Nonmonotonic
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
References
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359
[55] T. Syrjänen. “Omega-Restricted Logic Programs”. In: Proceedings
of the Sixth International Conference on Logic Programming and
Nonmonotonic Reasoning (LPNMR’01). Ed. by T. Eiter, W. Faber,
and M. Truszczyński. Vol. 2173. Lecture Notes in Computer Science.
Springer-Verlag, 2001, pp. 267–279.
[56] M. Truszczyński. “An introduction to the stable and well-founded
semantics of logic programs”. In: Declarative Logic Programming:
Theory, Systems, and Applications. Ed. by M. Kifer and Y. Liu.
ACM / Morgan & Claypool, 2018, pp. 121–177.
[57] A. Van Gelder, K. Ross, and J. Schlipf. “The Well-Founded
Semantics for General Logic Programs”. In: Journal of the ACM
38.3 (1991), pp. 620–650.
Torsten Schaub (KRR@UP) Answer Set Solving in Practice January 6, 2021 359 / 359