Bridges between the Hoare logic and the soundness specification #
Connection between Hoare.TripleWith and assertion validity #
allAssertsValidOnTraces_implies_triple_valid— validity of all assertions on every reachable trace impliesHoare.TripleWithwith the trivial postcondition;triple_implies_assertValidOnTracesWhen— aHoare.TripleWith, together with initial-environment well-formedness and must-termination, implies per-identifier validity on every reachable trace.
A single AssertValidOnTracesWhen cannot imply Hoare.TripleWith, because the
triple requires every assertion in its terminating traces to be valid. Without
must-termination, the converse also fails: a partial-correctness triple does not
constrain intermediate prefixes of executions that never reach a terminal or
exiting configuration.
Connection between Hoare.Triple and OverapproximatesTraces #
Strata.Logic.Hoare.Triple is EventLang-generic, so a triple proved about the
target of a translation transports back to the source along a trace
overapproximation:
overapproximatesTraces_triple— a trace overapproximation (OverapproximatesTracesat trace-relation equality) preservesHoare.Triple.overapproximatesTracesWhen_triple— the same forOverapproximatesTracesWhen, under a precondition on the source statement.
Both are instantiated with the trace relation fixed to (· = ·). Because both
the output-environment relation and the trace relation are equality, the
terminal/exiting simulation hands back the same environment and the same
trace it was given; substituting those equal witnesses turns the source run into
a target run over identical data, which the target triple discharges directly.
Assertion validity and the reachability-guarded postcondition then hold for the
source verbatim — there is nothing to re-derive about the trace.
Connection between Hoare.TripleWith and assertion validity #
Trace-native validity of every assertion implies a Hoare.TripleWith with
the trivial postcondition. AllAssertsValidOnTracesWhen covers every
reachable configuration, so in particular it covers each terminal or
exiting trace admitted by the triple.
A Hoare.TripleWith yields per-identifier validity on every reachable
trace when all permitted initial environments are well-formed and every
execution from them must terminate. Must-termination extends each finite prefix
to a completed trace constrained by the triple.
If T overapproximates traces (up to trace equality) and an event-trace
Hoare triple holds on T(st) in L₂, then the triple holds on st in L₁.
The terminal/exiting trace simulations return the same environment and trace
witnesses (both relations are (· = ·)), so substituting them recovers a
target run over identical data for the target triple to discharge.
Precondition-bearing corollary: if T overapproximates traces when pre
holds and pre st is satisfied, then an event-trace Hoare triple on T(st)
in L₂ lifts to one on st in L₁.
Generalizes overapproximatesTraces_triple to a nontrivial precondition (recover
the latter with pre := fun _ => True and hsource_pre := trivial). The
transport is identical: equal environment and trace witnesses from the
terminal/exiting simulations feed the target triple unchanged.