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 error when min of empty set under catch undef #445

Open
SaadAttieh opened this issue Jul 22, 2019 · 5 comments
Open

type error when min of empty set under catch undef #445

SaadAttieh opened this issue Jul 22, 2019 · 5 comments

Comments

@SaadAttieh
Copy link
Collaborator

find a : int(1)

such that catchUndef(min({}), -1) = -1
such that catchUndef(max({}), -1) = -1

output:

Generating models for test2.essence
Error 1:
    In a 'such that' statement: catchUndef(min({}), -1) = -1
    Error:
        Type error in min({})
                      Unexpected type inside min: set of ?
Error 2:
    In a 'such that' statement: catchUndef(max({}), -1) = -1
    Error:
        Type error in max({})
                      Unexpected type inside max: set of ?
@ott2
Copy link
Collaborator

ott2 commented Jul 23, 2019

Isn't this just the usual issue about empty set not having a type? It can be coerced to have a type via something by giving it a provenance something like {0} intersect {1}, and perhaps also using the backtick notation that I never remember?

@SaadAttieh
Copy link
Collaborator Author

SaadAttieh commented Jul 23, 2019 via email

@ozgurakgun
Copy link
Collaborator

ozgurakgun commented Jul 23, 2019 via email

@SaadAttieh
Copy link
Collaborator Author

SaadAttieh commented Jul 23, 2019 via email

@ott2
Copy link
Collaborator

ott2 commented Jul 30, 2019

Agree with Saad, also catchUndef makes for interesting semantics. :-)

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

3 participants