Compositional semantic implementations #
A module implements one interface using operations of another. Linking uses the upstream
free-monad interpreter. Behavior proofs neither choose a computational model nor assign costs.
Module.realize composes representation relations and hides intermediate states existentially.
Linking uses the upstream interpreter's common universe for operation answers and client
results. Native execution itself permits an independent universe for client results.
Main definitions #
Methods: operation bodies over a lower interface.Module: demonic lower-call admissibility and angelic representation simulation for those bodies.Module.ofFn: constructor for deterministic upper and lower specifications.link: substitute lower method bodies into an adaptive client.
Main results #
Module.realize: implement a module with any implementation of its lower interface.link_exec,link_exec_decompose: exact correspondence of chunked and flattened executions.
References #
Interface methods are programs over another interface.
Instances For
Substitution reuses upstream free-monad interpretation.
Instances For
Purely semantic module correctness over relational specifications; neither an execution model nor a cost appears.
- methods : Methods D E
Bodies implementing the upper interface using lower-interface calls.
The relation between upper and lower mathematical states.
- valid {s : D.State} {e : E.State} (o : D.Op) : self.rep s e → D.valid s o → E.DemonicValid e (self.methods o)
Demonic admissibility of each method body from related states.
- correct {s : D.State} {e : E.State} (o : D.Op) {a : D.Result o} {e' : E.State} {tr : E.Transcript} : self.rep s e → D.valid s o → E.ClientRun e (self.methods o) a e' tr → ∃ (s' : D.State), D.step s o s' a ∧ self.rep s' e'
Angelic correctness of each method body: every lower
ClientRunrealizes some permitted upper stepD.step s o s' amaintainingrep s' e'.
Instances For
Construct a Module D E for deterministic specifications ([D.HasStepFn fD],
[E.HasStepFn fE]) from functional ValidHistory and runClient obligations.
Instances For
Module implementation hides the intermediate representation and composes at any backend.
Instances For
Linking expands every module call and preserves the complete flattened backend trace.
Every flattened execution also decomposes into executions of its individual method calls.