State Transition Systems #
This file contains simple definitions and lemmas for reasoning about state transition systems
defined by a function σ → Option σ, where σ is the type of states.
The reflexive transitive closure of a state transition function. Reaches f a b means
there is a finite sequence of steps f a = some a₁, f a₁ = some a₂, ... such that aₙ = b.
This relation permits zero steps of the state transition function.
Equations
- StateTransition.Reaches f = Relation.ReflTransGen fun (a b : σ) => b ∈ f a
Instances For
The transitive closure of a state transition function. Reaches₁ f a b means there is a
nonempty finite sequence of steps f a = some a₁, f a₁ = some a₂, ... such that aₙ = b.
This relation does not permit zero steps of the state transition function.
Equations
- StateTransition.Reaches₁ f = Relation.TransGen fun (a b : σ) => b ∈ f a
Instances For
A variation on Reaches. Reaches₀ f a b holds if whenever Reaches₁ f b c then
Reaches₁ f a c. This is a weaker property than Reaches and is useful for replacing states with
equivalent states without taking a step.
Equations
- StateTransition.Reaches₀ f a b = ∀ (c : σ), StateTransition.Reaches₁ f b c → StateTransition.Reaches₁ f a c
Instances For
(co-)Induction principle for eval. If a property C holds of any point a evaluating to b
which is either terminal (meaning a = b) or where the next point also satisfies C, then it
holds of any point where eval f a evaluates to b. This formalizes the notion that if
eval f a evaluates to b then it reaches terminal state b in finitely many steps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a relation tr : σ₁ → σ₂ → Prop between state spaces, and state transition functions
f₁ : σ₁ → Option σ₁ and f₂ : σ₂ → Option σ₂, Respects f₁ f₂ tr means that if tr a₁ a₂ holds
initially and f₁ takes a step to a₂ then f₂ will take one or more steps before reaching a
state b₂ satisfying tr a₂ b₂, and if f₁ a₁ terminates then f₂ a₂ also terminates.
Such a relation tr is also known as a refinement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A simpler version of Respects when the state transition relation tr is a function.
Equations
- StateTransition.FRespects f₂ tr a₂ (some b₁) = StateTransition.Reaches₁ f₂ a₂ (tr b₁)
- StateTransition.FRespects f₂ tr a₂ none = (f₂ a₂ = none)
Instances For
A "proof" of the fact that f eventually reaches b when repeatedly evaluated on a,
remembering the number of steps it takes.
- steps : ℕ
number of steps taken
Instances For
A "proof" of the fact that f eventually reaches b in at most m steps when repeatedly
evaluated on a, remembering the number of steps it takes.
Instances For
Reflexivity of EvalsToInTime in 0 steps.
Equations
- StateTransition.EvalsToInTime.refl f a = { toEvalsTo := StateTransition.EvalsTo.refl f a, steps_le_m := StateTransition.EvalsToInTime.refl._proof_1 }
Instances For
Transitivity of EvalsToInTime in the sum of the numbers of steps.
Equations
- StateTransition.EvalsToInTime.trans f m₁ m₂ a b c h₁ h₂ = { toEvalsTo := StateTransition.EvalsTo.trans f a b c h₁.toEvalsTo h₂.toEvalsTo, steps_le_m := ⋯ }