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: Make datatype cycle detection independent of auto-init #4997

Merged
merged 24 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5d45706
chore: Add documentation and sanity assertions
RustanLeino Jan 18, 2024
c868719
Compute IsObviouslyEmpty for inductive datatypes
RustanLeino Jan 18, 2024
d205272
Fix typo in comment
RustanLeino Jan 19, 2024
4036d59
Don’t use cache (that conflates all type-parrameter instantiations)
RustanLeino Jan 19, 2024
013546b
Also check cycles going through result type of total arrows
RustanLeino Jan 19, 2024
6fea52f
Add tests, and adjust for ordering for checks
RustanLeino Jan 19, 2024
a1f78c5
Simplify tests
RustanLeino Jan 19, 2024
bc9354b
Rename test file
RustanLeino Jan 19, 2024
98a3240
Add verification tests to confirm not auto-init
RustanLeino Jan 19, 2024
d6343ed
Set grounding-ctor-type-parameters and test compilation
RustanLeino Jan 19, 2024
8079558
Fix typo in comment
RustanLeino Jan 19, 2024
2fe447a
Merge branch 'master' into issue-4939
RustanLeino Jan 19, 2024
77f6046
Add release notes
RustanLeino Jan 19, 2024
2018422
Merge branch 'master' into issue-4939
RustanLeino Jan 19, 2024
5d1aec4
Merge branch 'master' into issue-4939
RustanLeino Jan 19, 2024
aec8edc
Fix whitespace
RustanLeino Jan 19, 2024
e660898
Don’t bother with cyclicity test if datatype had refinement error dur…
RustanLeino Jan 19, 2024
0cbc0dd
Change no-instance-because-of-datatype-cycle error into warning
RustanLeino Jan 22, 2024
a1275b1
Add a test that shows an empty datatype is provably empty
RustanLeino Jan 22, 2024
fc44f01
chore: Improve C#
RustanLeino Jan 23, 2024
2a660b5
fix: Box function-body results and let-RHS from datatype to trait
RustanLeino Jan 23, 2024
53ee5a4
Merge branch 'master' into issue-4939
RustanLeino Jan 23, 2024
84a81d5
Merge branch 'master' into issue-4939
ssomayyajula Jan 23, 2024
aad6805
Merge branch 'master' into issue-4939
RustanLeino Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test that shows an empty datatype is provably empty
  • Loading branch information
RustanLeino committed Jan 22, 2024
commit a1275b1d8a84a66e5b79b1ce11491914066acd1d
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ module NoAutoInit {
}
}
}

module ProvablyEmpty {
datatype BadList<X> = Cons(head: X, tail: BadList<X>) // warning: no instances

lemma NeverGetHere<X>(xs: BadList<X>)
ensures false
{
NeverGetHere(xs.tail);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
git-issue-4939b.dfy(24,11): Warning: because of cyclic dependencies among constructor argument types, no instances of datatype 'BadList' can be constructed
git-issue-4939b.dfy(16,12): Error: variable 'a', which is subject to definite-assignment rules, might be uninitialized here
git-issue-4939b.dfy(18,12): Error: variable 'b', which is subject to definite-assignment rules, might be uninitialized here

Dafny program verifier finished with 0 verified, 2 errors
Dafny program verifier finished with 1 verified, 2 errors