Questions tagged [answer-set-programming]

Answer set programming is a declarative programming paradigm that can solve difficult search problems. It is based on the stable model (answer set) semantics of logic programming. Unlike traditional programming languages, we don’t give step by step instructions in answer set programming. It is something more like this is what I want, now you work out how to do it.

Answer set programming (ASP) is a declarative programming paradigm that can solve difficult search problems. It is based on the stable model (answer set) semantics of logic programming. Unlike traditional programming languages, we don’t give step by step instructions in answer set programming. It is something more like this is what I want, now you work out how to do it.

In answer set programming, if we can get the logic correct, ASP requires:

  • Orders of magnitude less code than imperative programming
  • Fewer points of failure
  • Less code to test
  • More productive (happier) programming life

traditional programming scheme

answer set programming scheme

161 questions
0
votes
2 answers

How can I go through a list of facts in Answer Set Prolog?

I have a list of facts like student(mary). student(john). etc, and also course(math). course(a). course(b). etc, and took(john,math). ... I have to say if a student can or can not graduate. To graduate a student have to have all the courses…
Victor Oliveira
  • 1,109
  • 1
  • 12
  • 29
0
votes
2 answers

how to use forall X in answer set programming (dlv) (answer set prolog)

I have the following facts in dlv, knows (X,Y) means X knows Y. knows(adam, dan). knows(adam,alice). knows(adam,peter). knows(adam,eva). knows(dan, adam). knows(dan,alice). knows(dan,peter). knows(eva, alice). knows(eva,peter). knows(alice,…
0
votes
1 answer

Clingo: assert partial constraints

I am trying to implement a program in clingo that solves one of those classic riddles where you have a series of assertions of facts and constraints and you have to deduce other facts. Here goes the problem: Five men of different nationalities live…
Andrea Aloi
  • 971
  • 1
  • 17
  • 37
0
votes
3 answers

Dealing with overloaded symbols in ambiguous grammars in ANTLR4

I am trying to write a parser for a dialect of Answer Set Programming (ASP) which, in terms of grammar, looks like Prolog with some extensions. One extension, for instance is expansion, meaning that fact(1..3). for instance is expanded in fact(1).…
Stefano Bragaglia
  • 622
  • 1
  • 8
  • 25
0
votes
1 answer

Video answers after a specific input

Sorry if my question is silly. I know nothing about programming but I have a doubt. Is it possible nowadays to create a program that could understand my words and give me a specific video as an answer. I mean the idea is like at the web of IKEA,…
-1
votes
1 answer

Passing a file to DLV in cmd

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 solve this issue? Thank you in advance.
-1
votes
1 answer

how to use sum in clingo?

I have the following dataset: vertex ( v1 ). vertex ( v2 ). vertex ( v3 ). vertex ( v4 ). vertex ( v5 ). vertex ( v6 ). vertex ( v7 ). vertex ( v8 ). vertex ( v9 ). weight ( v1 , v2 ,3). weight ( v1 , v3 ,3). weight ( v2 , v4 ,1). weight ( v2 ,…
-1
votes
1 answer

how to show all the maximum result in clingo when using the maximize?

I'm currently writing an asp program. when I comment the line #maximize{S:ce(S)}. within the program, the answer shows as follows omit the Answer 1 to 6. Answer: 7 review(harris,english) review(ben,math) review(ben,chinese) review(nick,math)…
A shur
  • 1
  • 1
-1
votes
1 answer

How to start with clingo?

I have install clingo. But I don't know how to run it. There are some examples in the file. I tried to run it. But it failed. I installed it in both windows and Ubuntu. And I have add it to the path. C:\Windows\system32>clingo color.lp\graph.lp…
-1
votes
1 answer

How do I run an Answer Set Programming file from a C++ File?

What methods are there that I can use to run an ASP file from the main function of my C++ code? I'm doing a project in which I am expected to control a simulated turtlebot using a C++ file, and use ASP code to construct an action plan that the…
-3
votes
1 answer

Getting started: where should I write the program?

so I am required to do an Answer-Set-Programming project, where we should solve some problem and create test cases, using the DLV solver. According to the specification of the project we need to make the files G.dl, Ch.dl, and test.dl so keeping in…
DS_UNI
  • 2,600
  • 2
  • 11
  • 22
1 2 3
10
11