Labelled Transition System (LTS) #
A Labelled Transition System (LTS) models the observable behaviour of the possible states of a
system. They are particularly popular in the fields of concurrency theory, logic, and programming
languages.
Main definitions #
LTSis a structure for labelled transition systems, consisting of a labelled transition relationTrbetween states. We follow the style and conventions in [San].LTS.MTrextends the transition relation of any LTS to a multistep transition relation, formalising the inference system and admissible rules for such relations in [Mon23].Definitions for all the common classes of LTSs: image-finite, finitely branching, finite-state, finite, and deterministic.
Main statements #
A series of results on
LTS.MTrthat allow for obtaining and composing multistep transitions in different ways.LTS.deterministic_imageFinite: every deterministic LTS is also image-finite.LTS.finiteState_imageFinite: every finite-state LTS is also image-finite.LTS.finiteState_finitelyBranching: every finite-state LTS is also finitely-branching, if the type of labels is finite.
References #
Returns the relation that relates all states s1 and s2 via a fixed transition label μ.
Equations
- Cslib.LTS.Tr.toRelation lts μ s1 s2 = lts.Tr s1 μ s2
Instances For
Any homogeneous relation can be seen as an LTS where all transitions have the same label.
Equations
Instances For
Multistep transitions and executions with finite traces #
This section treats executions with a finite number of steps.
Definition of a multistep transition.
(Implementation note: compared to [Mon23], we choose stepL instead of stepR as fundamental
rule. This makes working with lists of labels more convenient, because we follow the same
construction. It is also similar to what is done in the SimpleGraph library in mathlib.)
- refl {State : Type u} {Label : Type v} {lts : LTS State Label} {s : State} : lts.MTr s [] s
- stepL {State : Type u} {Label : Type v} {lts : LTS State Label} {s1 : State} {μ : Label} {s2 : State} {μs : List Label} {s3 : State} : lts.Tr s1 μ s2 → lts.MTr s2 μs s3 → lts.MTr s1 (μ :: μs) s3
Instances For
Every state has an execution of zero steps terminating in itself.
Equivalent of MTr.stepL for executions.
Deconstruction of executions with List.cons.
A multistep transition implies the existence of an execution.
Converts an execution into a multistep transition.
Correspondence of multistep transitions and executions.
The LTS generated by a state s is the LTS given by all the states reachable from s.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the relation that relates all states s1 and s2 via a fixed list of transition
labels μs.
Equations
- Cslib.LTS.MTr.toRelation lts μs s1 s2 = lts.MTr s1 μs s2
Instances For
Calc tactic support for MTr #
Transitions can be chained.
Equations
- Cslib.instTransToRelationToRelationConsNil lts = { trans := ⋯ }
Transitions can be chained with multi-step transitions.
Equations
- Cslib.instTransToRelationToRelationCons lts = { trans := ⋯ }
Multi-step transitions can be chained with transitions.
Equations
- Cslib.instTransToRelationToRelationHAppendListConsNil lts = { trans := ⋯ }
Multi-step transitions can be chained.
Equations
- Cslib.instTransToRelationHAppendList lts = { trans := ⋯ }
Infinite sequences of transitions #
This section treats infinite executions as ω-sequences of transitions.
Prepends an infinite execution with a transition.
Total LTS #
Choose an FLTS that is a "sub-LTS" of a total LTS.
Equations
- lts.chooseFLTS = { tr := fun (s : State) (μ : Label) => Classical.choose ⋯ }
Instances For
The FLTS chosen by LTS.chooseFLTS always provides legal transitions.
LTS.chooseωTr builds an infinite execution of a total LTS from any starting state and
over any infinite sequence of labels.
Equations
Instances For
If a LTS is total, then any finite execution can be extended to an infinite execution, provided that the label type is inbabited.
LTS.totalize constructs a total LTS from any given LTS by adding a sink state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The LTS constructed by LTS.totalize is indeed total.
In LTS.totalize, the transitions between non-sink states correspond exactly to
the transitions in the original LTS.
In LTS.totalize, the multistep transitions between non-sink states correspond exactly to
the multistep transitions in the original LTS.
Definitions about termination #
A state 'may terminate' if it can reach a terminated state. The definition of Terminated
is a parameter.
Equations
- lts.MayTerminate s = ∃ (s' : State), Terminated s' ∧ lts.CanReach s s'
Instances For
A state 'is stuck' if it is not terminated and cannot go forward. The definition of Terminated
is a parameter.
Instances For
Definitions for the unions of LTSs #
Note: there is a nontrivial balance between ergonomics and generality here. These definitions might change in the future.
The union of two LTSs that have common supertypes for states and labels.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Union of two LTSs with the same Label type. The result combines the original respective state
types State1 and State2 into (State1 ⊕ State2).
Equations
- lts1.unionSum lts2 = lts1.inl.unionSubtype lts2.inr
Instances For
Classes of LTSs #
An lts is deterministic if a state cannot reach different states with the same transition label.
Instances
The μs-image of a set of states S, where μs is a list of labels, is the union of all
μs-images of the states in S.
Equations
- lts.setImageMultistep S μs = ⋃ s ∈ S, lts.imageMultistep s μs
Instances For
Characterisation of setImageMultistep with MTr.
Characterisation of LTS.setImageMultistep as List.foldl on LTS.setImage.
Characterisation of membership in List.foldl lts.setImage with MTr.
In a deterministic LTS, if a state has a μ-derivative, then it can have no other
μ-derivative.
In a deterministic LTS, the image of any state-label combination is finite.
Every deterministic LTS is also image-finite.
Equations
- lts.deterministic_imageFinite = { }
Every finite-state LTS is also image-finite.
Equations
- lts.finiteState_imageFinite = { }
A state has an outgoing label μ if it has a μ-derivative.
Equations
- lts.HasOutLabel s μ = ∃ (s' : State), lts.Tr s μ s'
Instances For
The set of outgoing labels of a state.
Equations
- lts.outgoingLabels s = {μ : Label | lts.HasOutLabel s μ}
Instances For
An LTS is finitely branching if it is image-finite and all states have finite sets of outgoing labels.
Instances
Weak transitions (single- and multistep) #
A type of transition labels that includes a special 'internal' transition τ.
- τ : Label
The internal transition label, also known as τ.
Instances
Saturated transition relation.
- refl {Label : Type u_1} {State : Type u_2} [HasTau Label] {lts : LTS State Label} {s : State} : lts.STr s HasTau.τ s
- tr {Label : Type u_1} {State : Type u_2} [HasTau Label] {lts : LTS State Label} {s1 s2 : State} {μ : Label} {s3 s4 : State} : lts.STr s1 HasTau.τ s2 → lts.Tr s2 μ s3 → lts.STr s3 HasTau.τ s4 → lts.STr s1 μ s4
Instances For
As LTS.str, but counts the number of τ-transitions. This is convenient as induction
metric.
- refl {Label : Type u_1} {State : Type u_2} [HasTau Label] {lts : LTS State Label} {s : State} : lts.STrN 0 s HasTau.τ s
- tr {Label : Type u_1} {State : Type u_2} [HasTau Label] {lts : LTS State Label} {n : ℕ} {s1 s2 : State} {μ : Label} {s3 : State} {m : ℕ} {s4 : State} : lts.STrN n s1 HasTau.τ s2 → lts.Tr s2 μ s3 → lts.STrN m s3 HasTau.τ s4 → lts.STrN (n + m + 1) s1 μ s4
Instances For
Saturated transitions labelled by τ can be composed (weighted version).
Saturated transitions can be appended with τ-transitions (weighted version).
Saturated transitions can be composed (weighted version).
The τ-closure of a set of states S is the set of states reachable by any state in S
by performing only τ-transitions.
Equations
- lts.τClosure S = lts.saturate.setImage S Cslib.HasTau.τ
Instances For
Divergence #
An infinite trace is divergent if every label within it is τ.
Equations
- Cslib.LTS.DivergentTrace μs = ∀ (i : ℕ), μs i = Cslib.HasTau.τ
Instances For
A state is divergent if there is a divergent execution from it.
Equations
- lts.Divergent s = ∃ (ss : Cslib.ωSequence State) (μs : Cslib.ωSequence Label), lts.ωTr ss μs ∧ ss 0 = s ∧ Cslib.LTS.DivergentTrace μs
Instances For
If a trace is divergent, then any 'suffix' is also divergent.
A command to create an LTS from a labelled transition α → β → α → Prop, robust to use of
variable
Equations
- One or more equations did not get rendered due to their size.
Instances For
This command adds transition notations for an LTS. This should not usually be called directly,
but from the lts attribute.
As an example lts_transition_notation foo "β" will add the notations "[⬝]⭢β" and "[⬝]↠β"
Note that the string used will afterwards be registered as a notation. This means that if you have also used this as a constructor name, you will need quotes to access corresponding cases, e.g. «β» in the above example.
Equations
- One or more equations did not get rendered due to their size.
Instances For
This attribute calls the lts_transition_notation command for the annotated declaration.
Equations
- One or more equations did not get rendered due to their size.