Liberal Safety for Answer Set Programs with External Sources Thomas - - PowerPoint PPT Presentation

liberal safety for answer set programs with external
SMART_READER_LITE
LIVE PREVIEW

Liberal Safety for Answer Set Programs with External Sources Thomas - - PowerPoint PPT Presentation

Liberal Safety for Answer Set Programs with External Sources Thomas Eiter, Michael Fink, Thomas Krennwallner, Christoph Redl { eiter,fink,tkren,redl } @kr.tuwien.ac.at July 16, 2013 Redl C. (TU Vienna) HEX-Programs July 16, 2013 1 / 10


slide-1
SLIDE 1

Liberal Safety for Answer Set Programs with External Sources

Thomas Eiter, Michael Fink, Thomas Krennwallner, Christoph Redl

{eiter,fink,tkren,redl}@kr.tuwien.ac.at

July 16, 2013

Redl C. (TU Vienna) HEX-Programs July 16, 2013 1 / 10

slide-2
SLIDE 2

Motivation

HEX-Programs

Extend ASP by external sources Traditional safety not sufficient due to value invention Current notion of strong safety is unnecessarily restrictive

Example

Π=

  • r1 : t(a).

r3 : s(Y) ← t(X), & cat[X, a](Y). r2 : dom(aa). r4 : t(X) ← s(X), dom(X).

  • Contribution

New more liberal safety criteria Still guarantee finite groundability Based on a modular framework ⇒ extensibility of the approach

Redl C. (TU Vienna) HEX-Programs July 16, 2013 2 / 10

slide-3
SLIDE 3

Liberal Safety: Basic Concepts

Monotone Grounding Operator

GΠ(Π′) =

r∈Π{rθ | A ⊆ A(Π′), A |

= ⊥, A | = B+(rθ)}, where A(Π′) = {Ta, Fa | a ∈ A(Π′)} \ {Fa | a ← . ∈ Π} and rθ is the instance of r under variable substitution θ:V → C.

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). Least fixpoint of GΠ: r′

1 :

s(a). r′

2 : dom(ax).

r′

3 : dom(axx).

Redl C. (TU Vienna) HEX-Programs July 16, 2013 3 / 10

slide-4
SLIDE 4

Liberal Safety: Basic Concepts

Monotone Grounding Operator

GΠ(Π′) =

r∈Π{rθ | A ⊆ A(Π′), A |

= ⊥, A | = B+(rθ)}, where A(Π′) = {Ta, Fa | a ∈ A(Π′)} \ {Fa | a ← . ∈ Π} and rθ is the instance of r under variable substitution θ:V → C.

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). Least fixpoint of GΠ: r′

1 :

s(a). r′

2 : dom(ax).

r′

3 : dom(axx).

r′

4 : s(ax) ← s(a), &

cat[a, x](ax), dom(ax).

Redl C. (TU Vienna) HEX-Programs July 16, 2013 3 / 10

slide-5
SLIDE 5

Liberal Safety: Basic Concepts

Monotone Grounding Operator

GΠ(Π′) =

r∈Π{rθ | A ⊆ A(Π′), A |

= ⊥, A | = B+(rθ)}, where A(Π′) = {Ta, Fa | a ∈ A(Π′)} \ {Fa | a ← . ∈ Π} and rθ is the instance of r under variable substitution θ:V → C.

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). Least fixpoint of GΠ: r′

1 :

s(a). r′

2 : dom(ax).

r′

3 : dom(axx).

r′

4 : s(ax) ← s(a), &

cat[a, x](ax), dom(ax). r′

5 : s(axx) ← s(ax), &

cat[ax, x](axx), dom(axx).

Redl C. (TU Vienna) HEX-Programs July 16, 2013 3 / 10

slide-6
SLIDE 6

Liberal Safety: Basic Concepts

Monotone Grounding Operator

GΠ(Π′) =

r∈Π{rθ | A ⊆ A(Π′), A |

= ⊥, A | = B+(rθ)}, where A(Π′) = {Ta, Fa | a ∈ A(Π′)} \ {Fa | a ← . ∈ Π} and rθ is the instance of r under variable substitution θ:V → C.

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). Least fixpoint of GΠ: r′

1 :

s(a). r′

2 : dom(ax).

r′

3 : dom(axx).

r′

4 : s(ax) ← s(a), &

cat[a, x](ax), dom(ax). r′

5 : s(axx) ← s(ax), &

cat[ax, x](axx), dom(axx). Intuition: We call a program safe if this operator produces a finite grounding

Redl C. (TU Vienna) HEX-Programs July 16, 2013 3 / 10

slide-7
SLIDE 7

Liberal Safety

Two concepts

A term is bounded if GΠ(Π′) contains only finitely many substitutions for it An attribute is de-safe if GΠ(Π′) contains only finitely many values at this attribute position

Idea

1 Start with empty set of bounded terms B0 and de-safe attributes S0 2 For all n ≥ 0 until Bn and Sn do not change anymore

a Identify additional bounded terms ⇒ Bn+1 (assuming that Bn are bounded and Sn are de-safe) b Identify additional de-safe attributes ⇒ Sn+1 (assuming that Bn+1 are bounded and Sn are de-safe)

Redl C. (TU Vienna) HEX-Programs July 16, 2013 4 / 10

slide-8
SLIDE 8

Liberal Safety

Two concepts

A term is bounded if GΠ(Π′) contains only finitely many substitutions for it An attribute is de-safe if GΠ(Π′) contains only finitely many values at this attribute position

Idea

1 Start with empty set of bounded terms B0 and de-safe attributes S0 2 For all n ≥ 0 until Bn and Sn do not change anymore

a Identify additional bounded terms ⇒ Bn+1 (assuming that Bn are bounded and Sn are de-safe) b Identify additional de-safe attributes ⇒ Sn+1 (assuming that Bn+1 are bounded and Sn are de-safe)

Identification of bounded terms in Step 2a by term bounding functions (TBFs) Concrete safety criteria can be plugged in by specific TBF b(Π, r, S, B)

Redl C. (TU Vienna) HEX-Programs July 16, 2013 4 / 10

slide-9
SLIDE 9

Liberal Safety

Two concepts

A term is bounded if GΠ(Π′) contains only finitely many substitutions for it An attribute is de-safe if GΠ(Π′) contains only finitely many values at this attribute position

Idea

1 Start with empty set of bounded terms B0 and de-safe attributes S0 2 For all n ≥ 0 until Bn and Sn do not change anymore

a Identify additional bounded terms ⇒ Bn+1 (assuming that Bn are bounded and Sn are de-safe) b Identify additional de-safe attributes ⇒ Sn+1 (assuming that Bn+1 are bounded and Sn are de-safe)

Identification of bounded terms in Step 2a by term bounding functions (TBFs) Concrete safety criteria can be plugged in by specific TBF b(Π, r, S, B) ⇒ TBFs are a flexible means that however must fulfill certain conditions

Redl C. (TU Vienna) HEX-Programs July 16, 2013 4 / 10

slide-10
SLIDE 10

Liberal Safety: Concrete TBF

Definition (Syntactic Term Bounding Function)

t ∈ bsyn(Π, r, S, B) iff (i) t is a constant in r; or (ii) there is an ordinary atom q(s1, . . . , sar(q)) ∈ B+(r) s.t. t = sj, for some 1 ≤ j ≤ ar(q) and q↾j ∈ S; or (iii) for some external atom & g[ X]( Y) ∈ B+(r), we have that t = Yi for some Yi ∈ Y, and for each Xi ∈ X,

  • Xi ∈ B,

if τ(& g, i) = const, Xi↾1, . . . , Xi↾ar(Xi) ∈ S, if τ(& g, i) = pred.

Redl C. (TU Vienna) HEX-Programs July 16, 2013 5 / 10

slide-11
SLIDE 11

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x}

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-12
SLIDE 12

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2}

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-13
SLIDE 13

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2} B2(r4, Π, bsyn) = {Y}, B2(r1, Π, bsyn) = {a}

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-14
SLIDE 14

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2} B2(r4, Π, bsyn) = {Y}, B2(r1, Π, bsyn) = {a} ⇒ S2(Π) ⊇ {s↾1, & cat[X, x]r4↾O1}

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-15
SLIDE 15

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2} B2(r4, Π, bsyn) = {Y}, B2(r1, Π, bsyn) = {a} ⇒ S2(Π) ⊇ {s↾1, & cat[X, x]r4↾O1} X ∈ B3(r4, Π, bsyn)

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-16
SLIDE 16

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2} B2(r4, Π, bsyn) = {Y}, B2(r1, Π, bsyn) = {a} ⇒ S2(Π) ⊇ {s↾1, & cat[X, x]r4↾O1} X ∈ B3(r4, Π, bsyn) ⇒ & cat[X, x]r4↾I1 ∈ S3(Π)

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-17
SLIDE 17

Liberal Safety: Concrete TBF

Example

Program Π: r1 :s(a). r2 : dom(ax). r3 : dom(axx). r4 :s(Y) ← s(X), & cat[X, x](Y), dom(Y). B1(r2, Π, bsyn) = {ax}, B1(r3, Π, bsyn) = {axx}, B1(r4, Π, bsyn) = {x} ⇒ S1(Π) = {dom↾1, & cat[X, x]r4↾I2} B2(r4, Π, bsyn) = {Y}, B2(r1, Π, bsyn) = {a} ⇒ S2(Π) ⊇ {s↾1, & cat[X, x]r4↾O1} X ∈ B3(r4, Π, bsyn) ⇒ & cat[X, x]r4↾I1 ∈ S3(Π) We also provide a TBF which exploits semantic properties of external sources

Redl C. (TU Vienna) HEX-Programs July 16, 2013 6 / 10

slide-18
SLIDE 18

Liberal Safety: Results

Modular composition of TBFs:

Proposition

If bi(Π, r, S, B), 1 ≤ i ≤ ℓ, are TBFs, then b(Π, r, S, B) =

1≤i≤ℓ bi(Π, r, S, B) is a TBF

.

Redl C. (TU Vienna) HEX-Programs July 16, 2013 7 / 10

slide-19
SLIDE 19

Liberal Safety: Results

Modular composition of TBFs:

Proposition

If bi(Π, r, S, B), 1 ≤ i ≤ ℓ, are TBFs, then b(Π, r, S, B) =

1≤i≤ℓ bi(Π, r, S, B) is a TBF

. Operator G is a witness for finite groundability:

Proposition

If Π is a de-safe program, then G∞

Π (∅) is finite.

Proposition

Let Π be a de-safe program. Then Π is finitely restrictable and G∞

Π (∅) ≡pos Π.

The results hold for any TBF!

Redl C. (TU Vienna) HEX-Programs July 16, 2013 7 / 10

slide-20
SLIDE 20

Relations to Other Notions of Safety

Using TBF bsyn(Π, r, S, B) ∪ bsem(Π, r, S, B), liberal de-safety is strictly more general than many other approaches:

Proposition

Every strongly de-safe [Eiter et al., 2006] program is de-safe.

Proposition

Every VI-restricted program [Calimeri et al., 2007] is de-safe.

Proposition

If Π is ω-restricted [Syrj¨ anen, 2001], then it corresponds to a rewritten program F(Π) which is de-safe.

Redl C. (TU Vienna) HEX-Programs July 16, 2013 8 / 10

slide-21
SLIDE 21

Conclusion

ASP Programs with External Sources

Ordinary safety not sufficient due to value invention Traditional strong safety is unnecessarily restrictive

Liberal Safety Criteria

Based on term bounding functions (TBFs) Allows for easy extensibility of the approach We also provide concrete TBFs, which are strictly more liberal than many

  • ther approaches

Ongoing and Future Work

Refine and extend existing TBFs (e.g. exploiting domain-specific properties) Define and implement grounding algorithms for the new class of programs

Redl C. (TU Vienna) HEX-Programs July 16, 2013 9 / 10

slide-22
SLIDE 22

References

Calimeri, F., Cozza, S., and Ianni, G. (2007). External Sources of Knowledge and Value Invention in Logic Programming. Annals of Mathematics and Artificial Intelligence, 50(3–4):333–361. Eiter, T., Ianni, G., Schindlauer, R., and Tompits, H. (2006). Effective Integration of Declarative Rules with External Evaluations for Semantic-Web Reasoning. In 3rd European Semantic Web Conference (ESWC’06), volume 4011 of LNCS, pages 273–287. Springer. Syrj¨ anen, T. (2001). Omega-restricted logic programs. In 6th International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’01), volume 2173 of LNCS, pages 267–279. Springer. Zantema, H. (1994). Termination of term rewriting: Interpretation and type elimination. Journal of Symbolic Computation, 17(1):23–50.

Redl C. (TU Vienna) HEX-Programs July 16, 2013 10 / 10