Questions tagged [clingo]

Questions related to the clingo system of the potassco suite.

The clingo system of the potassco suite. https://potassco.org/

Related tags:

155 questions
2
votes
1 answer

How to sum all rather than just distinct values in clingo?

The following code produces x(3) rather than x(4) because it adds 1 and 2 together even though 1 appears twice. What is the right way of obtaining total sums in clingo? p(0,1;1,1;2,2). x(X) :- X = #sum { Y: p(_,Y) }.
rudolfovic
  • 3,163
  • 2
  • 14
  • 38
2
votes
2 answers

How to define multiple penalties to minimise overall in clingo?

I am trying to use clingo to generate tournament player-room allocations: player(1..20). room(1..4). played(1..20, 0). rank(1..20, 1). played(1..20, 1..20, 0). 0 { used_room(R) } 1 :- room(R). 3 { game(P, R) } 4 :- used_room(R), player(P). :-…
rudolfovic
  • 3,163
  • 2
  • 14
  • 38
2
votes
1 answer

Disjunction in the body of a rule in clingo

I think this is basic, but how do you do disjunction with literals to the body of a rule in clingo? I tried p3 :- p1 ; p2. But it does not work and it assumes the answers of p3 :- p1 , p2. Thanks.
arjepak
  • 153
  • 1
  • 6
2
votes
1 answer

determining if two cliques are different

Assume I have a graph and want to find 2 different cliques withhin the graph. A clique is a subset of the graphs vertices where all of them are connected. Example Graph with 2 cliques (a,b,c) and (b,c,d) of cliquesize 3 : edge(a,b). edge(a,c).…
DuDa
  • 3,718
  • 4
  • 16
  • 36
2
votes
1 answer

How do I extract the trees from a graph using Answer Set Programming?

There is an undirected graph (V,E), weights on the edges w : E → N, a target k ∈ N, and a threshold O ∈ N. Find a k-vertices tree of the graph of weight less than the threshold. In other words, select k vertices and k - 1 edges from V and E…
2
votes
1 answer

Brave/Cautious reasoning in clingo

In Clingo guide, there are two modes called cautious and brave introduced as the follows: brave Compute the brave consequences (union of all answer sets) of a logic program. cautious Compute the cautious consequences (intersection of all answer…
BobHU
  • 402
  • 5
  • 18
2
votes
1 answer

Installation of Clingo on a Mac

I am trying to install Clingo on my Mac (macOS Mojave -- 10.14.3). I have downloaded the last version of Clingo (5.3.0) and unzipped it. If I open the Clingo file with the terminal it says: Last login: Fri Mar 1 09:31:31 on…
Esther
  • 21
  • 1
2
votes
1 answer

How to represent the unknown knowledge to be reasoned in Answer Set Programming?

Here is the problem to solve: If Jim does not buy toys for his children, Jim’s children will not receive toys for Christmas. If Jim’s children do not write their Christmas letters, Jim will not buy them toys. Jim’s children do receive toys for…
BobHU
  • 402
  • 5
  • 18
2
votes
1 answer

Is "undecidable" can be represented in ASP (Answer Set Programming)?

A sentence like If a(X), then one can't decide/conclude anything about a(X) being b(X) First attempt b(X) | -b(X) :- a(X). Second attempt :- a(X), b(X). :- a(X), -b(X). First one makes no change to the solution while second one makes everything…
Pay C.
  • 1,048
  • 1
  • 13
  • 20
2
votes
1 answer

Mixed quantification in Answer Set Programming

I would like to be able to formulate the following FOL sentence in ASP/clingo: ∀ X. prop(X) ⇐ (∃ Y. ∀ V. ∃ A. (p(Y, V, A) ∧ q(X, V, A)) ) The domain of both X and Y is given by dom/1. The domain for A is given by…
2
votes
1 answer

clingo compiler computing multiple values for #min

I’m having a basic issue whilst using python scripting in ASP / `clingo (Version 4+). I’ve reconstructed the problem with a minimal example, to illustrate the point. Obviously, in the example, I don’t need to use scripts. In my more complicated…
Thomas
  • 175
  • 11
2
votes
1 answer

problems generating interval information

Given a a binary function over time, I try to extract the information about the intervals occuring in this function. E.g. I have the states a and b, and the following function: a, a, b, b, b, a, b, b, a, a Then i would want a fact interval(Start,…
Uzaku
  • 511
  • 5
  • 17
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
2
votes
1 answer

how to minimize the number of instances of a literal, in clingo 4.5

I'm unsure how to write an optimization statement in clingo4 (ASP solver). I want to minimize the total number of instances of certain literals in each answer set. I'm simulating a fire-response agent in ASP. The agent can choose to perform certain…
hassapikos
  • 59
  • 1
  • 2
  • 10
2
votes
2 answers

Aggregates in clingo

I have generated : curr(p5,2) curr(p5,1) curr(p5,6) How can I sum up the lase fields 2+1+6? I saw the following in page 21 of clingo_guild.pdf : 15 :- not M-2 [ enroll(C) : hours(C,H) = H ] M, max_hours(M). and come up : #sum [pick(P) : curr(P,I)…
tak-po li
  • 85
  • 4
1
2
3
10 11