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

fix: Don't assume type antecedents too early #1062

Merged
merged 40 commits into from
Jan 25, 2021

Conversation

RustanLeino
Copy link
Collaborator

This PR makes sure the type antecedent of a variable is not assumed until after the variable has been assigned.

Depends on PR #1061.

Fixes #851

  • Make type antecedents conditional in well-formedness checks of constructs that introduce bound variables (assign-such-that statements, let-such-that expressions, forall/exists expressions, set/map comprehensions, lambda expressions).

  • Order assignments to definite-assignment trackers properly.

  • Restrict yield-parameters to auto-init types.

There’s also some debugging code to evaluate how the new options differ from the previous.
This means that a type `T` can be passed as a `(0)` parameter even if `T` does not have an “zero bit pattern” value, as long as `T` does have _some_ compilable value.

Remove HasZeroInitializer method

Remove hasZeroInitializer parameter of TypeInitialization method.
Also, remove initializerIsKnown parameter of TypeInitialization().
RustanLeino and others added 9 commits January 24, 2021 23:52
# Conflicts:
#	Source/Dafny/DafnyAst.cs
#	Source/Dafny/Translator.cs
#	Test/allocated1/Allocated1.dfy.expect
#	Test/allocated1/AllocatedCommon.dfyi
#	Test/dafny0/GhostAutoInit.dfy
#	Test/dafny0/GhostAutoInit.dfy.expect
#	Test/dafny0/IteratorResolution.dfy.expect
davidcok
davidcok previously approved these changes Jan 25, 2021
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

Successfully merging this pull request may close these issues.

unsoundness: dafny seems to assume tuple and inductive datatypes are inhabited
2 participants