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

Type-emptiness testing should produce witness #1029

Open
jclark opened this issue Jun 3, 2022 · 1 comment
Open

Type-emptiness testing should produce witness #1029

jclark opened this issue Jun 3, 2022 · 1 comment
Assignees
Labels
semtype Relates to types module Type/Improvement

Comments

@jclark
Copy link
Contributor

jclark commented Jun 3, 2022

In a case where a type S is expected to be a subtype of type T, we test whether the set difference of S and T is empty, and then give an error if not. This results in an error message that is not very informative, particularly when S and T are complicated.

We can do better by making the API that tests whether a set is empty produce a witness (or perhaps multiple witnesses) in the case that it is not empty. The witness is a value (a shape) that is in the set. The error message can then include a description of the witness in the error message.

@jclark jclark added the semtype Relates to types module label Jun 3, 2022
@jclark
Copy link
Contributor Author

jclark commented Jul 21, 2022

Draft PR in #1040

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semtype Relates to types module Type/Improvement
Projects
None yet
Development

No branches or pull requests

4 participants