A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Temporal Logic: LTL and CTL

Research Depth 94 in the knowledge graph I know this Set as goal
6topics build on this
431prerequisites beneath it
See this on the map →
Introduction to Propositional LogicModel Checking+1 moreBDD-Based VerificationBounded Model Checking+4 more
linear-temporal-logic computation-tree-logic ltl ctl liveness safety

Core Idea

Temporal logics extend propositional logic with operators that express properties over time, enabling specification of system behaviors like "every request is eventually granted" (liveness) or "the system never enters an error state" (safety). Linear Temporal Logic (LTL) reasons about individual execution paths using operators like G (globally/always), F (finally/eventually), X (next), and U (until). Computation Tree Logic (CTL) reasons about the branching tree of all possible futures, combining path quantifiers (A = all paths, E = some path) with temporal operators. LTL and CTL have incomparable expressive power: each can express properties the other cannot.

Explainer

Temporal logic provides the specification language for model checking. While propositional logic can describe what is true at a single moment, temporal logic adds operators that talk about the evolution of truth over time — what was true, what will become true, what remains true forever. Two families dominate formal methods: Linear Temporal Logic (LTL) and Computation Tree Logic (CTL).

LTL views time as a single infinite sequence of states — one execution path. Its temporal operators modify propositions relative to positions along this path. G p (globally p) means p holds at every future position. F p (finally p) means p holds at some future position. X p (next p) means p holds at the immediately next position. p U q (p until q) means p holds continuously until q becomes true (and q must eventually become true). Complex properties compose these: G(request -> F grant) says "always, a request is followed by an eventual grant." LTL formulas are implicitly universally quantified over all execution paths — the property must hold on every possible run of the system.

CTL views time as a branching tree: at each state, the system may transition to multiple possible successor states (representing nondeterminism or concurrency). CTL combines path quantifiers (A = "for all paths from this state," E = "there exists a path from this state") with state-level temporal operators (G, F, X, U). These always appear in pairs: AG p, EF p, AX p, EU(p,q), etc. The formula AG(not deadlock) means "on all paths, globally, no deadlock occurs." The formula AG(EF restart) means "from every reachable state, on all paths, there exists a path reaching a restart state" — the system can always potentially recover.

The two logics are incomparable in expressiveness. LTL can express fairness properties like F(G p) ("eventually p holds forever") that CTL cannot. CTL can express branching properties like AG(EF p) ("p is always reachable") that LTL cannot. The unifying logic CTL* subsumes both, allowing arbitrary nesting of path quantifiers and temporal operators, but its model checking algorithms are more expensive. In practice, the choice between LTL and CTL depends on the property: use LTL for path-centric properties (fairness, response patterns) and CTL for branching properties (reachability, recoverability).

The distinction between safety and liveness properties cuts across both logics. Safety properties (G not bad) say "nothing bad ever happens" — they are violated by finite prefixes. Liveness properties (G(request -> F response)) say "something good eventually happens" — they can only be violated by infinite traces where the good thing never occurs. This distinction profoundly affects model checking algorithms: safety violations produce finite counterexample traces, while liveness violations produce "lasso" counterexamples (a finite stem followed by an infinitely repeating cycle). Understanding which temporal operators express safety vs. liveness is essential for writing effective specifications.

Practice Questions 4 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsLogic Gates FundamentalsImplementing Boolean Functions with GatesKarnaugh Map SimplificationCombinational Circuit DesignFlip-Flops and LatchesFinite State Machines (FSMs)Deterministic Finite Automata (DFA)Nondeterministic Finite Automata (NFA)Two-Way Finite AutomataNFA to DFA Conversion (Subset Construction)DFA Properties and Minimization AlgorithmsRegular Languages: Definition and CharacterizationContext-Free Grammars (CFGs)Pushdown Automata (PDA)Equivalence of CFGs and Pushdown AutomataClosure Properties of Context-Free LanguagesLimitations of Context-Free LanguagesPumping Lemma for Context-Free LanguagesTuring MachinesModel CheckingKripke StructuresTemporal Logic: LTL and CTL

Longest path: 95 steps · 431 total prerequisite topics

Prerequisites (3)

Leads To (6)