Behaviour versions of the termination-only results #
Whole-program correctness, unit chains, interface abstraction and confinement were first stated for terminating runs. This file adds their divergence counterparts.
- For whole programs and unit chains,
elab_behaviour_equivapplies directly. - For interface abstraction, a well-typed term diverges iff it does not
terminate (
sdiverges_iff_not_terminates, from source type safety and Core determinism), so divergence equivalence follows from the existing termination equivalence. - For confinement, the ambient environment need not be typed, so we argue on the small-step relation: the two runs make the same deterministic initial steps and then run the same body under the same (sandboxed) environment.
General helpers #
For a well-typed source term under a well-typed value environment, divergence is exactly non-termination.
Divergence through an evaluation frame W whose steps under ρ are exactly
the steps of the hole under ρ', except for steps to a normal form.
Unique selection for a well-typed package (public copy of the private
selpkg_deterministic of SCE.Semantics.Determinism).
1. Whole programs #
Whole-program correctness, behaviour. A closed program and its elaboration have the same behaviour: same results, and divergence iff divergence.
2. Unit chains #
Multi-import unit chains, behaviour.
3. Interface abstraction #
Interface abstraction, divergence. Under the hypotheses of
interface_abstraction, the client linked against either provider diverges
iff it diverges against the other.
Interface abstraction, behaviour. The same exports on termination, and divergence iff divergence.
Interface abstraction (n-ary linkall). Two well-typed provider values
that select the same package at the client's import interface D drive the
client to the same exports.
Interface abstraction (n-ary linkall), divergence.
Interface abstraction (n-ary linkall), behaviour.
4. Confinement #
A sandboxed functor applied to a value diverges exactly when its body
diverges under ε ; varg, whatever the ambient value environment.
Sandboxed functor confinement, divergence. The application diverges under one ambient value environment iff it diverges under any other.
A link of a provider value whose only l is a against an evaluated
sandboxed client diverges exactly when the client body diverges under
ε ; {l = a}.
Link confinement, divergence (evaluated clients). Two links whose
clients are the same sandboxed closure, and whose provider values supply the
same unique import a, diverge together, whatever the providers' other
contents and the ambient value environments.
Link confinement, divergence (literal sandboxed functors).
Link confinement, same behaviour (the paper's restated Link Confinement).
Provider values that each select the import a exactly once, linked with
the same sandboxed client under arbitrary ambient environments, give the
client the same exports, and one link diverges iff the other does.