Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
114 views

I'm trying to solve time dependent ASP problem using Clingo (version 5.7.1). Imagine that some project can start any year (2025, 2026 or 2027), and depending on this, its value in a given year can be ...
Alexander Belinsky's user avatar
0 votes
0 answers
56 views

First of all: how is the operator "{}" really called? The documentation ist not very good at answering this. I call it powerset operator because it creates a powerset of all elements. { z(1)...
Frank Schwidom's user avatar
1 vote
1 answer
32 views

Beginner to ASP here :) I need to define a default value for an atom when it isn't provided in the input. % creating rooms cost(create(room(R)), W) :- room(R), roomDomainNew(R), roomCost(W). Here, if ...
Kaushik Narayan's user avatar
0 votes
1 answer
179 views

I develop an application in clingo and here is my code: conflicting_hours(Course1, Section1, Room, Start1, Hour1) :- occupies(Course1, Section1, Room, Start1, Hour1), occupies(Course2, ...
OzanCinci's user avatar
0 votes
0 answers
166 views

I have a Clingo program optimising parcel delivery, and there are 2 constraints to limit the weight and the volume a car can deliver respectively, however these constraints are not working. ...
Martim Gouveia's user avatar
2 votes
1 answer
368 views

I am trying to write a sudoku in clingo to learn the syntax a bit more. The part that I am satisfied with correctly represents the column/row constraints: subgrid_size(3). number(1..S*S) :- ...
xarxax's user avatar
  • 25
0 votes
2 answers
401 views

I have a predicate pred/2, how do I #show this predicate in the answer that is sorted by the first argument, given that the first argument will be numerical? I couldn't find any relevant documentation ...
vocalsquirrel's user avatar
0 votes
1 answer
145 views

I’m new to clingo (answer set programming) and I’m stuck with a very simple problem. I want to simulate a very simple behaviour: A game board with two rows and three columns, and three tokens, placed ...
Marc's user avatar
  • 101
0 votes
1 answer
144 views

I want to run a clingo program containing an optimization. I already have a (suboptimal) model. Is there a way to "help" clingo with the existing model? I'm using the python api. Minimal ...
Duda's user avatar
  • 3,746
0 votes
1 answer
202 views

I am trying to learn and understand Answer Set Programming with Clingo (https://potassco.org/clingo/run/). Here is a task I am struggling with now: Find the sequence s = (s1, s2, ..., sn) with the ...
nooblet2's user avatar
1 vote
1 answer
415 views

I'm trying to find all the shortest path from one source node to all other destination node (so 1-3, 1-5, 1-4) with the relative cost for each shortest path. I've tried with this code node(1..5). ...
user16457964's user avatar
2 votes
1 answer
373 views

I'm currently learning answer set programming with clingo and I'm really struggling with calculating the distance between nodes in a directed graph. I would know how to hardcode it for every distance ...
Chrizzoh's user avatar
0 votes
2 answers
87 views

For example, I input four node: node(a). node(b). node(c). node(d). Without no hard-code, how can I pick an arbitrary input as a variable. I set a root(A) I want root(A) equal to node(a)
Xie Dongzhan's user avatar
2 votes
1 answer
800 views

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 ...
Geneviève M.'s user avatar
0 votes
1 answer
140 views

Thats my task: We have coins: 1 cent, 2 cents, 5 cents, 10 cents, 20 cents, 50 cents, 1 dollar and 2 dollars. How many ways can you get 2 dollars using anynumber of coins? I accualy ended up with ...
Heaglock's user avatar
0 votes
1 answer
337 views

I am new to Clingo and encountered a situation where I needed to remove a subset from the answer set. For example, I have p(1..9). and I want to remove p(5) from my answer set. How can I do it? ...
Ali Ghazi's user avatar
0 votes
1 answer
378 views

I have the following code: 1{p(1..10)}10. :- p(I*2). and it shows 31 answers, But I just need the max subset p(1) p(3) p(5) p(7) p(9). How can I do it?
Reason's user avatar
  • 9
1 vote
1 answer
465 views

I am totally new in asp, I am learning clingo and I have a problem with variables. I am working on graphs and paths in the graphs so I used a tuple such as g((1,2,3)). what I want is to add new node ...
Ali Ghazi's user avatar
1 vote
1 answer
994 views

I'm trying to run the following Blockworld Planning Program in python: #include <incmode>. #program base. % Define location(table). location(X) :- block(X). holds(F,0) :- init(F). #program ...
thesofakillers's user avatar
1 vote
1 answer
877 views

I have the following blocks world program and I want to create a serializable plan for the following scenario: Initially: loc(m)=table, loc(l)=m, loc(a)=l, loc(b)=a, loc(c)=b, loc(o)=table, loc(n)=o, ...
user avatar
-1 votes
1 answer
57 views

I have a program written in a text file and I want to execute this file using dlv in the command prompt, however it keeps returning this error: heba.txt: line 0: can't open input. Any idea how to ...
heba hammad's user avatar
2 votes
1 answer
1k views

I'm currently struggling with the following problem: Let's assume this Pseudo-Code: % Animal: ID, Type, Cost animal (id1, dog, 300). animal (id2, dog, 400). animal (id3, dog, 600). animal ...
TheXyresiC's user avatar
1 vote
1 answer
465 views

I have written an ASP program with an optimization condition in the end. When I compile it, even though I get the correct result, in the summary I get a negative value for the optimization (i.e. -3). ...
john_ny's user avatar
  • 183
0 votes
1 answer
168 views

I'm learning Answer Set Programming by solving the zebra puzzle. I found some solution examples online. But someone told me that I can solve the puzzle without using cardinality constraint macro to ...
AmuMa's user avatar
  • 1
1 vote
1 answer
561 views

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 ...
cheshire's user avatar
  • 1,159