Documentation

Complexity.Foundations.Semantics.Stateful.Composition

Composing verified interface implementations #

Modules compose by substituting method bodies and composing representation relations. The intermediate state remains hidden, so callers need not depend on either representation. This construction shares the same semantics across all backend and resource interpretations.

Main definitions #

Main results #

theorem Cslib.Stateful.Module.simulates_client {D E : Spec} {α : Type w} (M : Module D E) (p : D.Client α) {s : D.State} {e : E.State} (hr : M.rep s e) (hv : D.ValidHistory s (D.runClient s p).2.2) :
E.ValidHistory e (E.runClient e (link M.methods p)).2.2 ∧ (E.runClient e (link M.methods p)).1 = (D.runClient s p).1 ∧ M.rep (D.runClient s p).2.1 (E.runClient e (link M.methods p)).2.1

Per-operation semantic simulations lift to the whole answer-dependent client.

Identity methods expose precisely one call and preserve the state representation.

Instances For
    def Cslib.Stateful.Module.comp {D E F : Spec} (M : Module D E) (N : Module E F) :
    Module D F

    Compose implementation proofs while hiding the intermediate representation.

    Instances For