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

Support if! versus if #421

Closed
DavePearce opened this issue Dec 10, 2024 · 2 comments
Closed

Support if! versus if #421

DavePearce opened this issue Dec 10, 2024 · 2 comments
Assignees

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Dec 10, 2024

This presents some challenges because if performs some kind of inference. For example, consider this:

(defcolumns X Y A)
(defconstraints c1 () (if (eq! X Y) A))
(defconstraints c () (if (eq X Y) A))

Both constraints compile down to the same underlying form. One solution to this issue would be to remove use of if altogether from the constraints. That way, we can reinterpret its meaning as we see fit.

@DavePearce
Copy link
Collaborator Author

Another good example:

(defcolumns (X :binary@loob) (Y :binary@bool) A)
(defconstraints c1 () (if X A))
(defconstraints c2 () (if Y A))

These generate different constraints. The first is: if X == 0 then A whilst the second is if Y != 0 then A.

@DavePearce
Copy link
Collaborator Author

Fixed as part of #393

@DavePearce DavePearce self-assigned this Dec 13, 2024
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