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

Implementation improvements to clpz_t/2 #2325

Open
triska opened this issue Feb 11, 2024 · 0 comments
Open

Implementation improvements to clpz_t/2 #2325

triska opened this issue Feb 11, 2024 · 0 comments

Comments

@triska
Copy link
Contributor

triska commented Feb 11, 2024

I am filing this issue so that the comment posted in #2319 (comment) is properly remembered and addressed:

Is there a better implementation of clpz_t/2? Currently, reification is internally used in order to benefit from argument indexing and hence make the test deterministic if possible. Reification clearly has an overhead compared to "backtracking out" the cases, which also has an overhead in the form of redundant choice-points that may be left on the local stack.

Since the construct itself is sensible, it is a good candidate for implementation improvements. For example, could goal expansion be applied, similar to what (#=)/2 and other arithmetic comparisons already do? The pattern if_(.... clpz_t(....)), ..., ...) could be expanded to more efficient versions that take into account the concrete arithmetic term that occurs in the first argument of clpz_t/2, even if it occurs within a lambda expression as show in #2320.

I would greatly appreciate all insights and suggestions. Thank you a lot!

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