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
5
votes
0 answers

Clingo answer set programming newbie

I got the following answer set programming problem but not sure if my answer is correct: A(X) are normally E(X) U(X) are normally not E(X) G(X) are normally E(X) Every G(X) is U(X) U(X) are normally A(X) G(t1) G(t2) and not E(t2) U(t3) The…
Matt
  • 739
  • 2
  • 6
  • 10
4
votes
1 answer

Prolog/ASP(Clingo) to CLIPS translater

Is there any easy way to translate a Prolog/ASP code into CLIPS? Something like this one, but with CLIPS instead of Prover9: https://github.com/potassco/anthem/tree/master/examples
ciurlaro
  • 742
  • 10
  • 22
4
votes
4 answers

How should list be represented in ASP (Answer Set Programming)?

A processor 'a' takes care the header 'a' of a message 'a_b_c_d' and passes the payload 'b_c_d' to the another processor in the next level as following: msg(a, b_c_d). pro(a;b;c;d). msg(b, c_d) :- pro(X), msg(X, b_c_d). msg(c, d) :- pro(X),…
tak-po li
  • 85
  • 4
3
votes
1 answer

N-Queens problem using answer set programming

trying to learn answer set programming and decided to give the n-queens problem a go. This is what I have so far:- % Queens are placed on an n x n chess board. % Each queens must not attack each other. % Represent the chess board…
3
votes
2 answers

Gather all answer sets into one answer set (ASP)

my question is, if I can gather all answer sets into one answer. I attach the code below for my program. The results that it returns and a description of what I would like to have. % Main domain predicates…
3
votes
1 answer

How to use data structures instead of command line arguments with clingo - (ASP)

I am starting off with logical programming, and I am working on a simple program to find shortest paths between nodes. The only tutorial I could really understand dealt with command arguments. Is there a way I can replace Args in my program for a…
3
votes
2 answers

ASP Hamiltonian Cycle Story

Hello I am new to answer-set-programming. I have done a little prolog in the past! I am trying to solve this problem I believe it can be solved with hamiltonian-cycle, let me know your opinion. If you are not familiar with ASP you can visit this…
3
votes
0 answers

JupyterLab/Codemirror add a new Language Mode

I am new to both JupyterLabs and Codemirror, However, I have a new simplemode language syntax definition that I would like to apply for Clingo. I based the file off the Dockerfile mode. However, I do not know how to include this file in the build…
sosukeinu
  • 379
  • 4
  • 16
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
3
votes
1 answer

Count Aggregates in clingo

Test data addEmployee(EmplID, Name1, Name2, TypeOfWork, Salary, TxnDate) addEmployee("tjb1998", "eva", "mcdowell", "ra", 55000, 20). addEmployee("tjb1987x", "ben", "xena", "cdt", 68000, q50). addEmployee("tjb2112", "ryoko", "hakubi", "ra", 63000,…
kjosh
  • 158
  • 2
  • 13
3
votes
1 answer

Clingo: create custom function

I am at wit's end as to create a "function" in clingo, if such can be defined. In a simplified version of what I am trying to accomplish, I wrote this very short program: a(1..3). adj(X,Y) :- a(X), a(Y), abs(X-Y)==1. #hide a/1. Basically, I want…
Andrea Aloi
  • 971
  • 1
  • 17
  • 37
2
votes
1 answer

Calculating the distance between two nodes in a directed Graph

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 but that's no real way to do it. I currently have…
Chrizzoh
  • 35
  • 5
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

Struggles with the choice rule in Clingo (Answer-Set-Programming)

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 (id1, cat, 200). animal (id2, cat,…
TheXyresiC
  • 23
  • 2
2
votes
2 answers

Generating Solution Candidates For Matching People in Clingo/ASP

I have a list of people and I want to pair them all then do some filtering based on preferences. When I generate my candidate solutions, how do I avoid creating candidate solutions that re-pair a people. For example: person(a;b;c;d) . {match(X, Y):…
exchez
  • 493
  • 1
  • 4
  • 13
1
2 3
10 11