mirror of
https://github.com/pingcap/tla-plus.git
synced 2024-12-26 12:30:10 +08:00
add pessimistic test2
Signed-off-by: andylokandy <andylokandy@hotmail.com>
This commit is contained in:
parent
862ad765b8
commit
c108f8d201
33
PessimisticTransaction/Test2.cfg
Normal file
33
PessimisticTransaction/Test2.cfg
Normal file
@ -0,0 +1,33 @@
|
||||
\* See Test2.tla.
|
||||
|
||||
CONSTANT
|
||||
KEY <- Key
|
||||
OPTIMISTIC_CLIENT <- OptimistiicClient
|
||||
PESSIMISTIC_CLIENT <- PessimisticClient
|
||||
CLIENT_KEY <- ClientKey
|
||||
CLIENT_PRIMARY <- ClientPrimary
|
||||
|
||||
INIT
|
||||
Init
|
||||
|
||||
NEXT
|
||||
Next
|
||||
|
||||
INVARIANT
|
||||
NextTsTypeOK
|
||||
ClientStateTypeOK
|
||||
ClientTsTypeOK
|
||||
ClientKeyTypeOK
|
||||
KeyDataTypeOK
|
||||
KeyLockTypeOK
|
||||
KeyWriteTypeOK
|
||||
KeyLastReadTsTypeOK
|
||||
MsgTypeOK
|
||||
|
||||
INVARIANT
|
||||
WriteConsistency
|
||||
LockConsistency
|
||||
CommittedTxnConsistency
|
||||
AbortedClientConsistency
|
||||
RollbackConsistency
|
||||
UniqueWrite
|
20
PessimisticTransaction/Test2.tla
Normal file
20
PessimisticTransaction/Test2.tla
Normal file
@ -0,0 +1,20 @@
|
||||
--------------------------------- MODULE Test2 ---------------------------------
|
||||
|
||||
EXTENDS PessimisticTransaction, TLC
|
||||
|
||||
\* Model value is not used to avoid unnecessary state space
|
||||
\* checked by TLC. Symmetry should not be used if we are supposed
|
||||
\* to check liveness.
|
||||
k1 == 1
|
||||
k2 == 2
|
||||
c1 == 1
|
||||
c2 == 2
|
||||
c3 == 3
|
||||
|
||||
Key == {k1, k2}
|
||||
OptimistiicClient == {c2, c3}
|
||||
PessimisticClient == {c1}
|
||||
ClientKey == c1 :> {k1, k2} @@ c2 :> {k1} @@ c3 :> {k2}
|
||||
ClientPrimary == c1 :> k1 @@ c2 :> k1 @@ c3 :> k2
|
||||
|
||||
================================================================================
|
Loading…
Reference in New Issue
Block a user