-
-
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
[FEATURE] Use types to simplify TypeOK
#723
Comments
@konnov What's a good place to implement this? |
I would implement a separate transformation similar to |
Remove #723 as beginner task on the landing page, as it's (almost) fully implemented
We should revisit this based on #1629 |
Do we handle the case |
Simplification for records should be unblocked now, since #401 is closed. Shall we revisit this issue any time soon? |
Yes, we can do it after the switch, though nothing prevents us from implementing this transformation right now. |
Just labelled this one as unblocked. |
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
…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 <github.com@lemmster.de>
Blocked by #401 Precise type checking for records
We should use type information to simplify membership tests such as
x \in BOOLEAN
,x \in Int
,x \in STRING
,x \in Seq(...)
. By knowing the types, we could write a preprocessing pass that rewrites the above tests toTRUE
, if the types are matching the tests.n \in Nat
(Use type information to simplify membership tests #1406)i \in Int, b \in BOOLEAN, \r \in Real
(Use type information to simplify membership tests #1406)seq \in Seq(_)
(Use type information to simplify membership tests #1406)fun \in [Int -> Int]
(SimplifySUBSET
and sets of functions[S1 -> S2]
inTypeOK
#1443)<<{{1}}>> \in Seq(SUBSET Int)
or{<<1>>} \in SUBSET (Seq(Int))
(SimplifySUBSET
and sets of functions[S1 -> S2]
inTypeOK
#1443)tup \in S1 \X ... \X SN
(Simplify tuples in TypeOK #1445)The text was updated successfully, but these errors were encountered: