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

Override __setitem__ for constraints in the miniKanren state #18

Open
brandonwillard opened this issue Dec 30, 2019 · 0 comments
Open
Labels
CLP Constraint Logic Programming enhancement New feature or request

Comments

@brandonwillard
Copy link
Member

We could implement a version of __setitem__ in the miniKanren state object/mappings (e.g. ConstrainedState) that checks constraints immediately after being added to the state. A failure could throw an exception and halt the unnecessary unification of further variables for an unsuccessful state.

This approach would also require changes in the way unification updates states. Specifically, the function assoc might need to be replaced so that in-place updates can occur.

Also, we would need to be much better about checking constraints, since we would be checking them more often in this situation. For instance, we would need to be able to isolate logic variable dependencies so that we could—say—determine a constraint violation from an individual unification alone.

@brandonwillard brandonwillard added the enhancement New feature or request label Dec 30, 2019
@brandonwillard brandonwillard added the CLP Constraint Logic Programming label Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLP Constraint Logic Programming enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant