Open 0xbb opened 9 years ago
Dear Bruno!
Conditional literals are supported, but currently only for ordinary atoms and not for builtin predicates. Therefore you can write your program as follows:
% pair(ID, VALUE). pair(1, 1). pair(2, 1). pair(2, 3). pair(3, 2).
id(X) :- pair(X,). set2(X) :- pair(,X), X <= 2.
% all ids only having values smaller 2 all_values_smaller_2(ID) :- id(ID), set2(X) : pair(ID, X).
Thanks for suggesting improvements!
Best regareds, Christoph
2015-06-22 13:42 GMT+02:00 Bruno Bierbaumer notifications@github.com:
Hello! I would like to use ASP generator rules to model a problem in dlvhex2. But I couldn't find anything about that in the documentation.
Is there a way to use generator rules with dlvhex2?
I made a mini example modeled after my requirements: Facts:
% pair(ID, VALUE). pair(1, 1). pair(2, 1). pair(2, 3). pair(3, 2).
id(X) :- pair(X,_).
I want to be able to write:
% all ids only having values smaller 2 all_values_smaller_2(ID) :- id(ID), X <= 2: pair(ID, X).
Instead of:
exp(ID) :- pair(ID, X), X > 2. all_values_smaller_2(ID):- not exp(ID), id(ID).
Is this possible with dlvhex2?
Additionally it also would be nice to have the Gringo short hand syntax available:
id(1..3). pair(1,1; 2,1; 2,3; 3,2).
Greetings, Bruno
— Reply to this email directly or view it on GitHub https://github.com/hexhex/core/issues/15.
Hi Christoph! Thanks for your amazingly fast answer :)! I think this is actually solving my problem.
Greetings, Bruno
Hello! I would like to use ASP generator rules to model a problem in dlvhex2. But I couldn't find anything about that in the documentation.
Is there a way to use generator rules with dlvhex2?
I made a mini example modeled after my requirements:
Facts:
I want to be able to write:
Instead of:
Is this possible with dlvhex2?
Additionally it also would be nice to have the Gringo short hand syntax available:
Greetings, Bruno