2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control
-
Upload
kaliaragorn -
Category
Science
-
view
193 -
download
1
Transcript of 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control
![Page 1: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/1.jpg)
Clingo = Answer Set Programming + Control
Martin Gebser? Roland KaminskiBenjamin Kaufmann Torsten Schaub
University of Potsdam
?Aalto University
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 1 / 20
![Page 2: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/2.jpg)
MotivationASP is an approach to declarative problem solving, combining
a rich yet simple modeling languagewith high-performance solving capacities
tailored to Knowledge Representation and ReasoningElaborate reasoning processes feature
incremental solving, as in planning or finite model finding, or evenreactive solving, as in robotics or query-answering
Problem
LogicProgram Grounder Solver Stable
Models
Solutions
- - -
?
6
One-shot ASP Solving
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 2 / 20
![Page 3: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/3.jpg)
MotivationASP is an approach to declarative problem solving, combining
a rich yet simple modeling languagewith high-performance solving capacities
tailored to Knowledge Representation and ReasoningElaborate reasoning processes feature
incremental solving, as in planning or finite model finding, or evenreactive solving, as in robotics or query-answering
Problem
LogicProgram Grounder Solver Stable
Models
Solutions
- - -
?
6
Incremental ASP Solving
6
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 2 / 20
![Page 4: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/4.jpg)
MotivationASP is an approach to declarative problem solving, combining
a rich yet simple modeling languagewith high-performance solving capacities
tailored to Knowledge Representation and ReasoningElaborate reasoning processes feature
incremental solving, as in planning or finite model finding, or evenreactive solving, as in robotics or query-answering
Problem
LogicProgram Grounder Solver Stable
Models
Solutions
- - -
?
6
Reactive ASP Solving
66
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 2 / 20
![Page 5: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/5.jpg)
Outline
1 Background
2 (More) Control
3 Summary
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 3 / 20
![Page 6: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/6.jpg)
Background
Outline
1 Background
2 (More) Control
3 Summary
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 4 / 20
![Page 7: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/7.jpg)
Background
Clingo 3 Series
One-shot ASP solving by means of grounder gringo and solver clasp
Clingo: gringo | clasp
Incremental ASP solving by dedicated handling of three program parts
iClingo: Clingo [base ∪⋃n
i=1cumulative(i) ∪ volatile(n)]∗n=1
base: grounded once and stored by solvercumulative(i): grounded for increasing i-values and stored by solvervolatile(i): grounded like cumulative(i) but not stored by solver
Reactive ASP solving by further incorporating external program parts
oClingo: iClingo [⋃m
j=1external(j)]∗m=1
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 5 / 20
![Page 8: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/8.jpg)
Background
Clingo 3 Series
One-shot ASP solving by means of grounder gringo and solver clasp
Clingo: gringo | clasp
Incremental ASP solving by dedicated handling of three program parts
iClingo: Clingo [base ∪⋃n
i=1cumulative(i) ∪ volatile(n)]∗n=1
base: grounded once and stored by solvercumulative(i): grounded for increasing i-values and stored by solvervolatile(i): grounded like cumulative(i) but not stored by solver
Reactive ASP solving by further incorporating external program parts
oClingo: iClingo [⋃m
j=1external(j)]∗m=1
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 5 / 20
![Page 9: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/9.jpg)
Background
Clingo 3 Series
One-shot ASP solving by means of grounder gringo and solver clasp
Clingo: gringo | clasp
Incremental ASP solving by dedicated handling of three program parts
iClingo: Clingo [base ∪⋃n
i=1cumulative(i) ∪ volatile(n)]∗n=1
base: grounded once and stored by solvercumulative(i): grounded for increasing i-values and stored by solvervolatile(i): grounded like cumulative(i) but not stored by solver
Reactive ASP solving by further incorporating external program parts
oClingo: iClingo [⋃m
j=1external(j)]∗m=1
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 5 / 20
![Page 10: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/10.jpg)
Background
Elevator Control Example
Setup:
floor(1..3).
at(1,0).
Request 1:
request(2,1,1).
Request 2:
request(3,1,2).
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 6 / 20
![Page 11: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/11.jpg)
Background
Elevator Control Example
Setup:
floor(1..3).
at(1,0).
Request 1:
request(2,1,1).
Request 2:
request(3,1,2).
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 6 / 20
![Page 12: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/12.jpg)
Background
Elevator Control Example
Setup:
floor(1..3).
at(1,0).
Request 1:
request(2,1,1).
Request 2:
request(3,1,2).
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 6 / 20
![Page 13: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/13.jpg)
Background
Elevator Control Example
Setup:
floor(1..3).
at(1,0).
Request 1:
request(2,1,1).
Request 2:
request(3,1,2).
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 6 / 20
![Page 14: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/14.jpg)
Background
Elevator Control Example
Setup:
floor(1..3).
at(1,0).
Request 1:
request(2,1,1).
Request 2:
request(3,1,2).
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 6 / 20
![Page 15: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/15.jpg)
Background
Encoding for One-shot ASP Solving
diff(-1;1).
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
exec(F1,F2,D,T) :- task(F1,F2,D,T-1), at(F1,T-1), move(D,T).
exec(F2,D,T) :- exec(F1,F2,D,T).
exec(F2,D,T) :- exec(F2,D,T-1), time(T), not at(F2,T-1).
exec(D,T) :- exec(F2,D,T).
:- exec(D,T), not move(D,T).
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
open(T) :- task(F1,F2,D,T).
open(T) :- exec(F2,D,T), not at(F2,T).
:- move(T), not open(T-1).
:- open(T), not move(T+1).M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 7 / 20
![Page 16: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/16.jpg)
Background
One-shot ASP Solving
Request 1: clingo-3 <files> <(echo "time(1..3).")
Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: clingo-3 <files> <(echo "time(1..5).")
Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 8 / 20
![Page 17: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/17.jpg)
Background
One-shot ASP Solving
Request 1: clingo-3 <files> <(echo "time(1..3).")
Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: clingo-3 <files> <(echo "time(1..5).")
Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 8 / 20
![Page 18: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/18.jpg)
Background
One-shot ASP Solving
Request 1: clingo-3 <files> <(echo "time(1..3).")
Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: clingo-3 <files> <(echo "time(1..5).")
Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 8 / 20
![Page 19: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/19.jpg)
Background
One-shot ASP Solving
Request 1: clingo-3 <files> <(echo "time(1..3).")
Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: clingo-3 <files> <(echo "time(1..5).")
Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 8 / 20
![Page 20: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/20.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
...
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
...
:- open(T), not move(T+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 21: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/21.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
...
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
...
:- open(T), not move(T+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 22: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/22.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
...
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
...
:- open(T), not move(T+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 23: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/23.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
...
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
...
:- open(T), not move(T+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 24: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/24.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,T) : diff(D) } 1 :- time(T).
move(T) :- move(D,T).
% State update
at(F, T) :- at(F,T-1), time(T), not move(T).
at(F+D,T) :- at(F,T-1), move(D,T), floor(F+D).
:- time(T), not 1 { at(F,T) } 1.
% Pending requests
task(F1,F2,D,T) :- request(F1,F2,T), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,T) :- task(F1,F2,D,T-1), time(T), not exec(F1,F2,D,T).
% Started tasks must be processed till completion
...
:- move(D,T), not move(D,T+1), not exec(D,T), not exec(-D,T+1).
% Move iff there is some task to process
...
:- open(T), not move(T+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 25: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/25.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t), not move(D,t+1), not exec(D,t), not exec(-D,t+1).
% Move iff there is some task to process
...
:- open(t), not move(t+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 26: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/26.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t), not move(D,t+1), not exec(D,t), not exec(-D,t+1).
% Move iff there is some task to process
...
:- open(t), not move(t+1).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 27: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/27.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 28: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/28.jpg)
Background
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 9 / 20
![Page 29: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/29.jpg)
Background
Incremental ASP Solving
Request 1: iclingo-3 <files>
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: iclingo-3 <files>
Solving... Solving... Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 10 / 20
![Page 30: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/30.jpg)
Background
Incremental ASP Solving
Request 1: iclingo-3 <files>
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: iclingo-3 <files>
Solving... Solving... Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 10 / 20
![Page 31: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/31.jpg)
Background
Incremental ASP Solving
Request 1: iclingo-3 <files>
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: iclingo-3 <files>
Solving... Solving... Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 10 / 20
![Page 32: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/32.jpg)
Background
Incremental ASP Solving
Request 1: iclingo-3 <files>
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2: iclingo-3 <files>
Solving... Solving... Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 10 / 20
![Page 33: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/33.jpg)
Background
Encoding for Reactive ASP Solving
#base.#external request(F1,F2,0) : floor(F1) : floor(F2) : F1 != F2.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
#external request(F1,F2,t) : floor(F1) : floor(F2) : F1 != F2.
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
...
Inputs:#step 1.
request(2,1,1).
#endstep.
#step 2.
request(3,1,2).
#endstep.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 11 / 20
![Page 34: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/34.jpg)
Background
Encoding for Reactive ASP Solving
#base.#external request(F1,F2,0) : floor(F1) : floor(F2) : F1 != F2.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
#external request(F1,F2,t) : floor(F1) : floor(F2) : F1 != F2.
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
...
Inputs:#step 1.
request(2,1,1).
#endstep.
#step 2.
request(3,1,2).
#endstep.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 11 / 20
![Page 35: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/35.jpg)
Background
Encoding for Reactive ASP Solving
#base.#external request(F1,F2,0) : floor(F1) : floor(F2) : F1 != F2.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
#external request(F1,F2,t) : floor(F1) : floor(F2) : F1 != F2.
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
...
Inputs:#step 1.
request(2,1,1).
#endstep.
#step 2.
request(3,1,2).
#endstep.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 11 / 20
![Page 36: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/36.jpg)
Background
Encoding for Reactive ASP Solving
#base.#external request(F1,F2,0) : floor(F1) : floor(F2) : F1 != F2.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
#external request(F1,F2,t) : floor(F1) : floor(F2) : F1 != F2.
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
...
Inputs:#step 1.
request(2,1,1).
#endstep.
#step 2.
request(3,1,2).
#endstep.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 11 / 20
![Page 37: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/37.jpg)
Background
Reactive ASP Solving
oclingo-3 <files> + controller.py
Request 1:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 12 / 20
![Page 38: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/38.jpg)
Background
Reactive ASP Solving
oclingo-3 <files> + controller.py
Request 1:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 12 / 20
![Page 39: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/39.jpg)
Background
Reactive ASP Solving
oclingo-3 <files> + controller.py
Request 1:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 12 / 20
![Page 40: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/40.jpg)
Background
Reactive ASP Solving
oclingo-3 <files> + controller.py
Request 1:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 12 / 20
![Page 41: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/41.jpg)
Background
Reactive ASP Solving
oclingo-3 <files> + controller.py
Request 1:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(-1,3)
Request 2:
Solving... Solving... Solving...
Answer: 1
move(1,2) move(1,3) move(-1,4) move(-1,5)
1
2
3
1
2
3
1
1
2
3
1 2 3
1
2
3
1
2
1
2
3
1
2
2
3 4
5
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 12 / 20
![Page 42: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/42.jpg)
(More) Control
Outline
1 Background
2 (More) Control
3 Summary
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 13 / 20
![Page 43: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/43.jpg)
(More) Control
Clingo 4 Approach
Custom grounding and solving via embedded scripting languages
Lua: main(prg), prg:ground(parts), prg:solve(), . . .Python: main(prg), prg.ground(parts), prg.solve(), . . .Library: prg.ground(parts), prg.solve(), . . .
Predecessor systems can easily be scripted
One-shot ASP solving (default): (ground | solve)Incremental ASP solving: (ground | solve)∗
Reactive ASP solving: (ground∗ | solve)∗
. . .
Clingo: ASP + Control
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 14 / 20
![Page 44: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/44.jpg)
(More) Control
Clingo 4 Approach
Custom grounding and solving via embedded scripting languages
Lua: main(prg), prg:ground(parts), prg:solve(), . . .Python: main(prg), prg.ground(parts), prg.solve(), . . .Library: prg.ground(parts), prg.solve(), . . .
Predecessor systems can easily be scripted
One-shot ASP solving (default): (ground | solve)Incremental ASP solving: (ground | solve)∗
Reactive ASP solving: (ground∗ | solve)∗
. . .
Clingo: ASP + Control
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 14 / 20
![Page 45: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/45.jpg)
(More) Control
Clingo 4 Approach
Custom grounding and solving via embedded scripting languages
Lua: main(prg), prg:ground(parts), prg:solve(), . . .Python: main(prg), prg.ground(parts), prg.solve(), . . .Library: prg.ground(parts), prg.solve(), . . .
Predecessor systems can easily be scripted
One-shot ASP solving (default): (ground | solve)Incremental ASP solving: (ground | solve)∗
Reactive ASP solving: (ground∗ | solve)∗
. . .
Clingo: ASP + Control
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 14 / 20
![Page 46: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/46.jpg)
(More) Control
Clingo 4 Approach
Custom grounding and solving via embedded scripting languages
Lua: main(prg), prg:ground(parts), prg:solve(), . . .Python: main(prg), prg.ground(parts), prg.solve(), . . .Library: prg.ground(parts), prg.solve(), . . .
Predecessor systems can easily be scripted
One-shot ASP solving (default): (ground | solve)Incremental ASP solving: (ground | solve)∗
Reactive ASP solving: (ground∗ | solve)∗
. . .
Clingo: ASP + Control
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 14 / 20
![Page 47: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/47.jpg)
(More) Control
Clingo 4 Approach
Custom grounding and solving via embedded scripting languages
Lua: main(prg), prg:ground(parts), prg:solve(), . . .Python: main(prg), prg.ground(parts), prg.solve(), . . .Library: prg.ground(parts), prg.solve(), . . .
Predecessor systems can easily be scripted
One-shot ASP solving (default): (ground | solve)Incremental ASP solving: (ground | solve)∗
Reactive ASP solving: (ground∗ | solve)∗
. . .
Clingo: ASP + Control
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 14 / 20
![Page 48: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/48.jpg)
(More) Control
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 49: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/49.jpg)
(More) Control
Encoding for Incremental ASP Solving
#base.diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 50: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/50.jpg)
(More) Control
Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 51: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/51.jpg)
(More) Control
Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#cumulative t.
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 52: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/52.jpg)
(More) Control
Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 53: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/53.jpg)
(More) Control
Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#volatile t.
:- open(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 54: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/54.jpg)
(More) Control
Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
at(F, t) :- at(F,t-1), not move(t).
at(F+D,t) :- at(F,t-1), move(D,t), floor(F+D).
:- not 1 { at(F,t) } 1.
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
...
:- open(t-1), not move(t).
#external query(t).:- open(t), query(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 15 / 20
![Page 55: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/55.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 56: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/56.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 57: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/57.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 58: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/58.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 59: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/59.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 60: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/60.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 61: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/61.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 62: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/62.jpg)
(More) Control
Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 63: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/63.jpg)
(More) Control
My Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", [])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
if step == imin:
prg.ground(parts)
parts = []
prg.assign external(Fun("query", [step]), True)
ret = prg.solve()
if ret == SolveResult.SAT: breakprg.release external(Fun("query", [step]))
imin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 64: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/64.jpg)
(More) Control
My Script for Incremental ASP Solving
#script(python)from gringo import *
def main(prg):
imin = prg.get const("imin")
if imin == None: imin = 1
step = 0
parts = [("base", []), ("task", [step])]
while True:
if step < imin:
step = step+1
parts.append(("cumulative", [step]))
parts.append(("task", [step]))
if step == imin:
prg.ground(parts)
parts = []
ret = prg.solve()
if ret == SolveResult.SAT: breakimin = imin+1
#end.
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 16 / 20
![Page 65: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/65.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- task(F1,F2,D,t).
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
:- open(t-1), not move(t).
#external query(t).:- open(t), query(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 66: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/66.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- task(F1,F2,D,t).
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
:- open(t-1), not move(t).
#external query(t).:- open(t), query(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 67: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/67.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
task(F1,F2,D,0) :- request(F1,F2,0), D = (F2-F1)/|F2-F1|.
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- task(F1,F2,D,t).
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
:- open(t-1), not move(t).
#external query(t).:- open(t), query(t).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 68: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/68.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
#program task(t).
#external move(t+1).task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
open(t) :- task(F1,F2,D,t).
:- open(t), not move(t+1).
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 69: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/69.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
#program task(t).
#external move(t+1).task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
open(t) :- task(F1,F2,D,t).
:- open(t), not move(t+1).
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 70: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/70.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
#program task(t).
#external move(t+1).task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
open(t) :- task(F1,F2,D,t).
:- open(t), not move(t+1).
#program cumulative(t).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t-1), not move(D,t), not exec(D,t-1), not exec(-D,t).
% Move iff there is some task to process
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 71: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/71.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
#program task(t).
#external move(t+1).task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
open(t) :- task(F1,F2,D,t).
:- open(t), not move(t+1).
#program cumulative(t).
#external move(D,t+1) : diff(D).
#external exec(D,t+1) : diff(D).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t), not move(D,t+1), not exec(D,t), not exec(-D,t+1).
% Move iff there is some task to process
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 72: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/72.jpg)
(More) Control
My Encoding for Incremental ASP Solving
#program base.
diff(-1;1).
#program task(t).
#external move(t+1).task(F1,F2,D,t) :- request(F1,F2,t), D = (F2-F1)/|F2-F1|.
open(t) :- task(F1,F2,D,t).
:- open(t), not move(t+1).
#program cumulative(t).
#external move(D,t+1) : diff(D).
#external exec(D,t+1) : diff(D).
{ move(D,t) : diff(D) } 1.
move(t) :- move(D,t).
% State update
...
% Pending requests
task(F1,F2,D,t) :- task(F1,F2,D,t-1), not exec(F1,F2,D,t).
% Started tasks must be processed till completion
...
:- move(D,t), not move(D,t+1), not exec(D,t), not exec(-D,t+1).
% Move iff there is some task to process
open(t) :- exec(F2,D,t), not at(F2,t).
:- move(t), not open(t-1).M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 17 / 20
![Page 73: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/73.jpg)
(More) Control
Custom ASP Solving
Encoding consisting of named and parameterizable subprograms
#program base. (default), #program cumulative(t)., . . .
External (yet undefined) atoms provide input interface to other parts
#external <atom> [ : <body> ].
Embedded scripts allow for flexible grounding and solving control
#script(python | lua) . . . main(prg) . . . #end.
Instantiation triggered by passing subprogram names plus arguments
prg.ground([("base", []), ("task", [step])])
Ground program parts constitute modules (with disjoint head atoms)
Search for stable models of ground program parts stored by solver
prg.solve(), prg.solve(on model = pretty print), . . .
Incremental and/or reactive ASP solving via “i/oClingo” scripts
#include <iclingo>.
prg.add("request1", [], "request(2,1,1).")
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 18 / 20
![Page 74: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/74.jpg)
(More) Control
Custom ASP Solving
Encoding consisting of named and parameterizable subprograms
#program base. (default), #program cumulative(t)., . . .
External (yet undefined) atoms provide input interface to other parts
#external <atom> [ : <body> ].
Embedded scripts allow for flexible grounding and solving control
#script(python | lua) . . . main(prg) . . . #end.
Instantiation triggered by passing subprogram names plus arguments
prg.ground([("base", []), ("task", [step])])
Ground program parts constitute modules (with disjoint head atoms)
Search for stable models of ground program parts stored by solver
prg.solve(), prg.solve(on model = pretty print), . . .
Incremental and/or reactive ASP solving via “i/oClingo” scripts
#include <iclingo>.
prg.add("request1", [], "request(2,1,1).")
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 18 / 20
![Page 75: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/75.jpg)
(More) Control
Custom ASP Solving
Encoding consisting of named and parameterizable subprograms
#program base. (default), #program cumulative(t)., . . .
External (yet undefined) atoms provide input interface to other parts
#external <atom> [ : <body> ].
Embedded scripts allow for flexible grounding and solving control
#script(python | lua) . . . main(prg) . . . #end.
Instantiation triggered by passing subprogram names plus arguments
prg.ground([("base", []), ("task", [step])])
Ground program parts constitute modules (with disjoint head atoms)
Search for stable models of ground program parts stored by solver
prg.solve(), prg.solve(on model = pretty print), . . .
Incremental and/or reactive ASP solving via “i/oClingo” scripts
#include <iclingo>.
prg.add("request1", [], "request(2,1,1).")
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 18 / 20
![Page 76: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/76.jpg)
Summary
Outline
1 Background
2 (More) Control
3 Summary
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 19 / 20
![Page 77: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/77.jpg)
Summary
Summary
ASP as an under-the-hood technology !
Clingo 4Multi-shot ASP solving
Continuously changing programs
Opens up new areas of applications
AgentsPoliciesPlanningRoboticsInteractionTheory solvingQuery-answering. . .
http://potassco.sourceforge.net
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 20 / 20
![Page 78: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/78.jpg)
Summary
Summary
ASP as an under-the-hood technology !
Clingo 4Multi-shot ASP solving
Continuously changing programs
Opens up new areas of applications
AgentsPoliciesPlanningRoboticsInteractionTheory solvingQuery-answering. . .
http://potassco.sourceforge.net
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 20 / 20
![Page 79: 2015 01 09 - Rende - Unical - Martin Gebser: Clingo = Answer Set Programming + Control](https://reader034.fdocuments.net/reader034/viewer/2022051516/55ca7096bb61eb70318b4590/html5/thumbnails/79.jpg)
Summary
Summary
ASP as an under-the-hood technology !
Clingo 4Multi-shot ASP solving
Continuously changing programs
Opens up new areas of applications
AgentsPoliciesPlanningRoboticsInteractionTheory solvingQuery-answering. . .
http://potassco.sourceforge.net
M. Gebser, R. Kaminski, B. Kaufmann, T. Schaub Clingo = ASP + Control 20 / 20