You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module Foo models a system where -at every step- the log is extended by a subsequence of up to length C from the set S. It is straightforward to see that the module Bar refines Foo. However, TLC fails to verify the refinement because it cannot enumerate the set of all subsequences SeqOf(S, 42).
----- MODULEFoo ------
EXTENDSNaturals,Sequences,SequencesExtCONSTANTS,CVARIABLElogInit==log=<<>>Next==\Esuffix\inSeqOf(S,C):log'=log\osuffixNextRefine==/\log'\inSeq(S)/\IsPrefix(log,log')/\Len(log')<=Len(log)+CSpec==Init/\[][Next]_log
=====
----- MODULEBar -----
EXTENDSSequencesVARIABLElogSpec==log=<<>>/\[][log'=log\o<<"a">>]_logFoo==INSTANCEFooWITHC<-42,S<-{"a"}THEOREMSpec=>Foo!Spec\* .cfg files do not accept the ! in Foo!NextRefineFooNextRefine==Foo!NextRefine
=====
Clearly, when verifying refinement, it's conceptually unnecessary for TLC to enumerate SeqOf(S, 42). Instead, it would be sufficient to check something like NextRefine, which TLC will check if we redefine Next with NextRefine:
CONSTANT Next <- [Foo]FooNextRefine
However, SeqOf could be enhanced to symbolically check ... \in SeqOf(S, C), similar to how TLC checks Seq(S):
Additionally, this new tlc2.value.impl.Value implementation should properly implement tlc2.value.impl.Enumerable#elements to lazily enumerate the elements of SeqOf when evaluating the existential quantification\E s \in SeqOf(S,C): log' = ....
The text was updated successfully, but these errors were encountered:
Adding the following to SequencesExt.java causes TLC to treat BoundedSeq/SeqOf strictly symbolically. However, there is no infrastructure for a hybrid value. We would have to implement a BoundedSeqValue that extends TLC's Value class.
The module
Foo
models a system where -at every step- the log is extended by a subsequence of up to lengthC
from the setS
. It is straightforward to see that the moduleBar
refinesFoo
. However, TLC fails to verify the refinement because it cannot enumerate the set of all subsequencesSeqOf(S, 42)
.Clearly, when verifying refinement, it's conceptually unnecessary for TLC to enumerate
SeqOf(S, 42)
. Instead, it would be sufficient to check something likeNextRefine
, which TLC will check if we redefineNext
withNextRefine
:However,
SeqOf
could be enhanced to symbolically check... \in SeqOf(S, C)
, similar to how TLC checksSeq(S)
:https://github.com/tlaplus/tlaplus/blob/475477653f01447f60603288a2785df1447bdbeb/tlatools/org.lamport.tlatools/src/tlc2/module/Sequences.java#L391-L411
Additionally, this new
tlc2.value.impl.Value
implementation should properly implementtlc2.value.impl.Enumerable#elements
to lazily enumerate the elements ofSeqOf
when evaluating the existential quantification\E s \in SeqOf(S,C): log' = ...
.The text was updated successfully, but these errors were encountered: