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
0
votes
1 answer

Compare cardinality of multiple sets and get specific value from member of greatest set

I am using clingo to solve flood-it problems. I use the predicate frontier([CELL], [COLOR], [TIMESTEP]) to keep track of all cells that are neighbors of the flood. The set of frontiers could look something like this: frontier(c(1,3),2,3)…
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
0
votes
0 answers

ununderstandable behavior subprocess.Popen(cmd,stdout) and os.system(cmd)

I use an external command inside a python script using firstly: subprocess.Popen(cmd, stdout=subprocess.PIPE) then i get the stdout. The problem is that the result of this external command when executing it inside the script is not the same if i…
Inzo. Geo
  • 47
  • 4
0
votes
1 answer

Summing multiple values in Clingo

I am computing the sums of multiple fields in clingo: x(1,2,3). x(4,5,6). x(7,8,9). y(A,B,C) :- A = #sum { A1, B1, C1 : x(A1,B1,C1) }, B = #sum { B1, A1, C1 : x(A1,B1,C1) }, C = #sum { C1, A1, B1 : x(A1,B1,C1) }. This works. The output…
firefrorefiddle
  • 3,795
  • 20
  • 31
0
votes
1 answer

Clingo/ASP: Best way to generate characters in a story generator

I am trying to write a story generator in Clingo. I am trying to say "new characters can be born if existing characters give birth to them." I define new characters as entity(<int\>), which is the best way I could think of to representing…
Sid Datta
  • 1,110
  • 2
  • 13
  • 29
0
votes
1 answer

lparse/clingo: How to express the following in a compact form?

b(X) :- a(b(X)). c(X) :- a(c(X)). d(X) :- a(d(X)). etc. I want to express it in a compact form: F :- a(F). However, this is a syntax error. What is the correct way to do this?
Sid Datta
  • 1,110
  • 2
  • 13
  • 29
0
votes
2 answers

create subset and use each atom only once

I am totally new in asp. I need to create a group of teams. Each group must consist of 3 randomly chosen teams. A team can be in only one group. Thanks in advance. Here is my code team(fener;galata;besik;van;adana;mardin). neq(X,Y) :-…
Ismail Sahin
  • 2,640
  • 5
  • 31
  • 58
0
votes
0 answers

Parsing error using net.sf.tweety.lp.asp.solver.Clingo

I am trying to run the clingo solver from net.sf.tweety.lp.asp, version 1.8. I am using clingo version 4.3.0. The code is: Clingo solver = new Clingo("/homes/ftm13/bin/clingo"); solver.computeModels(new…
ftm13
  • 1
0
votes
1 answer

grounding predicates with python scripts in asp/clingo

I am using clingo version 4 and wish to be able to ground relations via python script (please don't ask why, it's not a crime, since you can at least ground 1-ary relations). I am hoping this is possible, and need some help. #script (python) import…
Samot
  • 1
  • 1
0
votes
1 answer

asp (clingo) : why are ordered sums not working

Consider the followig code, compiled in clingo. File test.lp. Compile command: clingo 0 test.lp. col(("rot";"blau")). freq("rot","hell",2). freq("rot","dunkel",2). freq("rot","hell",5). freq("blau","hell",20). freq("blau","dunkel",30).…
Thomas
  • 175
  • 11
0
votes
1 answer

ASP Clingo - splitting graph to n cliques

For a given graph i need to represent it using at most n cliques. I have problem with this task. This is similar to n-coloring of graph which is opposite of given graph (Graph b is opposite of graph A when if edge(a, b) in graph A than edge(a, b)…
domandinho
  • 1,260
  • 2
  • 16
  • 29
0
votes
1 answer

Use Clingo 4.5 with Gringo 3

I am trying to run the code from the exercises from Chapter 8 of the PCGBook. They use clingo but don't say what version they are using. When I downloaded the latest version of Clingo from Potassco's sourceforge (version 4.5.4), it gives me lexer…
nightwuffle
  • 311
  • 3
  • 10
0
votes
2 answers

Building clingo on windows with scons

I am trying to build clingo with scons. It complains about my compiler set which is "gcc-7-win64" latest version I could find. (I tried it with several older versions) Error messages: error: no usable c++ compiler found error: no usable bison…
Cihan
  • 175
  • 1
  • 3
  • 14
0
votes
0 answers

answer set programming "Guesses"

I want to pick exactly "steps" item from the guess block however I got unsat when I limit the guess with cardinalities. % Pick a series of move %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% steps { vpr(X,Y) :…
Cihan
  • 175
  • 1
  • 3
  • 14
0
votes
1 answer

Answer Set Programming: Group into two sets so that those who like each other are in same set, and dislike = different set

I'm basically a beginner to Answer Set Programming (CLINGO), so I've been attempting this problem for hours now. person(a;b;c;d;e;f). likes(b,e; d,f). dislikes(a,b; c,e). People who like each other must be in the same set, and cannot be in the same…
1010101
  • 51
  • 1
  • 1
  • 4
1 2 3
10
11