Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Repository files navigation

Welcome to TLA+ Examples Gitpod ready-to-code

The page TLA+ Examples is a library of TLA+ specifications for distributed algorithms. The webpage supplies the TLA+ community with:

  • A comprehensive library of the TLA+ specifications that are available today, in order to provide an overview of how to specify an algorithm in TLA+.
  • A comprehensive list of references and other interesting information for each problem.

Do you have your own case study that you like to share with the community? Send a pointer to us and we will include it in the repository. Your specifications will help the community in improving the tools for TLA+ analysis.

List of Examples

NoNameShort descriptionSpec's authorsTLAPS ProofTLC CheckUsed modulesPlusCal
12PCwithBTMA modified version of P2TCommit (Gray & Lamport, 2006)Murat DemirbasFinSet, Int, Seq
2802.16IEEE 802.16 WiMAX ProtocolsPrasad Narayana, Ruiming Chen, Yao Zhao, Yan Chen, Zhi (Judy) Fu, and Hai ZhouInt, Seq, FinSet
3aba-asyn-byzAsynchronous Byzantine agreement (Bracha & Toueg, 1985)Thanh Hai Tran, Igor Konnov, Josef WidderNat
4acp-nbNon-blocking atomic commitment with a reliable broadcast (Babaoğlu & Toueg, 1993)Stephan Merzdefault theories
5acp-nb-wrongWrong version of the non-blocking atomic commitment with a reliable broadcast (Babaoğlu & Toueg, 1993)Stephan Merzdefault theories
6acp-sbNon-blocking atomic commitment with a simple broadcast (Babaoğlu & Toueg, 1993)Stephan Merzdefault theories
7allocatorSpecification of a resource allocatorStephan MerzFinSet
8async-commThe diversity of asynchronous communication (Chevrou et al., 2016) Florent Chevrou, Aurélie Hurault, Philippe QuéinnecNat
9bcastByzAsynchronous reliable broadcast - Figure 7 (Srikanth & Toeug, 1987)Thanh Hai Tran, Igor Konnov, Josef WidderNat, FinSet
10bcastFolkloreFolklore reliable broadcast - Figure 4 (Chandra and Toueg, 1996)Thanh Hai Tran, Igor Konnov, Josef WidderNat
11boscoOne-Step Byzantine asynchronous consensus (Song & Renesse, 2008)Thanh Hai Tran, Igor Konnov, Josef WidderNat, FinSet
12BoulangerieA variant of the bakery algorithm (Yoram & Patkin, 2015)Leslie Lamport, Stephan MerzInt
13byihiveBased on RFC3506 - Requirements and Design for Voucher Trading System (Fujimura & Eastlake) Santhosh Rajudefault theories
14byzpaxosByzantizing Paxos by Refinement (Lamport, 2011)Leslie LamportInt, FinSet
15c1csConsensus in one communication step (Brasileiro et al., 2001)Thanh Hai Tran, Igor Konnov, Josef WidderInt, FinSet
16CaesarMulti-leader generalized consensus protocol (Arun et al., 2017)Giuliano LosaFinSet, Seq, Int
17CarTalkPuzzleA TLA+ specification of the solution to a nice puzzle.Int
18CASPaxosAn extension of the single-decree Paxos algorithm to a compare-and-swap type register (Rystsov)Tobias SchottdorfInt, FinSet
19cbc_maxCondition-based consensus (Mostefaoui et al., 2003)Thanh Hai Tran, Igor Konnov, Josef WidderInt, FinSet
20cf1s-folkloreOne-step consensus with zero-degradation (Dobre & Suri, 2006)Thanh Hai Tran, Igor Konnov, Josef WidderNat
21ChangRobertsLeader election in a ring (Chang & Roberts, 1979)Stephan MerzNat, Seq
22DataPortDataport protocal 505.89PT, only PDF files (Biggs & Noriaki, 2016)Geoffrey Biggs, Noriaki AndoInt, Seq
23detector_chan96Chandra and Toueg’s eventually perfect failure detectorThanh Hai Tran, Igor Konnov, Josef WidderInt, FinSet
24DieHardA very elementary example based on a puzzle from a movieNat
25dijkstra-mutexMutual exclusion algorithm (Dijkstra, 1965)Int
26diskpaxosDisk Paxos (Gafni & Lamport, 2003)Leslie Lamport, Giuliano LosaInt
27egalitarian-paxosLeaderless replication protocol based on Paxos (Moraru et al., 2013)Iulian MoraruNat, FinSet
28ewd840Termination detection in a ring (Dijkstra et al., 1986)Stephan MerzNat
70ewd998Shmuel safra's version of termination detectionStephan Merz, Markus KuppeInt, FinSet
29fastpaxosAn extension of the classic Paxos algorithm, only PDF files (Lamport, 2006)Leslie LamportNat, FinSet
30fpaxosA variant of Paxos with flexible quorums (Howard et al., 2017)Heidi HowardInt
31HLCHybrid logical clocks and hybrid vector clocks (Demirbas et al., 2014)Murat DemirbasInt
32L1Data center network L1 switch protocol, only PDF files (Thacker)Tom RodehefferFinSet, Nat, Seq
33lamport_mutexMutual exclusion (Lamport, 1978)Stephan MerzNat, Seq
34leaderlessLeaderless generalized-consensus algorithms (Losa, 2016)Giuliano LosaFinSet, Int, Seq
35losa_apThe assignment problem, a variant of the allocation problem (Delporte-Gallet, 2018)Giuliano LosaFinSet, Nat, Seq
36losa_rdaApplying peculative linearizability to fault-tolerant message-passing algorithms and shared-memory consensus, only PDF files (Losa, 2014)Giuliano LosaFinSet, Nat, Seq
37m2paxosMulti-leader consensus protocols (Peluso et al., 2016)Giuliano LosaInt, Seq, FinSet
38mongo-repl-tlaA simplified part of Raft in MongoDB (Ongaro, 2014)Siyuan ZhouFinSet, Nat, Seq
39MultiPaxosThe abstract specification of Generalized Paxos (Lamport, 2004)Giuliano LosaInt, FinSet
40N-QueensThe N queens problemStephan MerzNat, Seq
41naiadNaiad clock protocol, only PDF files (Murray et al., 2013)Tom RodehefferInt, Seq, FinSet
42nbacc_ray97Asynchronous non-blocking atomic commit (Raynal, 1997)Thanh Hai Tran, Igor Konnov, Josef WidderNat, FinSet
43nbacg_guer01On the hardness of failure-sensitive agreement problems (Guerraoui, 2001)Thanh Hai Tran, Igor Konnov, Josef WidderNat, FinSet
44nfc04Non-functional properties of component-based software systems (Zschaler, 2010)Steffen ZschalerReal, Nat
45PaxosPaxos consensus algorithm (Lamport, 1998)Leslie LamportInt, FinSet
46PrisonersA puzzle that was presented on an American radio program.Nat, FinSet
47raftRaft consensus algorithm (Ongaro, 2014)Diego OngaroFinSet, Nat, Seq
48SnapshotIsolationSerializable snapshot isolation (Cahill et al., 2010)Michael J. Cahill, Uwe Röhm, Alan D. FeketeFinSet, Int, Seq
49spanningSpanning tree broadcast algorithm in Attiya and Welch’s bookThanh Hai Tran, Igor Konnov, Josef WidderInt
50SpecifyingSystemsExamples to accompany the book Specifying Systems (Lamport, 2002)all modules
51StonesThe same problem as CarTalkPuzzleFinSet, Int, Seq
52sums_evenTwo proofs for showing that x+x is even, for any natural number x.Int
53SyncConsensusSynchronized round consensus algorithm (Demirbas)Murat DemirbasFinSet, Int, Seq
54TerminationChannel counting algorithm (Mattern, 1987)Giuliano LosaFinSet, Bags, Nat
55Tla-tortoise-hareRobert Floyd's cycle detection algorithmLorin HochsteinNat
56tower_of_hanoiThe well-known Towers of Hanoi puzzle.Markus Kuppe, Alexander NiederbühlBit, FinSet, Int, Nat, Seq
57transaction_commitConsensus on transaction commit (Gray & Lamport, 2006)Leslie LamportInt
58TransitiveClosureThe transitive closure of a relationFinSet, Int, Seq
59TwoPhaseTwo-phase handshakingLeslie Lamport, Stephan MerzNat
60VoldemortKVVoldemort distributed key value storeMurat DemirbasFinSet, Int, Seq
61Missionaries and CannibalsMissionaries and CannibalsLeslie LamportFinSet, Int
62Misra Reachability AlgorithmMisra Reachability AlgorithmLeslie LamportInt, Seq, FiniteSets, TLC, TLAPS, NaturalsInduction
63Loop InvarianceLoop InvarianceLeslie LamportInt, Seq, FiniteSets, TLC, TLAPS, SequenceTheorems, NaturalsInduction
64Teaching ConcurrencyTeaching ConcurrencyLeslie LamportInt, TLAPS
65Spanning TreeSpanning TreeLeslie LamportInt, FiniteSets, TLC, Randomization
66Paxos (How to win a Turing Award)PaxosLeslie LamportNat, Int, FiniteSets
67Tencent-PaxosPaxosStore: high-availability storage made practical in WeChat. Proceedings of the VLDB Endowment(Zheng et al., 2017)Xingchen Yi, Hengfeng WeiInt, FiniteSets
68Blocking QueueBlockingQueueMarkus Kuppe(LiveEnv)Naturals, Sequences, FiniteSets
69PaxosPaxosInt, FiniteSets
71Echo AlgorithmEcho AlgorithmStephan MerzNaturals, FiniteSets, Relation, TLC
72Cigarette Smokers problemCigarette Smokers problemMariusz RyndzionekIntegers, FiniteSets
73Conway's Game of LifeConway's Game of LifeMariusz RyndzionekIntegers
74Sliding puzzlesSliding puzzlesMariusz RyndzionekIntegers
75Lock-Free SetPlusCal spec of a lock-Free set used by TLCMarkus KuppeSequences, FiniteSets, Integers, TLC
76ChameneosChameneos, a Concurrency GameMariusz RyndzionekIntegers
77ParallelRaftA variant of RaftXiaosong Gu, Hengfeng Wei, Yu HuangIntegers, FiniteSets, Sequences, Naturals
78TLC MCPlusCal spec of safety checking as implemented in TLCMarkus KuppeIntegers, FiniteSets, Sequences, TLC
79TLA+ Level CheckingLevel-checking of TLA+ formulas as described in Specifying SystemsLeslie LamportIntegers, Sequences
80CRDT-BugCRDT algorithm with defect and fixed versionAlexander NiederbühlFiniteSets, Naturals, Sequences
81asyncio-lockBugs from old versions of Python's asyncio lockAlexander NiederbühlSequences
82Single Lane Bridge problemSingle Lane BridgeYounes AkhouayriNaturals, FiniteSets, Sequences
83Raft (with cluster changes)Raft with cluster changes, and a version with Apalache type annotations but no cluster changesGeorge Pîrlea, Darius Foom, Brandon Amos, Huanchen Zhang, Daniel RickettsFunctions, SequencesExt, FiniteSetsExt, TypedBags
84EWD687aDetecting termination in distributed computations by Edsger Dijkstra and Carel ScholtenStephan Merz (PlusCal spec), Leslie Lamport & Markus Kuppe (TLA+ spec)Integers, Graphs
85HuangTermination detection by using distributed snapshots by Shing-Tsaan HuangMarkus KuppeDyadicRationals
86Azure Cosmos DBConsistency models provided by Azure Cosmos DBDharma Shukla, Ailidani Ailijiang, Murat Demirbas, Markus KuppeIntegers, Sequences, FiniteSets, Functions, SequencesExt
87MET for CRDT-RedisModel-check the CRDT designs, then generate test cases to test CRDT implementationsYuqi ZhangIntegers, Sequences, FiniteSets, TLC
88Parallel incrementParallel threads incrementing a shared variable. Demonstrates invariants, liveness, fairness and symmetryChris JensenIntegers, FiniteSets, TLC

License

The repository is under the MIT license. However, we can upload your benchmarks under your license.

Support or Contact

Do you have any questions or comments? Please open an issue or send an email to the TLA+ group.

About

A collection of TLA+ specifications of varying complexities

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages