Answer Set Programming in a Nutshell Torsten Schaub University of - - PowerPoint PPT Presentation

answer set programming in a nutshell
SMART_READER_LITE
LIVE PREVIEW

Answer Set Programming in a Nutshell Torsten Schaub University of - - PowerPoint PPT Presentation

Answer Set Programming in a Nutshell Torsten Schaub University of Potsdam Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 1 / 31 Outline 1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary


slide-1
SLIDE 1

Answer Set Programming in a Nutshell

Torsten Schaub

University of Potsdam

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 1 / 31

slide-2
SLIDE 2

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 2 / 31

slide-3
SLIDE 3

Introduction

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 3 / 31

slide-4
SLIDE 4

Introduction

Answer Set Programming (ASP)

ASP is an approach to declarative problem solving

describe the problem, not how to solve it

ASP allows for solving hard search and optimization problems

Systems Biology Product Configuration Linux Package Configuration Robotics Music Composition . . .

All search-problems in NP (and NPNP) are expressible

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 4 / 31

slide-5
SLIDE 5

Introduction

Answer Set Programming (ASP)

ASP is an approach to declarative problem solving

describe the problem, not how to solve it

ASP allows for solving hard search and optimization problems

Systems Biology Product Configuration Linux Package Configuration Robotics Music Composition . . .

All search-problems in NP (and NPNP) are expressible

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 4 / 31

slide-6
SLIDE 6

Introduction

Answer Set Programming (ASP)

ASP is an approach to declarative problem solving

describe the problem, not how to solve it

ASP allows for solving hard search and optimization problems

Systems Biology Product Configuration Linux Package Configuration Robotics Music Composition . . .

All search-problems in NP (and NPNP) are expressible

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 4 / 31

slide-7
SLIDE 7

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-8
SLIDE 8

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-9
SLIDE 9

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-10
SLIDE 10

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-11
SLIDE 11

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-12
SLIDE 12

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-13
SLIDE 13

Introduction

The ASP Solving Process

First-Order Logic Program Grounder Propositional Logic Program Solver Stable Models

Expressive modeling language Powerful grounding and solving tools

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 5 / 31

slide-14
SLIDE 14

Foundations

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 6 / 31

slide-15
SLIDE 15

Foundations

Propositional Normal Logic Programs

A logic program Π is a set of rules of the form

a

  • head

← b1, . . . , bm, ∼c1, . . . , ∼cn

  • body

a and all bi, cj are atoms (propositional variables) ←, ,, ∼ denote if, and, and default negation intuitive reading: head must be true if body holds

Semantics given by stable models, informally, sets X of atoms such that

X is a (classical) model of Π and each atom in X is justified by some rule in Π

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 7 / 31

slide-16
SLIDE 16

Foundations

Logic Programs

A logic program Π is a set of rules of the form

a

  • head

← b1, . . . , bm, ∼c1, . . . , ∼cn

  • body

a and all bi, cj are atoms (propositional variables) ←, ,, ∼ denote if, and, and default negation intuitive reading: head must be true if body holds

Semantics given by stable models, informally, sets X of atoms such that

X is a (classical) model of Π and each atom in X is justified by some rule in Π

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 7 / 31

slide-17
SLIDE 17

Foundations

Logic Programs

A logic program Π is a set of rules of the form

a

  • head

← b1, . . . , bm, ∼c1, . . . , ∼cn

  • body

a and all bi, cj are atoms (propositional variables) ←, ,, ∼ denote if, and, and default negation intuitive reading: head must be true if body holds

Semantics given by stable models, informally, sets X of atoms such that

X is a (classical) model of Π and each atom in X is justified by some rule in Π

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 7 / 31

slide-18
SLIDE 18

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ← ¬b

b ← ¬a x ← (a ∧ ¬c) ∨ y y ← x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of CF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-19
SLIDE 19

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • RF(Π)=
  • a ← ¬b

b ← ¬a x ← (a ∧ ¬c) ∨ y y ← x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of RF(Π):

(only true atoms shown) {b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-20
SLIDE 20

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • RF(Π)=
  • a ← ¬b

b ← ¬a x ← (a ∧ ¬c) ∨ y y ← x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of RF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-21
SLIDE 21

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ↔ ¬b

b ↔ ¬a x ↔ (a ∧ ¬c) ∨ y y ↔ x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of RF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-22
SLIDE 22

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ↔ ¬b

b ↔ ¬a x ↔ (a ∧ ¬c) ∨ y y ↔ x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of CF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-23
SLIDE 23

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ↔ ¬b

b ↔ ¬a x ↔ (a ∧ ¬c) ∨ y y ↔ x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of CF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-24
SLIDE 24

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ↔ ¬b

b ↔ ¬a x ↔ (a ∧ ¬c) ∨ y y ↔ x ∧ b

  • c ↔ ⊥
  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Classical models of CF(Π) ∪ LF(Π):

{b}, {b, c}, {b, x, y}, {b, c, x, y}, {a, c}, {a, b, c}, {a, x}, {a, c, x}, {a, x, y}, {a, c, x, y}, {a, b, x, y}, {a, b, c, x, y} Unsupported atoms Unfounded atoms

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-25
SLIDE 25

Foundations

Logic Programs as Propositional Formulas

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π)=
  • a ↔
  • (a←B)∈ΠBF(B)
  • | a ∈ atom(Π)
  • BF(B)=

b∈B∩atom(Π)b ∧ ∼ c∈B¬c

LF(Π) =

  • a∈La
  • a∈L,(a←B)∈Π,B∩L=∅BF(B)
  • | L ∈ loop(Π)
  • Classical models of CF(Π) ∪ LF(Π):

Theorem (Lin and Zhao) Let Π be a normal logic program and X ⊆ atom(Π). Then, X is a stable model of Π iff X | = CF(Π) ∪ LF(Π). Size of CF(Π) is linear in the size of Π Size of LF(Π) may be exponential in the size of Π

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 8 / 31

slide-26
SLIDE 26

Foundations

Let’s run it!

$ cat prg.lp a :- not b. b :- not a. x :- a, not c. x :- y. y :- x, b. $ clingo 0 prg.lp clingo version 4.5.0 Reading from prg.lp Solving... Answer: 1 a x Answer: 2 b SATISFIABLE Models : 2 Calls : 1 Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s) CPU Time : 0.000s

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 9 / 31

slide-27
SLIDE 27

Foundations

Let’s run it!

$ cat prg.lp a :- not b. b :- not a. x :- a, not c. x :- y. y :- x, b. $ clingo 0 prg.lp clingo version 4.5.0 Reading from prg.lp Solving... Answer: 1 a x Answer: 2 b SATISFIABLE Models : 2 Calls : 1 Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s) CPU Time : 0.000s

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 9 / 31

slide-28
SLIDE 28

Foundations

Let’s run it!

$ cat prg.lp a :- not b. b :- not a. x :- a, not c. x :- y. y :- x, b. $ clingo 0 prg.lp clingo version 4.5.0 Reading from prg.lp Solving... Answer: 1 a x Answer: 2 b SATISFIABLE Models : 2 Calls : 1 Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s) CPU Time : 0.000s

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 9 / 31

slide-29
SLIDE 29

Foundations

Let’s run it!

$ cat prg.lp a :- not b. b :- not a. x :- a, not c. x :- y. y :- x, b. $ clingo 0 prg.lp clingo version 4.5.0 Reading from prg.lp Solving... Answer: 1 a x Answer: 2 b SATISFIABLE Models : 2 Calls : 1 Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s) CPU Time : 0.000s

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 9 / 31

slide-30
SLIDE 30

Foundations

Let’s run it!

$ cat prg.lp a :- not b. b :- not a. x :- a, not c. x :- y. y :- x, b. $ clingo 0 prg.lp clingo version 4.5.0 Reading from prg.lp Solving... Answer: 1 a x Answer: 2 b SATISFIABLE Models : 2 Calls : 1 Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s) CPU Time : 0.000s

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 9 / 31

slide-31
SLIDE 31

Foundations

Genuine Stable Models Semantics

The reduct φX of a formula φ relative to a set X of atoms is defined as follows φX = ⊥ if X | = φ φX = φ if φ ∈ X φX = (ψX ◦ µX) if X | = φ and φ = (ψ ◦ µ) for ◦ ∈ {∧, ∨, →} φX = ⊤ if X | = ψ and φ = ∼ψ Definition (Gelfond and Lifschitz et al.) Let Φ be a formula and X ⊆ atom(Φ). Then, X is a stable model of Φ if X is a ⊆-minimal model of ΦX Note a and ∼∼a are not the same

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 10 / 31

slide-32
SLIDE 32

Foundations

Genuine Stable Models Semantics

The reduct φX of a formula φ relative to a set X of atoms is defined as follows φX = ⊥ if X | = φ φX = φ if φ ∈ X φX = (ψX ◦ µX) if X | = φ and φ = (ψ ◦ µ) for ◦ ∈ {∧, ∨, →} φX = ⊤ if X | = ψ and φ = ∼ψ Definition (Gelfond and Lifschitz et al.) Let Φ be a formula and X ⊆ atom(Φ). Then, X is a stable model of Φ if X is a ⊆-minimal model of ΦX Note a and ∼∼a are not the same

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 10 / 31

slide-33
SLIDE 33

Foundations

Genuine Stable Models Semantics

The reduct φX of a formula φ relative to a set X of atoms is defined as follows φX = ⊥ if X | = φ φX = φ if φ ∈ X φX = (ψX ◦ µX) if X | = φ and φ = (ψ ◦ µ) for ◦ ∈ {∧, ∨, →} φX = ⊤ if X | = ψ and φ = ∼ψ Definition (Gelfond and Lifschitz et al.) Let Φ be a formula and X ⊆ atom(Φ). Then, X is a stable model of Φ if X is a ⊆-minimal model of ΦX Note a and ∼∼a are not the same

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 10 / 31

slide-34
SLIDE 34

Foundations

Genuine Stable Models Semantics

The reduct φX of a formula φ relative to a set X of atoms is defined as follows φX = ⊥ if X | = φ φX = φ if φ ∈ X φX = (ψX ◦ µX) if X | = φ and φ = (ψ ◦ µ) for ◦ ∈ {∧, ∨, →} φX = ⊤ if X | = ψ and φ = ∼ψ Definition (Gelfond and Lifschitz et al.) Let Φ be a formula and X ⊆ atom(Φ). Then, X is a stable model of Φ if X is a ⊆-minimal model of ΦX Note a and ∼∼a are not the same

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 10 / 31

slide-35
SLIDE 35

Foundations

Genuine Stable Models Semantics

The reduct φX of a formula φ relative to a set X of atoms is defined as follows φX = ⊥ if X | = φ φX = φ if φ ∈ X φX = (ψX ◦ µX) if X | = φ and φ = (ψ ◦ µ) for ◦ ∈ {∧, ∨, →} φX = ⊤ if X | = ψ and φ = ∼ψ Definition (Gelfond and Lifschitz et al.) Let Φ be a formula and X ⊆ atom(Φ). Then, X is a stable model of Φ if X is a ⊆-minimal model of ΦX Note a and ∼∼a are not the same

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 10 / 31

slide-36
SLIDE 36

Modeling

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 11 / 31

slide-37
SLIDE 37

Modeling

Some language constructs

Variables

p(X) :- q(X)

  • ver constants {a, b, c} stands for

p(a) :- q(a), p(b) :- q(b), p(c) :- q(c)

Conditional Literals

p :- q(X) : r(X) given r(a), r(b), r(c) stands for p :- q(a), q(b), q(c)

Disjunction

p(X) ; q(X) :- r(X)

Integrity Constraints

:- q(X), p(X)

Choice

2 { p(X,Y) : q(X) } 7 :- r(Y)

Aggregates

s(Y) :- r(Y), 2 #sum { X : p(X,Y), q(Y) } 7

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 12 / 31

slide-38
SLIDE 38

Modeling

Basic methodology

Methodology

Generate and Test (or: Guess and Check)

Generator Generate potential stable model candidates (typically through non-deterministic constructs) Tester Eliminate invalid candidates (typically through integrity constraints)

Peanutshell Logic program = Data + Generator + Tester ( + Optimizer)

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 13 / 31

slide-39
SLIDE 39

Modeling

Basic methodology

Methodology

Generate and Test (or: Guess and Check)

Generator Generate potential stable model candidates (typically through non-deterministic constructs) Tester Eliminate invalid candidates (typically through integrity constraints)

Peanutshell Logic program = Data + Generator + Tester ( + Optimizer)

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 13 / 31

slide-40
SLIDE 40

Modeling

Satisfiability testing

(a ↔ b) ∧ c

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 14 / 31

slide-41
SLIDE 41

Modeling

Satisfiability testing

(a ↔ b) ∧ c

{ a ; b ; c }. :- not a, b. :- a, not b. :- not c.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 14 / 31

slide-42
SLIDE 42

Modeling

Maximum satisfiability testing

“(a ↔ b)” + (a ↔ b) ∧ c

{ a ; b ; c }. :- not a, b. :- a, not b. :- not c. :~ a, b. [42@1] :~ not a, not b. [69@2]

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 14 / 31

slide-43
SLIDE 43

Modeling

n-queens

Basic encoding

{ queen (1..n ,1..n) }. :- { queen(I,J) } != n. :- queen(I,J), queen(I,JJ), J != JJ. :- queen(I,J), queen(II ,J), I != II. :- queen(I,J), queen(II ,JJ), (I,J) != (II ,JJ), I-J = II -JJ. :- queen(I,J), queen(II ,JJ), (I,J) != (II ,JJ), I+J = II+JJ.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 15 / 31

slide-44
SLIDE 44

Modeling

n-queens

Advanced encoding

{ queen(I ,1..n) } = 1 :- I = 1..n. { queen (1..n,J) } = 1 :- J = 1..n. :- { queen(D-J,J) } >= 2, D = 2..2*n. :- { queen(D+J,J) } >= 2, D = 1-n..n-1.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 16 / 31

slide-45
SLIDE 45

Modeling

n-queens

(Experimental) constraint encoding

1 $<= $queen (1..n) $<= n. #disjoint { X : $queen(X) $+ 0 : X=1..n }. #disjoint { X : $queen(X) $+ X : X=1..n }. #disjoint { X : $queen(X) $- X : X=1..n }.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 17 / 31

slide-46
SLIDE 46

Modeling

Traveling salesperson

Basic encoding (no instance)

1 { cycle(X,Y) : edge(X,Y) } 1 :- node(X). 1 { cycle(X,Y) : edge(X,Y) } 1 :- node(Y). reached(X) :- X = #min { Y : node(Y) }. reached(Y) :- cycle(X,Y), reached(X). :- node(Y), not reached(Y). #minimize { C,X,Y : cycle(X,Y), cost(X,Y,C) }.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 18 / 31

slide-47
SLIDE 47

Modeling

Company Controls

controls(X,Y) :- #sum+ { S: owns(X,Y,S); S,Z: controls(X,Z), owns(Z,Y,S) } > 50, company(X), company(Y), X != Y. company(c_1).

  • wns(c_1 ,c_2 ,60).
  • wns(c_1 ,c_3 ,20).

company(c_2).

  • wns(c_2 ,c_3 ,35).

company(c_3).

  • wns(c_3 ,c_4 ,51).

company(c_4).

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 19 / 31

slide-48
SLIDE 48

Algorithms and Systems

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 20 / 31

slide-49
SLIDE 49

Algorithms and Systems

Towards Conflict-Driven ASP

Goal Conflict-driven approach to ASP solving Idea View inferences as unit propagation on nogoods Background

A nogood expresses an inadmissible assignment For example, given a rule a ← b

{Fa, Tb} is a nogood (stands for {a → F, b → T}) Unit propagation on {Fa, Tb} infers Ta wrt assignment containing Tb Fb wrt assignment containing Fa

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 21 / 31

slide-50
SLIDE 50

Algorithms and Systems

Towards Conflict-Driven ASP

Goal Conflict-driven approach to ASP solving Idea View inferences as unit propagation on nogoods Background

A nogood expresses an inadmissible assignment For example, given a rule a ← b

{Fa, Tb} is a nogood (stands for {a → F, b → T}) Unit propagation on {Fa, Tb} infers Ta wrt assignment containing Tb Fb wrt assignment containing Fa

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 21 / 31

slide-51
SLIDE 51

Algorithms and Systems

Towards Conflict-Driven ASP

Goal Conflict-driven approach to ASP solving Idea View inferences as unit propagation on nogoods Background

A nogood expresses an inadmissible assignment For example, given a rule a ← b

{Fa, Tb} is a nogood (stands for {a → F, b → T}) Unit propagation on {Fa, Tb} infers Ta wrt assignment containing Tb Fb wrt assignment containing Fa

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 21 / 31

slide-52
SLIDE 52

Algorithms and Systems

Towards Conflict-Driven ASP

Goal Conflict-driven approach to ASP solving Idea View inferences as unit propagation on nogoods Background

A nogood expresses an inadmissible assignment For example, given a rule a ← b

{Fa, Tb} is a nogood (stands for {a → F, b → T}) Unit propagation on {Fa, Tb} infers Ta wrt assignment containing Tb Fb wrt assignment containing Fa

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 21 / 31

slide-53
SLIDE 53

Algorithms and Systems

Towards Conflict-Driven ASP

Goal Conflict-driven approach to ASP solving Idea View inferences as unit propagation on nogoods Background

A nogood expresses an inadmissible assignment For example, given a rule a ← b

{Fa, Tb} is a nogood (stands for {a → F, b → T}) Unit propagation on {Fa, Tb} infers Ta wrt assignment containing Tb Fb wrt assignment containing Fa

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 21 / 31

slide-54
SLIDE 54

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ ¬b

b ↔ ¬a c ↔ ⊥ x ↔ (a ∧ ¬c) ∨ y y ↔ x ∧ b

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → a ∧ ¬c
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-55
SLIDE 55

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-56
SLIDE 56

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-57
SLIDE 57

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-58
SLIDE 58

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-59
SLIDE 59

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-60
SLIDE 60

Algorithms and Systems

Nogoods from logic programs

Π =

  • a ← ∼b

b ← ∼a x ← a, ∼c x ← y y ← x, b

  • CF(Π) =
  • a ↔ B1

b ↔ B2 c ↔ ⊥ x ↔ B3 ∨ B4 y ↔ B5

  • B1 ↔ ¬b

B2 ↔ ¬a B3 ↔ a ∧ ¬c B4 ↔ y B5 ↔ x ∧ b

  • LF(Π) =
  • (x ∨ y) → B3
  • Nogoods for CF(Π) and LF(Π)

∆Π = {. . . , {Fx, TB3}, {Fx, TB4} . . .} ∪ {. . . , {Tx, FB3, FB4}, . . .} ∪ {. . . , {FB3, Ta, Fc}, . . .} ∪ {. . . , {TB3, Fa}, {TB3, Tc}, . . .} ΛΠ = {{Tx, FB3}, {Ty, FB3}} Size of ∆Π is linear in the size of Π Size of ΛΠ is (in general) exponential in the size of Π

Satisfaction of ΛΠ can be tested in linear time

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 22 / 31

slide-61
SLIDE 61

Algorithms and Systems

Stable Models as Solutions

Theorem Let Π be a normal logic program and X ⊆ atom(Π). Then, X is a stable model of Π iff X = AT ∩ atom(Π) for a (unique) solution A for ∆Π ∪ ΛΠ.1 Advantages Stable model computation as Boolean constraint solving All inferences can be seen as unit propagation on nogoods Nogoods readily available as conflict reasons

1A total assignment A is a solution for ∆Π ∪ ΛΠ if δ ⊆ A for all δ ∈ ∆Π ∪ ΛΠ. Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 23 / 31

slide-62
SLIDE 62

Algorithms and Systems

Stable Models as Solutions

Theorem Let Π be a normal logic program and X ⊆ atom(Π). Then, X is a stable model of Π iff X = AT ∩ atom(Π) for a (unique) solution A for ∆Π ∪ ΛΠ.1 Advantages Stable model computation as Boolean constraint solving All inferences can be seen as unit propagation on nogoods Nogoods readily available as conflict reasons

1A total assignment A is a solution for ∆Π ∪ ΛΠ if δ ⊆ A for all δ ∈ ∆Π ∪ ΛΠ. Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 23 / 31

slide-63
SLIDE 63

Algorithms and Systems

Conflict-Driven Constraint Learning (CDCL)

loop propagate // assign deterministic consequences if no conflict then if all variables assigned then return variable assignment else decide // non-deterministically assign some variable else if top-level conflict then return unsatisfiable else analyze // analyze conflict and add conflict constraint backjump // undo assignments violating conflict constraint

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 24 / 31

slide-64
SLIDE 64

Algorithms and Systems

Conflict-Driven Constraint Learning (CDCL)

loop propagate // assign deterministic consequences if no conflict then if all variables assigned then return variable assignment else decide // non-deterministically assign some variable else if top-level conflict then return unsatisfiable else analyze // analyze conflict and add conflict constraint backjump // undo assignments violating conflict constraint

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 24 / 31

slide-65
SLIDE 65

Algorithms and Systems

The solver clasp

Beyond deciding (stable) model existence, clasp allows for

Enumeration (without solution recording) Projective enumeration (without solution recording) Intersection and Union (linear solving process) Multi-objective Optimization and combinations thereof

clasp allows for

ASP solving (smodels format) MaxSAT and SAT solving (extended dimacs format) PB solving (opb and wbo format)

clasp pursues a coarse-grained, task-parallel approach to parallel search via shared memory multi-threading

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 25 / 31

slide-66
SLIDE 66

Algorithms and Systems

The solver clasp

Beyond deciding (stable) model existence, clasp allows for

Enumeration (without solution recording) Projective enumeration (without solution recording) Intersection and Union (linear solving process) Multi-objective Optimization and combinations thereof

clasp allows for

ASP solving (smodels format) MaxSAT and SAT solving (extended dimacs format) PB solving (opb and wbo format)

clasp pursues a coarse-grained, task-parallel approach to parallel search via shared memory multi-threading

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 25 / 31

slide-67
SLIDE 67

Algorithms and Systems

The solver clasp

Beyond deciding (stable) model existence, clasp allows for

Enumeration (without solution recording) Projective enumeration (without solution recording) Intersection and Union (linear solving process) Multi-objective Optimization and combinations thereof

clasp allows for

ASP solving (smodels format) MaxSAT and SAT solving (extended dimacs format) PB solving (opb and wbo format)

clasp pursues a coarse-grained, task-parallel approach to parallel search via shared memory multi-threading

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 25 / 31

slide-68
SLIDE 68

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-69
SLIDE 69

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-70
SLIDE 70

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-71
SLIDE 71

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-72
SLIDE 72

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-73
SLIDE 73

Algorithms and Systems

Multi-threaded architecture of clasp

Solver 1. . . n Decision Heuristic Decision Heuristic Conflict Resolution Conflict Resolution Assignment Atoms/Bodies Recorded Nogoods Propagation Unit Propagation Unit Propagation Post Propagation Post Propagation Post Propagation Post Propagation Coordination SharedContext Propositional Variables Atoms Bodies Static Nogoods Short Nogoods ParallelContext Threads S1 S2 . . . Sn Counter T W . . . S Queue P1 P2 . . .Pn Shared Nogoods Enumerator Enumerator Nogood Distributor Nogood Distributor Logic Program Preprocessing Program Builder Program Builder Preprocessor Preprocessor Preprocessor Preprocessor

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 26 / 31

slide-74
SLIDE 74

Algorithms and Systems

Some Results

50 100 150 200 250 300 350 400 450 500 0.1 1 5 30 120 300 600 Solved instances Time in seconds NP-Track Second ASP Competition

Run on: Dual-Processor Intel Xeon Quad-Core E5520

cmodels-3.79 lp2sat-1.13 smodels-2.34 Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 27 / 31

slide-75
SLIDE 75

Algorithms and Systems

Some Results

50 100 150 200 250 300 350 400 450 500 0.1 1 5 30 120 300 600 Solved instances Time in seconds NP-Track Second ASP Competition

Run on: Dual-Processor Intel Xeon Quad-Core E5520

clasp-1.3.1 cmodels-3.79 lp2sat-1.13 smodels-2.34 470 449 410 331 Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 27 / 31

slide-76
SLIDE 76

Algorithms and Systems

Some Results

50 100 150 200 250 300 350 400 450 500 0.1 1 5 30 120 300 600 Solved instances Time in seconds NP-Track Second ASP Competition

Run on: Dual-Processor Intel Xeon Quad-Core E5520

clasp-3.1-t4 clasp-1.3.1 cmodels-3.79 lp2sat-1.13 smodels-2.34 470 491 449 410 331 Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 27 / 31

slide-77
SLIDE 77

Potassco

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 28 / 31

slide-78
SLIDE 78

Potassco

potassco.sourceforge.net

Potassco, the Potsdam Answer Set Solving Collection, bundles tools for ASP developed at the University of Potsdam: Grounder gringo, lingo Solver clasp, claspfolio, claspar, aspeed Grounder+Solver Clingo, Clingcon, ROSoClingo Further Tools aspartame, aspcud, asprin, chasp, claspre, clavis, coala, fimo, insight, metasp, plasp, piclasp, etc Benchmark repository asparagus.cs.uni-potsdam.de

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 29 / 31

slide-79
SLIDE 79

Potassco

potassco.sourceforge.net

Potassco, the Potsdam Answer Set Solving Collection, bundles tools for ASP developed at the University of Potsdam: Grounder gringo, lingo Solver clasp, claspfolio, claspar, aspeed Grounder+Solver Clingo, Clingcon, ROSoClingo Further Tools aspartame, aspcud, asprin, chasp, claspre, clavis, coala, fimo, insight, metasp, plasp, piclasp, etc Benchmark repository asparagus.cs.uni-potsdam.de

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 29 / 31

slide-80
SLIDE 80

Potassco

potassco.sourceforge.net

Potassco, the Potsdam Answer Set Solving Collection, bundles tools for ASP developed at the University of Potsdam: Grounder gringo, lingo Solver clasp, claspfolio, claspar, aspeed Grounder+Solver Clingo, Clingcon, ROSoClingo Further Tools aspartame, aspcud, asprin, chasp, claspre, clavis, coala, fimo, insight, metasp, plasp, piclasp, etc Benchmark repository asparagus.cs.uni-potsdam.de

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 29 / 31

slide-81
SLIDE 81

Potassco

potassco.sourceforge.net

Potassco, the Potsdam Answer Set Solving Collection, bundles tools for ASP developed at the University of Potsdam: Grounder gringo, lingo Solver clasp, claspfolio, claspar, aspeed Grounder+Solver Clingo, Clingcon, ROSoClingo Further Tools aspartame, aspcud, asprin, chasp, claspre, clavis, coala, fimo, insight, metasp, plasp, piclasp, etc Benchmark repository asparagus.cs.uni-potsdam.de

Answer Set Solving in Practice

Martin Gebser, Roland Kaminski, Benjamin Kaufmann, and Torsten Schaub University of Potsdam SYNTHESIS LECTURES ON SAMPLE SERIES #1

C M &

cLaypool Morgan publishers & Martin Gebser Roland Kaminski Benjamin Kaufmann Marius Lindauer Max Ostrowski Javier Romero Torsten Schaub Sven Thiele University of Potsdam

arXiv:1507.06576v1 [cs.PL] 23 Jul 2015

Under consideration for publication in Theory and Practice of Logic Programming 1

Abstract Gringo

MARTIN GEBSER∗ Aalto University, HIIT, Finland University of Potsdam, Germany gebser@cs.uni-potsdam.de AMELIA HARRISON† Univeristy of Texas at Austin, USA ameliaj@cs.utexas.edu ROLAND KAMINSKI∗ University of Potsdam, Germany kaminski@cs.uni-potsdam.de VLADIMIR LIFSCHITZ† Univeristy of Texas at Austin, USA vl@cs.utexas.edu TORSTEN SCHAUB∗‡ University of Potsdam, Germany INRIA Rennes, France torsten@cs.uni-potsdam.de submitted 1 January 2003; revised 1 January 2003; accepted 1 January 2003 Abstract This paper defines the syntax and semantics of the input language of the ASP grounder GRINGO. The definition covers several constructs that were not discussed in earlier work on the semantics of that language, including intervals, pools, division of integers, aggregates with non-numeric values, and lparse-style aggregate expressions. The definition is abstract in the sense that it disregards some details related to representing programs by strings of ASCII characters. It serves as a specification for GRINGO from Version 4.5 on. To appear in Theory and Practice of Logic Programming (TPLP), Proceedings of ICLP 2015. ∗ Supported by AoF (grant 251170) and DFG (grants SCHA 550/8 and 550/9). † Partially supported by the National Science Foundation under Grant IIS-1422455. ‡ Affiliated with Simon Fraser University, Canada, and IIIS Griffith University, Australia.

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 29 / 31

slide-82
SLIDE 82

Summary

Outline

1 Introduction 2 Foundations 3 Modeling 4 Algorithms and Systems 5 Potassco 6 Summary

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 30 / 31

slide-83
SLIDE 83

Summary

Summary

ASP is a viable tool for Knowledge Representation and Reasoning ASP offers efficient and versatile off-the-shelf solving technology ASP offers an expanding functionality and ease of use

rapid application development tool

ASP has a growing range of applications

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 31 / 31

slide-84
SLIDE 84

Summary

Summary

ASP is a viable tool for Knowledge Representation and Reasoning ASP offers efficient and versatile off-the-shelf solving technology ASP offers an expanding functionality and ease of use

rapid application development tool

ASP has a growing range of applications

ASP = DB+LP+KR+SAT

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 31 / 31

slide-85
SLIDE 85

Summary

Summary

ASP is a viable tool for Knowledge Representation and Reasoning ASP offers efficient and versatile off-the-shelf solving technology ASP offers an expanding functionality and ease of use

rapid application development tool

ASP has a growing range of applications

ASP = DB+LP+KR+SMTn

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 31 / 31

slide-86
SLIDE 86

Summary

Summary

ASP is a viable tool for Knowledge Representation and Reasoning ASP offers efficient and versatile off-the-shelf solving technology ASP offers an expanding functionality and ease of use

rapid application development tool

ASP has a growing range of applications

http://potassco.sourceforge.net

Torsten Schaub (KRR@UP) Answer Set Programming in a Nutshell 31 / 31