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

Disallow unused variables #408

Open
oflatt opened this issue Aug 8, 2024 · 2 comments
Open

Disallow unused variables #408

oflatt opened this issue Aug 8, 2024 · 2 comments

Comments

@oflatt
Copy link
Member

oflatt commented Aug 8, 2024

If you write a rule with an unused pattern variable, we should throw an error:

(rule ((Add a b))
         ((Neg b)))

If you want to ignore something, use an underscore

(rule ((Add _a b))
        ((Neg b)))
@yihozhang
Copy link
Collaborator

Will this be too radical? Will a warning / opt-in feature be more appropriate? For instance, in eggcc, we have templates for generating query atoms like (= e (Add e1 e2)) and now all of a sudden we need to condition on whether e,e1,e2 are used in the body, which is a burden to users.

@yihozhang
Copy link
Collaborator

Actually, reopening this issue since this can be part of a (set-option strict) similar to #325

@yihozhang yihozhang reopened this Sep 23, 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

2 participants