Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are Aggregates Fully Supported? #8

Open
damianoazzolini opened this issue Jan 9, 2024 · 1 comment
Open

Are Aggregates Fully Supported? #8

damianoazzolini opened this issue Jan 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@damianoazzolini
Copy link

Hi. I'm writing a simple program but the following line:

fb(FB):- #count{ X : f(X), b(X)} = FB.

raises a syntax error (at FB after =).
However, by looking (very quickly) at the grammar in the source code, aggregates seems to be supported, but in limited form.
So, is there a way to represent the previously reported line within this tool?

Thanks.

@denismaua
Copy link
Contributor

Hi Damiano,

Indeed aggregators are supported to some extent. For instance, the program

0.5::a(1).
b(1) :- #count{X: a(X)} = 1.
{a(2)}.
#query(b(1)).

parses just fine (and pasp outputs P(b(1)) in [0,1]). However, it seems that variables in the comparison operator are not supported, which seems to be your problem. So the program

0.5::a(1).

b(Y) :- #count{X: a(X)} = Y.
{a(2)}.

#query(b(1)).

will produce a parsing error at expression = Y. I believe a quick fix to the parser should solve the issue; I'll add it to our bug list.

@denismaua denismaua added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants