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

Dafny's occurs-check for type synonyms can be tricked #12

Closed
plaidfinch opened this issue Jul 20, 2016 · 0 comments
Closed

Dafny's occurs-check for type synonyms can be tricked #12

plaidfinch opened this issue Jul 20, 2016 · 0 comments
Assignees

Comments

@plaidfinch
Copy link
Collaborator

Dafny will correctly rule out the following bad type synonyms; they're equi-recursive, and should not be permitted:

type Bad = set<Bad>
type Bad = (Bad, Bad)
type Bad = map<Bad, Bad>

However, Dafny seems not to detect cycles deeper than one level of nesting; the following type synonyms are all accepted:

type Bad = set<set<Bad>>
type Bad = seq<(Bad, Bad)>
type Bad = map<int, set<Bad>>

...and so on.

Any of these will cause a fatal crash in the Dafny verification process whenever Bad is mentioned. For instance, any of the above type synonyms, when paired with the below definition, crash Dafny:

predicate UhOh(bad: Bad)

It seems that the syntactic occurs check only looks one level deep; it should recursively descend the structure of the type.

@plaidfinch plaidfinch self-assigned this Jul 27, 2016
camrein added a commit that referenced this issue Apr 8, 2021
Added ability to cancel the program verification.
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