add pessimistic test2

Signed-off-by: andylokandy <andylokandy@hotmail.com>
This commit is contained in:
andylokandy 2020-03-31 00:59:51 +08:00
parent 862ad765b8
commit c108f8d201
2 changed files with 53 additions and 0 deletions

View 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

View 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
================================================================================