-
-
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
Rewrite for set membership of the powerset of a record where the record has infinite co-domains. #2946
Conversation
e83db2f
to
2cd2ac4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
2cd2ac4
to
b032318
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.
Looks good to me. Thanks you for the contribution! Could you add a release note like this one, so your contribution would be visible in the next release.
b032318
to
c14d3a6
Compare
…rd has infinite co-domains. Simplified real-world scenario: ```tla EXTENDS Integers VARIABLE \* @type: Set({ p: (Int) }); v TypeOK == v \in SUBSET [ p: Int ] Init == v = { [p |-> 42] } Next == UNCHANGED v ``` Apalache Error: ```sh $ apalache-mc check --inv=TypeOK APARecSub.tla [...] Input error (see the manual): Found a set map over an infinite set of CellTFrom(Int). Not supported. ``` Rewrite: ```tla S \in SUBSET [a : T] ~~> \A r \in S: DOMAIN r = { "a" } /\ r.a \in T ``` Related commits, issues, PRs: * 625a164 * 785e269 * apalache-mc#723 * apalache-mc#1627 * apalache-mc#2762 * apalache-mc#1453 * apalache-mc#1629 Signed-off-by: Markus Alexander Kuppe <[email protected]>
c14d3a6
to
1538dd9
Compare
Done |
May I assume that you won't be releasing a new minor release with this change because of the move to the independent github org anytime soon? |
I have started a job on cutting 0.45.0. It should be fairly easy to do. |
The last step of the release did not work. I will have a look into it: #2951 |
Blast, I've found that it rewrites ------------------------- MODULE APARecSub ------------------------------
EXTENDS Integers
VARIABLE
\* @type: Set({ p: Int });
v
TypeOK ==
v \in SUBSET [ p: Int ]
Init ==
v = { [p |-> 42] }
Next ==
UNCHANGED v
========================================================================== ------------------------- MODULE APARecRecSub -------------------------
EXTENDS Integers
VARIABLE
\* @type: { p : Set ({ t : Int }) };
v
TypeOK ==
v \in [ p : SUBSET [t : Int] ]
Init ==
v = [ p |-> [t : Int] ]
Next ==
UNCHANGED v
========================================================================== Will investigate... |
The rewrite works correctly and Apalache successfully handles a finite domain as in heidihoward/pbft-tlaplus#5. I presume another rewrite is able to handle the simpler |
We have the release 0.45.1 cut, which includes your PR: https://github.com/apalache-mc/apalache/actions/runs/10452011929 |
Simplified real-world scenario:
Apalache Error:
Rewrite:
Related commits, issues, PRs:
625a164
785e269
[FEATURE] Use types to simplify
TypeOK
#723An optimization for membership in a record set #1627
A set filter over PowSet[FinSet[Int]] is not implemented #2762
Simplify records in TypeOK #1453
Optimize membership for record sets #1629
PR hygiene
make fmt-fix
(or had formatting run automatically on all files edited)