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

Match with duplicate variables #68

Open
BrunoDutertre opened this issue Mar 16, 2022 · 1 comment
Open

Match with duplicate variables #68

BrunoDutertre opened this issue Mar 16, 2022 · 1 comment
Assignees

Comments

@BrunoDutertre
Copy link

Not sure what's intended but nothing is checking for duplicate variables in a match pattern.
So this is allowed:

(declare sort type)
(declare term type)
(declare cons (! t term (! u term term)))
(declare Bool sort)
(program bad ((t term)) sort (match t ((cons x x) Bool)))

Unfortunately, allowing this can lead to bad results for the same reason as in issue #67:

(declare sort type)
(declare term type)
(declare cons (! t term (! u term term)))
(declare Bool sort)
(declare x type)
(program bad ((t term)) sort (match t ((cons x x) Bool)))
(declare b x)

This fails to check.

@ajreynol ajreynol self-assigned this Mar 16, 2022
@ajreynol
Copy link
Member

We should disallow duplicate variables here.

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