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

Evaluation should stop early in some cases #234

Closed
tsandall opened this issue Jan 27, 2017 · 1 comment
Closed

Evaluation should stop early in some cases #234

tsandall opened this issue Jan 27, 2017 · 1 comment

Comments

@tsandall
Copy link
Member

If a rule head does not contaIn vars, evaluation should stop after it finds the first proof for the body. Currently, evaluation/topdown continues to find all proofs. For instance:

OPA 0.4.0 (commit 4ea2b27, built at 2017-01-25T18:34:39Z)

Run 'help' to see a list of commands.

> p :- a = [1,2,3], a[_] > 0
> p
true
> trace
> p
Enter eq(data.repl.p, _)
| Eval eq(data.repl.p, _)
| Enter p = true
| | Eval eq(a, [1, 2, 3])
| | Eval gt(a[_], 0)
| | Exit p = true
| Redo p = true
| | Redo gt(1, 0)
| | Exit p = true
| Redo p = true
| | Redo gt(2, 0)
| | Exit p = true
| Exit eq(data.repl.p, _)
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant