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

Recursion detection is too strict #81

Open
stephanzwicknagl opened this issue May 7, 2024 · 0 comments
Open

Recursion detection is too strict #81

stephanzwicknagl opened this issue May 7, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@stephanzwicknagl
Copy link
Collaborator

  • The recursion detection has to be improved, because it can wrongly detect recursion sometimes

Example:

in(E,alle) :- map(_,_,S), in(SS,S), in(E,SS), I=1..n.
{ in(E,e(I)) } :- in(E,alle), I=1..n.
in(E,be(I..n)) :- in(E,e(I)).
in(E,e) :- in(E,e(I)).

This set of rules will be grouped into a recursive component, because the rules have the literal in/2 in their body.

However, the ground rules they generate are very different. Rule 1 has dependant in with alle, rule 2 has dependant in with e(I), rule 3 has dependant in with be(I), rule 4 has dependant in with e. This means that the predicates are not really recursively generated.

Renaming the predicates shows this:

in0(E,alle) :- map(_,_,S), in(SS,S), in(E,SS), I=1..n.
{ in1(E,e(I)) } :- in0(E,alle), I=1..n.
E,be(I..n)) :- in1(E,e(I)).
in3(E,e) :- in1(E,e(I)).
@stephanzwicknagl stephanzwicknagl added the bug Something isn't working label May 7, 2024
@stephanzwicknagl stephanzwicknagl added enhancement New feature or request and removed bug Something isn't working labels Jun 25, 2024
@javier-romero javier-romero self-assigned this Jun 25, 2024
@stephanzwicknagl stephanzwicknagl added this to the Up Next milestone Jun 27, 2024
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