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

Bind and use variable #197

Open
mihaibudiu opened this issue May 3, 2019 · 2 comments
Open

Bind and use variable #197

mihaibudiu opened this issue May 3, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mihaibudiu
Copy link

Is this illegal?

A(u) :- R(u, u).

It looks to me like this is just syntactic sugar for

A(u) :- R(u, v), u == v.

Maybe the compiler should accept this and make this transformation in the front-end.

@ryzhyk ryzhyk added the enhancement New feature or request label May 3, 2019
@ryzhyk
Copy link
Contributor

ryzhyk commented May 3, 2019

Is this illegal?

It is at the moment.

It looks to me like this is just syntactic sugar for
A(u) :- R(u, v), u == v.
Maybe the compiler should accept this and make this transformation in the front-end.

Yes, should be doable.

@vmware vmware deleted a comment from mihaibudiu May 3, 2019
@mihaibudiu
Copy link
Author

Here is another example which fails:

Rresult(_c, _p) :- Rprogress(strlen(_p), _c, _p).
Unknown variable: _p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants