Documentation

Cslib.Foundations.Semantics.LTS.Execution

Finite executions of LTS #

A finite execution of lts : LTS State Label, a proposition lts.Execution s μs t ss, which says that lts can transition from s to t through ss using the transition labels μ. That is, the lists have the form μs = [μ₀, μ₁, ..., μₙ] and ss = [s, s₁, s₂, ..., sₙ, t], and there are transitions lts.Tr s μ₀ s₁, lts.Tr s₁ μ₁ s₂, ..., lts.Tr sₙ μₙ t.

We define Cslib.LTS.Execution as an inductive proposition, which is equivalent to the definition in terms of indicies: see Cslib.LTS.Execution.mk and Cslib.LTS.execution_iff_index.

inductive Cslib.LTS.Execution {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) (s : State) (μs : List Label) (t : State) (ss : List State) :

Execution extends MTr by providing the intermediate states of a multistep transition: lts.Execution s₁ μs s₂ ss means that lts can transition from s₁ to s₂ through ss using the transition labels μ. This is equivalent to the proposition:

∃ _ : ss.length = μs.length + 1, ss[0] = s₁ ∧ ss[ss.length - 1] = s₂ ∧
  ∀ k < μs.length, lts.Tr ss[k] μ[k] ss[k + 1].

Access that formulation as a constructor using Cslib.LTS.Execution.mk, and its projections as Cslib.LTS.Execution.length, Cslib.LTS.Execution.start, Cslib.LTS.Execution.last and Cslib.LTS.Execution.trans.

  • refl {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} (s : State) : lts.Execution s [] s [s]

    Every state has an execution of zero steps terminating in itself.

  • stepL {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {r s t : State} {μ : Label} {μs : List Label} {ss : List State} (htr : lts.Tr r μ s) (hex : lts.Execution s μs t ss) : lts.Execution r (μ :: μs) t (r :: ss)

    Equivalent of MTr.stepL for executions.

Instances For
    theorem Cslib.LTS.execution_iff {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) (s : State) (μs : List Label) (t : State) (ss : List State) :
    lts.Execution s μs t ss ↔ μs = [] ∧ t = s ∧ ss = [s] ∨ ∃ (s_1 : State) (μ : Label) (μs_1 : List Label) (ss_1 : List State), lts.Tr s μ s_1 ∧ lts.Execution s_1 μs_1 t ss_1 ∧ μs = μ :: μs_1 ∧ ss = s :: ss_1
    theorem Cslib.LTS.Execution.of_tr {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μ : Label} {t : State} (h : lts.Tr s μ t) :
    lts.Execution s [μ] t [s, t]
    theorem Cslib.LTS.Execution.length {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss.length = μs.length + 1

    The lengths of μs and ss are constrained by the fact that each label μ ∈ μs represents a transition between two states in ss.

    theorem Cslib.LTS.Execution.length' {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    μs.length = ss.length - 1
    theorem Cslib.LTS.Execution.length_ss_pos {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    0 < ss.length

    Transitions have positive length.

    theorem Cslib.LTS.Execution.ss_ne_nil {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss ≠ []

    Every execution has at least one intermediate state.

    @[deprecated Cslib.LTS.Execution.ss_ne_nil (since := "2026-10-01")]
    theorem Cslib.LTS.Execution.nonEmpty_states {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss ≠ []

    Alias of Cslib.LTS.Execution.ss_ne_nil.


    Every execution has at least one intermediate state.

    theorem Cslib.LTS.Execution.head {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss.head ⋯ = s

    s is the first state of the execution.

    theorem Cslib.LTS.Execution.start {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss[0] = s

    Alternative accessor for Cslib.LTS.Execution.head.

    theorem Cslib.LTS.Execution.getLast {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss.getLast ⋯ = t

    t is the last state of the execution.

    theorem Cslib.LTS.Execution.last {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss[ss.length - 1] = t

    Alternative accessor for Cslib.LTS.Execution.getLast.

    theorem Cslib.LTS.Execution.last' {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) :
    ss[μs.length] = t

    Alternative accessor for Cslib.LTS.Execution.getLast.

    theorem Cslib.LTS.Execution.trans {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s μs t ss) (k : ℕ) (hk : k < μs.length) :
    lts.Tr ss[k] μs[k] ss[k + 1]

    lts transitions along the kth label in μs between the kth and (k + 1)th states in ss.

    theorem Cslib.LTS.Execution.mk {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s t : State} {μs : List Label} {ss : List State} (length : ss.length = μs.length + 1) (start : ss[0] = s) (last : ss[ss.length - 1] = t) (trans : ∀ (k : ℕ) (hk : k < μs.length), lts.Tr ss[k] μs[k] ss[k + 1]) :
    lts.Execution s μs t ss

    Alternative constructor for Cslib.LTS.Execution, in terms of the indexed collections of states and labels.

    theorem Cslib.LTS.execution_iff_index {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} :
    lts.Execution s μs t ss ↔ ∃ (x : ss.length = μs.length + 1), ss[0] = s ∧ ss[ss.length - 1] = t ∧ ∀ (k : ℕ) (x_1 : k < μs.length), lts.Tr ss[k] μs[k] ss[k + 1]

    The inductive definition of Cslib.LTS.Execution is equivalent to that in terms of indices.

    theorem Cslib.LTS.Execution.cons_invert {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μ : Label} {μs : List Label} {t : State} {ss : List State} (h : lts.Execution s (μ :: μs) t (s :: ss)) :
    lts.Execution ss[0] μs t ss

    Deconstruction of executions with List.cons.

    theorem Cslib.LTS.Execution.cons_cons_invert {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {r : State} {μ : Label} {μs : List Label} {t r' s : State} {ss : List State} (h : lts.Execution r (μ :: μs) t (r' :: s :: ss)) :
    lts.Execution s μs t (s :: ss)

    Deconstruct a positive-length execution, with a specific value for the second state in the sequence.

    theorem Cslib.LTS.Execution.tail_of_length_pos {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (he : lts.Execution s μs t ss) (hlen : 0 < μs.length) :
    lts.Execution ss[1] μs.tail t ss.tail

    Trim the first state from a positive-length execution.

    theorem Cslib.LTS.Execution.of_mTr {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} (h : lts.MTr s μs t) :
    ∃ (ss : List State), lts.Execution s μs t ss

    A multistep transition implies the existence of an execution.

    theorem Cslib.LTS.Execution.to_mTr {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (hex : lts.Execution s μs t ss) :
    lts.MTr s μs t

    Converts an execution into a multistep transition.

    theorem Cslib.LTS.Execution.isChainFromTo {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (hex : lts.Execution s μs t ss) :

    The states visited by an execution form a chain from the initial to the final state in the underlying unlabelled relation.

    theorem Cslib.LTS.Execution.isChain {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (hex : lts.Execution s μs t ss) :

    The states visited by an execution form a chain in the underlying unlabelled relation.

    theorem Cslib.LTS.mTr_iff_execution {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} :
    lts.MTr s μs t ↔ ∃ (ss : List State), lts.Execution s μs t ss

    Correspondence of multistep transitions and executions.

    theorem Cslib.LTS.Execution.comp {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s r t : State} {μs₁ μs₂ : List Label} {ss₁ ss₂ : List State} (h₁ : lts.Execution s μs₁ r ss₁) (h₂ : lts.Execution r μs₂ t ss₂) :
    lts.Execution s (μs₁ ++ μs₂) t (ss₁ ++ ss₂.tail)

    The composition of two executions is an execution.

    theorem Cslib.LTS.Execution.take {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (he : lts.Execution s μs t ss) (n : ℕ) (hn : n < ss.length) :
    lts.Execution s (List.take n μs) ss[n] (List.take (n + 1) ss)

    The states up to ss[n] form an execution.

    theorem Cslib.LTS.Execution.drop {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (he : lts.Execution s μs t ss) (n : ℕ) (hn : n < ss.length) :
    lts.Execution ss[n] (List.drop n μs) t (List.drop n ss)

    The states from ss[n] onward form an execution.

    theorem Cslib.LTS.Execution.split {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} {s : State} {μs : List Label} {t : State} {ss : List State} (he : lts.Execution s μs t ss) {n : ℕ} (hn : n < ss.length) :
    lts.Execution s (List.take n μs) ss[n] (List.take (n + 1) ss) ∧ lts.Execution ss[n] (List.drop n μs) t (List.drop n ss)

    Split an execution at an intermediate state ss[n].