Skip to main content
QUICK REVIEW

[Paper Review] Auxiliary Variables in TLA+

Leslie Lamport, Stephan Merz|arXiv (Cornell University)|Mar 15, 2017
Cryptographic Implementations and SecurityComputer Science4 references12 citations
TL;DR

This paper presents formal rules for safely adding three types of auxiliary variables—history, prophecy, and stuttering variables—to TLA+ specifications without altering their semantics. It demonstrates their use in verifying a simplified snapshot algorithm, showing that such variables enable correct refinement mappings by capturing past, future, or idle system behavior, and proves correctness via model checking with TLC.

ABSTRACT

Auxiliary variables are often needed for verifying that an implementation is correct with respect to a higher-level specification. They augment the formal description of the implementation without changing its semantics--that is, the set of behaviors that it describes. This paper explains rules for adding history, prophecy, and stuttering variables to TLA+ specifications, ensuring that the augmented specification is equivalent to the original one. The rules are explained with toy examples, and they are used to verify the correctness of a simplified version of a snapshot algorithm due to Afek et al.

Motivation & Objective

  • To provide practical, formal rules for adding auxiliary variables to TLA+ specifications to support refinement without changing system semantics.
  • To address the challenge of verifying complex concurrent systems by enabling the use of auxiliary variables that track past behavior (history), predict future behavior (prophecy), or model idle steps (stuttering).
  • To demonstrate the utility of these rules through a formal verification of a simplified snapshot algorithm due to Afek et al.
  • To show that these auxiliary variables can be used effectively in practice, overcoming limitations of earlier prophecy variable approaches.

Proposed method

  • Introduces history variables to record past system states, using disjunctive representations to maintain equivalence between original and augmented specifications.
  • Proposes one-prediction and array-based prophecy variables to predict future system behavior, ensuring correctness via definitional constraints and liveness preservation.
  • Defines stuttering variables to model steps that do not change actual variables, enabling refinement mappings that preserve liveness and safety.
  • Applies refinement mappings to relate high-level specifications to low-level implementations, using variable substitutions to map augmented variables to original ones.
  • Employs the TLC model checker to verify correctness of the refinement mappings, including complex cases with symmetry and state constraints.
  • Uses a structured specification approach with modules, invariants, and fairness conditions to ensure safety and liveness in the augmented specifications.

Experimental results

Research questions

  • RQ1How can history variables be added to a TLA+ specification in a way that preserves semantic equivalence with the original specification?
  • RQ2What formal rules ensure that prophecy variables correctly predict future system behavior without altering semantics?
  • RQ3How can stuttering variables be introduced to model idle steps while maintaining safety and liveness properties?
  • RQ4Can these auxiliary variables be used effectively to verify a linearizable snapshot algorithm in practice?
  • RQ5What is the role of refinement mappings in connecting high-level specifications with low-level implementations using auxiliary variables?

Key findings

  • The paper successfully verifies a simplified snapshot algorithm using history, prophecy, and stuttering variables, demonstrating that such auxiliary variables preserve semantic equivalence.
  • The use of one-prediction and array-based prophecy variables enables practical and correct specification of future behavior predictions in TLA+.
  • Stuttering variables were found to be more effective than using prophecy variables for modeling idle steps, improving clarity and maintainability.
  • The refinement mapping from the Afek et al. snapshot algorithm to the linearizable specification was formally verified using TLC, taking approximately 10 hours on a 2012 laptop.
  • The model checker successfully verified the specification under symmetry constraints, with two readers, two writers, and two register values, confirming correctness.
  • The authors conclude that their new prophecy variable approach is significantly easier to use in practice than earlier formulations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.