Cohesive Systems logoCOHESIVE SYSTEMS

Search Cohesive Systems

Ready

Search Cohesive Systems

Find product pages, building blocks, technical articles, and graph definitions.

Temporal Logic

Temporal logic is a family of logics for stating how propositions hold across behaviors, runs, traces, or branching transition structures. It adds modalities for time and succession without requiring every temporal claim to use wall-clock timestamps or metric durations.

A model first determines the behaviors under consideration: often sequences or paths of states related by admissible transitions. A temporal formula is then interpreted over positions, suffixes, or branches of those behaviors. The formula constrains the allowed behavior set; it does not by itself select a runtime, scheduler, clock, or enforcement mechanism.

Common Operators

In linear-time notation, common operators include:

  • X P\mathbf{X}\,P: PP holds at the next position.
  • F P\mathbf{F}\,P: PP eventually holds at the current or some future position.
  • G P\mathbf{G}\,P: PP always holds at every relevant future position.
  • P U QP\,\mathbf{U}\,Q: PP holds until QQ holds, with QQ eventually occurring.

Past-time, metric, interval, probabilistic, real-time, and epistemic extensions add other distinctions when the model requires them. “Eventually” ordinarily means at the current or some later position in every behavior covered by the formula. It does not establish a deadline or even a uniform finite bound unless the selected logic and model say so.

Linear Temporal Logic

Linear temporal logic (LTL) evaluates formulas along individual runs. A run of a state machine is an infinite sequence of states in which each step is an admissible transition:

σ=s0→s1→s2→⋯\sigma = s_0 \to s_1 \to s_2 \to \cdots

Write σi\sigma^{i} for the suffix of σ\sigma beginning at sis_i. A state predicate PP holds of a run when it holds of the run's first state, and LTL adds operators that look along the run:

σ⊨P  ⟺  P(s0)σ⊨X φ  ⟺  σ1⊨φσ⊨F φ  ⟺  σi⊨φ for some i≥0σ⊨G φ  ⟺  σi⊨φ for every i≥0σ⊨φ U ψ  ⟺  σj⊨ψ for some j≥0, and σi⊨φ for every i<j\begin{aligned} \sigma \models P &\iff P(s_0) \\ \sigma \models \mathbf{X}\,\varphi &\iff \sigma^{1} \models \varphi \\ \sigma \models \mathbf{F}\,\varphi &\iff \sigma^{i} \models \varphi \text{ for some } i \ge 0 \\ \sigma \models \mathbf{G}\,\varphi &\iff \sigma^{i} \models \varphi \text{ for every } i \ge 0 \\ \sigma \models \varphi \,\mathbf{U}\, \psi &\iff \sigma^{j} \models \psi \text{ for some } j \ge 0, \text{ and } \sigma^{i} \models \varphi \text{ for every } i < j \end{aligned}

F\mathbf{F} reads eventually and G\mathbf{G} reads always. They are dual in the same way as ∃\exists and ∀\forall: eventually is a disjunction over future positions and always is a conjunction, so negation exchanges them.

G φ≡¬ F ¬φF φ≡¬ G ¬φ\mathbf{G}\,\varphi \equiv \lnot\,\mathbf{F}\,\lnot\varphi \qquad \mathbf{F}\,\varphi \equiv \lnot\,\mathbf{G}\,\lnot\varphi

Nesting them describes the long-run behavior of a run:

FormulaReadingExample
G P\mathbf{G}\,PPP always holdsan invariant, such as no account balance below zero
F P\mathbf{F}\,PPP eventually holdsa workflow eventually completes
G(P→F Q)\mathbf{G}(P \rightarrow \mathbf{F}\,Q)every PP is eventually followed by QQevery request eventually receives a response
G F P\mathbf{G}\,\mathbf{F}\,PPP holds infinitely oftena replica is synchronized again and again
F G P\mathbf{F}\,\mathbf{G}\,PPP eventually holds foreverreplicas eventually converge and stay converged

The last two are dual: ¬ G F P≡F G ¬P\lnot\,\mathbf{G}\,\mathbf{F}\,P \equiv \mathbf{F}\,\mathbf{G}\,\lnot P. Fairness is stated with them.

A machine satisfies a formula when every run satisfies it. Safety and liveness classify properties by the shape of their violations: G P\mathbf{G}\,P is violated by a finite prefix that reaches a state outside PP, while F P\mathbf{F}\,P can be violated only by an infinite run that never reaches PP.

Linear and Branching Views

Linear temporal logic evaluates formulas along individual linear paths. Branching-time logics distinguish alternative futures from a state and add path quantification, such as “on every path” or “on some path.” CTL constrains how path quantifiers and temporal operators combine, while CTL* permits more general nesting.

The choice is semantic. A linear trace may be appropriate after scheduling or arbitration selects one execution. A branching structure preserves the alternatives that were possible before that choice. Neither view should silently erase nondeterminism, concurrency, or observer-relative information that matters to the claim.

Runs and formulas form another element-predicate table: does run σ\sigma satisfy formula φ\varphi? LTL is a linear-time logic, so machines with the same set of runs satisfy the same LTL formulas. In particular LTL cannot distinguish a(b+c)a(b + c) from ab+acab + ac, the branching distinction that cancellation makes visible. Branching-time logics, which quantify over the alternative futures of a state, can. For finitely branching transition systems, the Hennessy-Milner theorem makes the correspondence exact: two states satisfy the same formulas of Hennessy-Milner modal logic exactly when they are bisimilar. Modal formulas are the predicates of the coalgebraic view, and bisimulation is the identification of states that no such predicate separates.

State, Actions, and Behaviors

State predicates describe one state. Action predicates relate a current state to a possible next state. Temporal formulas constrain complete behaviors built from those steps. This separation is central to the Temporal Logic of Actions used by TLA+: an initial-state predicate and a next-state action describe possible behaviors, while temporal formulas state invariance, progress, and fairness conditions over them.

Stuttering steps, in which the modeled variables do not change, matter when one specification step may correspond to zero or more steps at another abstraction level. A stuttering-invariant specification can hide internal steps or refine an abstract action into several concrete actions without changing the visible temporal meaning. Specifications using a distinguished next operator need extra care because that operator can make individual step counts observable.

Safety, Liveness, and Fairness

Safety and liveness give two central temporal property classes:

  • A safety violation has a finite bad prefix: something forbidden has already happened.
  • A liveness property requires that desired progress eventually occurs and cannot generally be refuted by one finite prefix.

An invariant is a common safety property, often written G I\mathbf{G}\,I for a state predicate II. Not every safety property is a state invariant; some constrain transitions or finite history patterns.

Fairness excludes executions that indefinitely postpone eligible actions. Weak fairness requires progress for an action that remains continuously enabled, F G enabledA→G F takenA\mathbf{F}\,\mathbf{G}\,\mathit{enabled}_A \rightarrow \mathbf{G}\,\mathbf{F}\,\mathit{taken}_A; strong fairness addresses an action enabled infinitely often, G F enabledA→G F takenA\mathbf{G}\,\mathbf{F}\,\mathit{enabled}_A \rightarrow \mathbf{G}\,\mathbf{F}\,\mathit{taken}_A. Fairness is an assumption or constraint on the admitted behaviors, not a proof that the production scheduler supplies it.

Cohesive Use

Temporal logic can qualify state machines, process descriptions, interaction protocols, and distributed algorithms with explicit behavioral claims. It is especially useful for separating:

  • Domain invariants from temporal progress requirements.
  • Possible behavior from selected execution.
  • Logical succession from wall-clock time.
  • Safety that must hold on every admitted execution from liveness that depends on timing, failure, scheduling, or fairness assumptions.
  • A verified specification from the implementation correspondence needed to transfer the result to a running system.

Model checking can explore a finite or finitely represented behavior space for violations. Deductive proof can establish claims symbolically from definitions and assumptions. Testing samples executions. Runtime monitoring observes a live trace. These are distinct realization and evidence mechanisms with different completeness boundaries.

Formal relations

  • refines: Logic — Adds modalities interpreted over behaviors, paths, or branching transition structures while retaining the distinction among syntax, models, satisfaction, and proof.
  • constrains: State Machines — States safety, liveness, fairness, and other behavioral conditions over machine runs without selecting the mechanism that executes the transitions.

External References