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 multi-step 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 multi-step 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 #
Multi-step transitions #
Definition of a multi-step 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
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
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 multi-step) #
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 #
A divergent execution is a stream of states where each state is the anti-τ-derivative of the next.
Equations
- lts.DivergentExecution stream = ∀ (n : ℕ), lts.Tr (stream n) Cslib.HasTau.τ (stream n.succ)
Instances For
If a stream is a divergent execution, then any 'suffix' is also a divergent execution.
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
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
Any homogeneous relation can be seen as an LTS where all transitions have the same label.
Equations
Instances For
Support for the calc tactic #
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 := ⋯ }
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.