Questions tagged [gringo]
18 questions
3
votes
2 answers
Clingo - Progression error/warning
I'm running the solver on a planning and between the various answer sets i get what I think is a warning (as it does not termiate the execution) saying the following:
Progression : [2;8] (Error: 3)
Progression : [3;8] (Error: 1.66667)
Progression :…

valent0ne
- 139
- 1
- 2
- 10
2
votes
1 answer
Only compute/solve a specific rule in clingo
Warning: ASP newbie.
Let's assume we have this simple program:
% crime scene
% Facts
present(harry). % was present on the crime scene
present(sally).
present(mary).
motive(harry). % has a motive
motive(sally).
guilty(harry).
% encoding /…

Geneviève M.
- 240
- 1
- 9
2
votes
1 answer
Answer Set Programming: how to assign students to a group such that no two students who dislike each other are in a same group
I am a beginner to Answer Set Programming. I want to group all students in a different groups such that:
1. Each group has 3 to 4 students
2. No two students who dislike each other are in the same group.
3. And we can not assign same student to…

Quest P
- 87
- 7
1
vote
1 answer
Answer Set Programming - filtering from a large number of models
instance.lp
node(1). node(2). node(3). node(4). node(5). node(6).
edge(1,2). edge(2,1). edge(4,1). edge(2,3). edge(2,6).
edge(3,4). edge(3,5). edge(5,6). edge(6,3).
begin(4).
I have this problem instance, directed graph with a beginning node…

cheshire
- 1,109
- 3
- 15
- 37
1
vote
3 answers
Maximize the interval in clingo
I have the following clingo code that generates the search space, followed by constraints.
{in(I,1..4)}=1 :- I=1..n.
:- [constraint1]
:- [constraint2]
This code works. But I need clingo to find the largest value of n for which a stable model…

Saqib Ali
- 3,953
- 10
- 55
- 100
1
vote
1 answer
ASP Clingo - getting the exact count of atoms
I'm looking forward to assign a specific count of persons to a specific shift. For example I got six persons and three different shifts. Now I have to assign exact two persons to every shift. I tried something like this but..
NOTE: this won't work,…

kaiserm99
- 146
- 8
1
vote
1 answer
Travelling Salesman Problem with Time Windows
I'm trying to solve TSP problem with additional constraint - time windows.
All the standard assumptions apply:
We start and end at given city.
Each city is visited only once.
We try to find the optimal path in terms of travel cost (here travel…

igorz24
- 31
- 3
1
vote
1 answer
clingo apply a variable range
I do not know much about clingo, i hope i can share the problem clearly.
Currently i've
cellUseCount(X,Y,C) :- C = #count{cell(X,Y)}, target(X,Y,XX,YY).
which returns results for each X,Y value. How can i get for X-XX and Y-YY range.
For instance:…

Dilara Albayrak
- 314
- 1
- 3
- 23
1
vote
1 answer
How to forbid grounding of false facts in Answer Set Programming/Gringo
When I run gringo on my program, it results into many grounded statements of the form
:- foo(a,b).
Then I also obtain many grounded constraints such as:
:- bar(a,x,y), foo(a,b).
Given the knowledge above, these are totally useless.
Note, these are…

user1747134
- 2,374
- 1
- 19
- 26
1
vote
1 answer
How to sum in Clingo?
I have the following dataset:
food_a(bagel, 245).
food_a(sandwich, 200).
food_a(salad,300).
food(bagel).
food(sandwich).
food(salad).
I want to satisfy the following constraint: Given a total calorie count, I want to return the food items that…

tortuga
- 737
- 2
- 13
- 34
0
votes
1 answer
Clingo: Intersecting All Possible Optimal Solutions (ASP)
I want to find atoms, within a pre-defined set of atoms, that are in all possible optimal solutions of an ASP problem.
I'll explain what i want to do. I have an optimization problem where multiple optimal answer sets can exist. An answer set…

J.Doe
- 21
- 4
0
votes
1 answer
How to write constraint involving a certain parameter in clingo?
I am attempting to solve the Google ASP Competition 2019 : Insurance Referee Assignment problem. The problem is provided in this link.
There is a hard constraint that if a referee has preference type of 0 then the case will not be assigned to that…
user11665646
0
votes
0 answers
sbass unable to read gringo output
I'm running a simple ASP program:
%Defining possible states of each of the rook space
occupied(t; f).
%Generate all possible grids
{rook(X, Y, D) : occupied(D)} = 1 :- X=2..x, Y=2..y.
%Bound the grid with empty space
rook(X, Y, f) :- X=0,…

chinahalffull
- 23
- 4
0
votes
1 answer
Clingo: logic OR in integrity constraint
For a lecture exercise, I have to represent in Answer Set Programming (we use Clingo as interpreter) a the following integrity constraint:
"You have to plan the calendar of a Masterclass. Normally, the lectures are on Fridays (8 hours) and…

Lorenzo
- 85
- 1
- 9
0
votes
1 answer
What do 1<0 and 1=-1 mean in clingo/ASP?
I have never used clingo before, and I find the online documentation incomplete (I also can't post to the Potassco forums). I have a piece of clingo code with lines of rules of the format
foo(L1, L2, L3) :- isa(thing,object), isa(thing,…

user2954167
- 155
- 1
- 3
- 14