-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support quint sum types #2783
Support quint sum types #2783
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2783 +/- ##
=======================================
Coverage 78.83% 78.83%
=======================================
Files 466 466
Lines 15905 15921 +16
Branches 2572 2592 +20
=======================================
+ Hits 12539 12552 +13
- Misses 3366 3369 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tla-io/src/main/scala/at/forsyte/apalache/io/quint/QuintTypeConverter.scala
Outdated
Show resolved
Hide resolved
tla-io/src/test/scala/at/forsyte/apalache/io/quint/TestQuintEx.scala
Outdated
Show resolved
Hide resolved
tlair/src/main/scala/at/forsyte/apalache/tla/lir/TlaType1.scala
Outdated
Show resolved
Hide resolved
tlair/src/test/scala/at/forsyte/apalache/tla/typecomp/TestFunBuilder.scala
Outdated
Show resolved
Hide resolved
This gives us tests for supporting sum type conversions into apalache.
Also removes deprecated union types
There is no reason to enforce this bit of surface syntactic trivia on the AST level, and it imposes needless overhead in the quint conversion. We enforce this in parser for the Apalache type annotations, and that should suffice.
This gives us much more context when error conversion goes wrong due to an operator we expect to be defined missing an entry in the lookup table.
Used as the unit type in quint, and causes no problems when used in this way.
This reverts commit fc88f06. We need to wait on updating this fixture until we have informalsystems/quint#1278 in place, so we can generate the correct, flattened fixtures.
fb09e36
to
8fe7379
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the many super helpful comments ✨
Co-authored-by: Gabriela Moreira <gabrielamoreiramafra@gmail.com>
This is a followup to #2783, which omitted support for the "wildcard", default match case in match expressions.
Closes informalsystems/quint#1034
(thanks to informalsystems/quint#1276).
This adds support for conversion of the following quint constructs:
variant
operatormatchVariant
operatorA notable change made to support this work was relaxing the rules of the builder library to allow constructing empty records and record types. This is a meaningful value and a well formed type, and is the current choice for the unit type in quint, used for variants that don't take a value with any information (e.g., the
A
intype T = A | B(int)
).This takes us ~75% of the way to full support for quint sum types, and enables
running
verify
onhttps://github.com/informalsystems/quint/blob/main/examples/language-features/option.qnt
What remains to do:
declarations. See Support user-defined polymorphic type constructors informalsystems/quint#1073
I expect reviewing by commit is helpful, as they are logically isolated.
Thanks due to @bugarela, who found this problem and was a huge help in debugging.
make fmt-fix
(or had formatting run automatically on all files edited)./unreleased/
for any new functionality