ProductStateMachine: StateMachine-Specialized Layer over ProductKripke #
The canonical product of two behavioral models lives in
Behavior/ProductKripke.lean as ProductKripke x y, a marker type
parameterized over arbitrary [ToKripke α S₁ D₁] and
[ToKripke β S₂ D₂] instances.
This file layers a StateMachine-specialized API on top of
ProductKripke, providing:
productInv— the conjunction of twoStateMachineinvariants, directly referenced byReachableandPartDef.invariantinExamples.ProductStateMachine sm₁ sm₂— anabbrevforProductKripke sm₁ sm₂.ProductReachable sm₁ sm₂— anabbrevforProductKripkeReachable sm₁ sm₂.ProductStateMachine.initialState/.WellFormed/.wellFormed_iff/.nonEmpty— dot-notation helpers that only make sense underStateMachineassumptions.
Because ProductStateMachine and ProductReachable are abbrevs,
instance resolution and defeq transparently forward to the
underlying ProductKripke definitions, and existing call sites in
Examples work without modification.
Product invariant: the conjunction of two invariants.
Declared as abbrev so that .1 / .2 projection and
refine ⟨_, _⟩ work transparently. The inv field of
ProductKripke sm₁ sm₂ is
fun p d => (sm₁.toKripke).inv p.1 d.1 ∧ (sm₂.toKripke).inv p.2 d.2,
which is defeq to productInv inv₁ inv₂.
Instances For
Product state machine, provided as an abbrev for
ProductKripke sm₁ sm₂.
Because it is an abbrev, type inference resolves
⟨⟩ : ProductStateMachine sm₁ sm₂ as ProductKripke sm₁ sm₂, so
existing patterns such as
epsMiniPSM : ProductStateMachine epsSM miniSM := ⟨⟩ work directly.
The ToKripke instance is supplied by instToKripkeProductKripke
and is picked up automatically, since abbrev is transparent to
instance resolution.
Equations
Instances For
Product reachability, provided as an abbrev for
ProductKripkeReachable sm₁ sm₂.
The constructors init / stepLeft / stepRight from
ProductKripkeReachable are usable directly via dot notation.
Equations
Instances For
Initial state of a product state machine: the pair of component initial states.
ProductKripke has no notion of an initial state in general; this
definition is specific to the StateMachine specialization.
Equations
- x✝.initialState = (sm₁.initialState, sm₂.initialState)
Instances For
WellFormed for a product state machine: both component state
machines are WellFormed.
The Kripke layer only provides the weaker NonEmpty condition;
this WellFormed variant is specific to the StateMachine
specialization. See §4 for conversion to the Kripke-level
NonEmpty.
Equations
- x✝.WellFormed = (sm₁.WellFormed ∧ sm₂.WellFormed)
Instances For
ProductStateMachine.WellFormed unfolds to the conjunction of the
component WellFormed properties.
If both sm₁ and sm₂ are WellFormed, the product Kripke
structure is NonEmpty.
Acts as a convenience bridge for call sites that hold
StateMachine.WellFormed proofs but need to feed the Kripke-level
NonEmpty into generic operators such as FDIRBundle.compose.
Internally, WellFormed.nonEmpty converts each side to
NonEmpty, and the result is assembled by
ProductKripke.nonEmpty.