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.
Run a state transition function σ → Option σ "to completion". The return value is the last
state returned before a none result. If the state transition function always returns some,
then the computation diverges, returning Part.none.
Instances For
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.
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.
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.
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.
Instances For
A simpler version of Respects when the state transition relation tr is a function.
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.
- steps : ℕ
- evals_in_steps : (flip bind f)^[self.steps] (some a) = b
Instances For
Reflexivity of EvalsTo in 0 steps.
Instances For
Reflexivity of EvalsToInTime in 0 steps.
Instances For
Transitivity of EvalsToInTime in the sum of the numbers of steps.