Fil-C on Nix

Filnix wiki

the formal campaign

rocq/theories/Selected.v

Selected libc lifecycle segments, over the existing external-call effect discipline. Admission precedes behavior existence. Successful invocations supply their own logical endpoint and allocator readiness; neither is inferred from an unfinished prefix. Native satisfaction and coverage remain trusted obligations, not theorems of this adapter.

From Stdlib Require Import String ZArith List Bool Lia
From Nanofil Require Import Term Syntax Values Memory Runtime Semantics Identity ExternalCalls ExternalMachine Startup Stdio Shutdown Hi Composition HiArtifact Program Panics
Import ListNotations
Open Scope Z_scope
Open Scope list_scope

No changes to the core machine, runtime axioms or shutdown leaves.

15Module Selected R : Runtime
16Module A ≔ HiProgram R
17Module P ≔ A.P
18Module E ≔ P.M.E

Logical libc validity is separate from allocator readiness. Each action selects its own capability sources, writable spans, owned releases and allocation requests; reachability alone grants none of those rights. Validity must retain pending/active callback code and arguments, not require already-consumed arguments to remain live forever.

25Record segments: Type ≔ mkSegments
libc_valid
 : mem → stdio_world → shutdown_state → Prop
selected_action
 : mem → stdio_world → shutdown_state → shutdown_action → Prop
segment_sources
 : shutdown_state → shutdown_action → mem → stdio_world → listspan
segment_writes
 : shutdown_state → shutdown_action → mem → stdio_world → listspan
segment_releases
 : shutdown_state → shutdown_action → mem → stdio_world → listZ
segment_requests
 : shutdown_state → shutdown_action → mem → stdio_world → Z → Z → Prop
segment_prefix
 : shutdown_state → shutdown_action → mem → stdio_world → listZ → listevent → mem → stdio_world → Prop
segment_panics
 : shutdown_state → shutdown_action → reason → Prop

Completion shares the very same logical target between the contract postcondition and the outer adapter. The lifecycle edge fixes phase, status, inventory and FIFO output transfer; validity supplies the native representation obligation. It says nothing about native totality.

41Definition segment_finishspecs : segments sh action trace m′ w′ sh′ : Prop ≔
shutdown_stepsh action sh′ ∧ trace = P.action_eventsaction ∧ libc_validspecs m′ w′ sh′

Empty arguments/void return describe a logical segment marker, NOT a callback's C ABI or a native return from exit/_exit. Enabled selection and source validity are checked even when no invocation exists.

47Definition selected_contractspecs : segments sh action : contractstdio_world ≔
mkContractstdio_world RVoid λresult args ⇒ result = CVoid ∧ args = [ ] λxs m w ⇒ xs = [ ] ∧ libc_validspecs m w sh ∧ selected_actionspecs m w sh action ∧ ∃full, shutdown_stepsh action full λ_ m w ⇒ segment_sourcesspecs sh action m w λ_ m w ⇒ segment_writesspecs sh action m w λ_ m w ⇒ segment_releasesspecs sh action m w λ_ m w ⇒ segment_requestsspecs sh action m w λ_ m w ⇒ segment_prefixspecs sh action m w λ_ _ _ _ trace ending m′ w′ ⇒ ending = CallReturn[ ] ∧ ∃sh′, segment_finishspecs sh action trace m′ w′ sh′ resource_reason segment_panicsspecs sh action

Runtime readiness is never hidden inside a memory-only precondition.

62Definition selected_readyspecs : segments s m w sh : Prop ≔
R.readys m ∧ libc_validspecs m w sh

The adapter uses the contract's actual normal post, not a second independently supplied action-post or endpoint-readiness hypothesis.

67Definition boundaryspecs : segments : P.shutdown_boundary ≔
P.mkShutdownBoundaryselected_readyspecs selected_contractspecs λ_ _ ⇒ CVoid λ_ _ ⇒ [ ] λ_ _ ⇒ [ ] λsh action _ _ _ _ trace _ m′ w′ sh′ ⇒ segment_finishspecs sh action trace m′ w′ sh′

Admission is independent of invocation existence, but restricted to explicitly selected actions. InCallback's logical register rule alone cannot authorize an unknown callback.

75Theorem selected_admits
∀ specs s m w sh action full
selected_readyspecs s m w sh
selected_actionspecs m w sh action
shutdown_stepsh action full
P.shutdown_admissibleboundaryspecs s m w sh action
Explore proof 7 tactics

Initial goal

⊢
∀specs : segments s : R.state m : mem w : stdio_world sh : shutdown_state action : shutdown_action full : shutdown_state, selected_readyspecs s m w sh → selected_actionspecs m w sh action → shutdown_stepsh action full → P.shutdown_admissibleboundaryspecs s m w sh action

intros specs s m w sh action full _ Hvalid Hselect Hstep

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full
⊢
P.shutdown_admissibleboundaryspecs s m w sh action

split ; split ; reflexivity |

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full

split ; reflexivity |

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full
⊢
libc_validspecs m w sh ∧ selected_actionspecs m w sh action ∧ ∃full0 : shutdown_state, shutdown_stepsh action full0

split ; exact Hvalid |

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full
⊢
selected_actionspecs m w sh action ∧ ∃full0 : shutdown_state, shutdown_stepsh action full0

split ; exact Hselect |

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full
⊢
∃full0 : shutdown_state, shutdown_stepsh action full0

exists full

specs :
s :
R.state
m :
Hvalid :
libc_validspecs m w sh
Hselect :
selected_actionspecs m w sh action
Hstep :
shutdown_stepsh action full
⊢
shutdown_stepsh action full

exact Hstep

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs s m w sh action full _ Hvalid Hselect Hstep
split ; split ; reflexivity |
split ; reflexivity |
split ; exact Hvalid |
split ; exact Hselect |
exists full
exact Hstep

The born list, prefix and normal post all come from the SAME invocation. Runtime readiness follows its effect path; logical validity follows its post. Resource endings and unfinished prefixes do not take this rule.

87Theorem invocation_realizes
∀ specs s m w sh action trace s′ m′ w′
R.readys m
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s′ m′ w′
∃sh′, P.realizesboundaryspecs s m w sh action trace s′ m′ w′ sh′
Explore proof 4 tactics

Initial goal

⊢
∀specs : segments s : R.state m : mem w : stdio_world sh : shutdown_state action : shutdown_action trace : listevent s′ : R.state m′ : mem w′ : stdio_world, R.readys m → E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s′ m′ w′ → ∃sh′ : shutdown_state, P.realizesboundaryspecs s m w sh action trace s′ m′ w′ sh′

intros specs s m w sh action trace s′ m′ w′ Hr Hcall

specs :
s :
R.state
m :
trace :
listevent
s′ :
R.state
m′ :
Hr :
R.readys m
Hcall :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s′ m′ w′
⊢
∃sh′ : shutdown_state, P.realizesboundaryspecs s m w sh action trace s′ m′ w′ sh′

pose proof E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall Hr as Hr′ _

specs :
s :
R.state
m :
trace :
listevent
s′ :
R.state
m′ :
Hr :
R.readys m
Hcall :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s′ m′ w′
Hr′ :
R.readys′ m′
⊢
∃sh′ : shutdown_state, P.realizesboundaryspecs s m w sh action trace s′ m′ w′ sh′

inversion Hcall ; subst

specs :
s :
R.state
m :
trace :
listevent
s′ :
R.state
m′ :
Hr :
R.readys m
Hcall :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s′ m′ w′
Hr′ :
R.readys′ m′
born :
listZ
H :
H0 :
contract_preselected_contractspecs sh action [ ] m w
H1 :
E.prefixselected_contractspecs sh action [ ] s m w born trace s′ m′ w′
H2 :
contract_postselected_contractspecs sh action [ ] m w born trace CallReturn[ ] m′ w′
H3 :
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
H4 :
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsselected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesselected_contractspecs sh action [ ] m w born m′ values
H5 :
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, trace = before ++ ProcessExitstatus
⊢
∃sh′ : shutdown_state, P.realizesboundaryspecs s m w sh action trace s′ m′ w′ sh′

match goal withHpre : contract_pre_ _ _ _ , Hpost : contract_post_ _ _ _ _ _ _ _ _ |- _⇒destruct Hpre as _ Hvalid Hselect Henabled ; destruct Hpost as _ target Hstep Htrace Hvalid′ ; exists target ; eapply P.realize_action ; simpl ; exact Hstep | split ; assumption | eapply selected_admits ; split ; assumption | exact Hselect | exact Hstep | eassumption | repeat split ; assumption | exact Htrace | split ; assumptionend

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs s m w sh action trace s′ m′ w′ Hr Hcall
pose proof E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall Hr as Hr′ _
inversion Hcall ; subst
match goal withHpre : contract_pre_ _ _ _ , Hpost : contract_post_ _ _ _ _ _ _ _ _ |- _⇒destruct Hpre as _ Hvalid Hselect Henabled ; destruct Hpost as _ target Hstep Htrace Hvalid′ ; exists target ; eapply P.realize_action ; simpl ; exact Hstep | split ; assumption | eapply selected_admits ; split ; assumption | exact Hselect | exact Hstep | eassumption | repeat split ; assumption | exact Htrace | split ; assumptionend

The body may carry a stronger opaque invariant for its ACTUAL entry inventory. This conservative form accepts every well-formed logical output queue; queues are obligations, not a claim about physical FILE buffers. Native puts preservation of this stronger invariant remains part of the trusted contract, not a new runtime axiom.

112Definition entry_repspecs : segments inventory : listregistration m : mem w : stdio_world : Prop ≔
∀q, stream_wfq → libc_validspecs m w mkShutdownTls 0 inventory [ ] q

Exact entry readiness survives a finite application run through the existing step theorem, without resetting to R.start after startup.

118Lemma body_ready
∀ specs inventory requests st trace st′
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv st trace st′
P.M.state_ready_ st
P.M.state_ready_ st′
Explore proof 6 tactics

Initial goal

⊢
∀specs : segments inventory : listregistration requests : listword → mem → stdio_world → Z → Z → Prop st : P.M.stateprogram_world trace : listevent st′ : P.M.stateprogram_world, P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv st trace st′ → P.M.state_readyprogram_world st → P.M.state_readyprogram_world st′

intros specs inventory requests st trace st′ Hrun

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
st :
P.M.stateprogram_world
trace :
listevent
st′ :
P.M.stateprogram_world
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv st trace st′
⊢
P.M.state_readyprogram_world st → P.M.state_readyprogram_world st′

induction Hrun ; auto |

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
st :
P.M.stateprogram_world
trace :
listevent
mid :
P.M.stateprogram_world
tail :
listevent
last :
P.M.stateprogram_world
H :
P.M.stepP.registryentry_repspecs inventory requests P.H.hi_genv st trace mid
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv mid tail last
IHHrun :
P.M.state_readyprogram_world mid → P.M.state_readyprogram_world last
⊢
P.M.state_readyprogram_world st → P.M.state_readyprogram_world last

intros Hr

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
st :
P.M.stateprogram_world
trace :
listevent
mid :
P.M.stateprogram_world
tail :
listevent
last :
P.M.stateprogram_world
H :
P.M.stepP.registryentry_repspecs inventory requests P.H.hi_genv st trace mid
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv mid tail last
IHHrun :
P.M.state_readyprogram_world mid → P.M.state_readyprogram_world last
Hr :
P.M.state_readyprogram_world st
⊢
P.M.state_readyprogram_world last

apply IHHrun

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
st :
P.M.stateprogram_world
trace :
listevent
mid :
P.M.stateprogram_world
tail :
listevent
last :
P.M.stateprogram_world
H :
P.M.stepP.registryentry_repspecs inventory requests P.H.hi_genv st trace mid
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv mid tail last
IHHrun :
P.M.state_readyprogram_world mid → P.M.state_readyprogram_world last
Hr :
P.M.state_readyprogram_world st
⊢
P.M.state_readyprogram_world mid

eapply P.M.step_ready ; | exact H | exact Hr

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
st :
P.M.stateprogram_world
trace :
listevent
mid :
P.M.stateprogram_world
tail :
listevent
last :
P.M.stateprogram_world
H :
P.M.stepP.registryentry_repspecs inventory requests P.H.hi_genv st trace mid
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv mid tail last
IHHrun :
P.M.state_readyprogram_world mid → P.M.state_readyprogram_world last
Hr :
P.M.state_readyprogram_world st
⊢

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs inventory requests st trace st′ Hrun
induction Hrun ; auto |
intros Hr
apply IHHrun
eapply P.M.step_ready ; | exact H | exact Hr
reflexivity

Reached returning puts retains the selected entry's inventory AND its callback-validity representation. The former alone would be insufficient. This discharges the existing reached-call closure, not native coverage.

129Theorem reached_puts_closed
∀ specs inventory requests start
∀s m s′ m′ w, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
P.body_inventry_repspecs inventory start
P.M.state_ready_ start
program_pendingP.world_ofstart = inventory
P.puts_shutdown_closedentry_repspecs inventory requests boundaryspecs start
Explore proof 12 tactics

Initial goal

⊢
∀specs : segments inventory : listregistration requests : listword → mem → stdio_world → Z → Z → Prop start : P.M.stateprogram_world, ∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w → P.body_inventry_repspecs inventory start → P.M.state_readyprogram_world start → program_pendingP.world_ofstart = inventory → P.puts_shutdown_closedentry_repspecs inventory requests boundaryspecs start

intros specs inventory requests start Hstable Hinv Hr Hinitial

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
⊢
P.puts_shutdown_closedentry_repspecs inventory requests boundaryspecs start

intros first s m w fuel trace n s′ m′ w′ Hrun Hcall

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w

pose proof P.body_run_inventory_ _ Hstable _ _ _ Hrun Hinv as Hpending

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w

simpl in Hpending

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w

rewrite Hinitial in Hpending

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory

destruct P.C.program_invoke_continuity_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as Hpending′ _ Hwf _

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :

destruct E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born _ Hrep _ _

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′

split

2 open

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′
⊢
R.readys′ m′
focused goal
specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′

–exact proj1E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall body_ready_ _ _ _ _ _ Hrun Hr

deferred goal
specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′

–rewrite Hpending′ , Hpending

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′

apply Hrep

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
start :
P.M.stateprogram_world
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hinv :
P.body_inventry_repspecs inventory start
Hr :
P.M.state_readyprogram_world start
Hinitial :
program_pendingP.world_ofstart = inventory
first :
listevent
s :
R.state
m :
fuel :
Z
trace :
listevent
n :
Z
s′ :
R.state
m′ :
Hrun :
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv start first P.M.Runninghi_callm fuel, s w
Hpending :
program_pendingw = inventory
Hpending′ :
born :
listZ
Hrep :
entry_repspecs inventory m′ program_stdiow′

exact Hwf

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs inventory requests start Hstable Hinv Hr Hinitial
intros first s m w fuel trace n s′ m′ w′ Hrun Hcall
pose proof P.body_run_inventory_ _ Hstable _ _ _ Hrun Hinv as Hpending
simpl in Hpending
rewrite Hinitial in Hpending
destruct P.C.program_invoke_continuity_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as Hpending′ _ Hwf _
destruct E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born _ Hrep _ _
split
–exact proj1E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall body_ready_ _ _ _ _ _ Hrun Hr
–rewrite Hpending′ , Hpending
apply Hrep
exact Hwf

A finite chain of actual normal invocations at exact shared snapshots. Logical edges name the targets; their validity and runtime readiness are extracted from those same calls, not supplied for each endpoint. This is not coverage of unfinished, refused or native executions.

154Inductive normal_runspecs : segments : R.state → mem → stdio_world → shutdown_state → listevent → R.state → mem → stdio_world → shutdown_state → Prop ≔
∀ s m w sh
normal_runspecs s m w sh [ ] s m w sh
normal_refl
∀ s m w sh action trace s1 m1 w1 sh1 tail s′ m′ w′ sh′
shutdown_stepsh action sh1
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
normal_next
normal_runspecs s m w sh trace ++ tail s′ m′ w′ sh′

Lift the invocation chain through the existing adapter. Logical target uniqueness identifies its extracted endpoint with the named cutpoint.

167Theorem normal_run_lifts
∀ specs s m w sh trace s′ m′ w′ sh′ rep requests host
normal_runspecs s m w sh trace s′ m′ w′ sh′
R.readys m
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′
Explore proof 14 tactics

Initial goal

⊢
∀specs : segments s : R.state m : mem w : stdio_world sh : shutdown_state trace : listevent s′ : R.state m′ : mem w′ : stdio_world sh′ : shutdown_state rep : mem → stdio_world → Prop requests : listword → mem → stdio_world → Z → Z → Prop host : P.host_boundary, normal_runspecs s m w sh trace s′ m′ w′ sh′ → R.readys m → P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

intros specs s m w sh trace s′ m′ w′ sh′ rep requests host Hrun

specs :
s :
R.state
m :
trace :
listevent
s′ :
R.state
m′ :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
Hrun :
normal_runspecs s m w sh trace s′ m′ w′ sh′
⊢
R.readys m → P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

induction Hrun ; intros Hr

2 open

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
Hr :
R.readys m
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh [ ] P.ShuttingDowns m w sh ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh
focused goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

–split ; constructor | auto

deferred goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

–destruct invocation_realizes_ _ _ _ _ _ _ _ _ _ Hr H0 as target Hreal

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 target
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

assert Htarget : target = sh1

2 open

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 target
⊢
target = sh1
focused goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 target
Htarget :
target = sh1
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

{inversion Hreal ; subst

2 open

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w P.action_eventsaction CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action P.action_eventsaction s1 m1 w1 target
born :
listZ
H1 :
shutdown_stepsh action target
H2 :
H3 :
P.shutdown_admissibleboundaryspecs s m w sh action
H5 :
P.action_postboundaryspecs sh action s m w born P.action_eventsaction s1 m1 w1 target
H4 :
P.M.E.prefixP.action_contractboundaryspecs sh action P.action_wordsboundaryspecs sh action s m w born P.action_eventsaction s1 m1 w1
H7 :
P.shutdown_readyboundaryspecs s1 m1 w1 target
⊢
target = sh1
deferred goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 target
Htarget :
target = sh1
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

eapply shutdown_step_target ; eauto

deferred goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 target
Htarget :
target = sh1
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

subst target

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

destruct IHHrunproj1E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ H0 Hr as Htail Hwf

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh → stream_wfshutdown_stdoutsh′

split

2 open

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′
⊢
P.runrep requests boundaryspecs host P.ShuttingDowns m w sh trace ++ tail P.ShuttingDowns′ m′ w′ sh′
focused goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′

+eapply P.program_next ; apply P.program_shutdown with action := action ; exact Hreal | exact Htail

deferred goal
specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′

+intros Hq

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′

apply Hwf

specs :
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
trace :
listevent
s1 :
R.state
m1 :
tail :
listevent
s′ :
R.state
m′ :
H :
shutdown_stepsh action sh1
H0 :
E.invokeselected_contractspecs sh action CVoid [ ] [ ] s m w trace CallReturn[ ] s1 m1 w1
Hrun :
normal_runspecs s1 m1 w1 sh1 tail s′ m′ w′ sh′
IHHrun :
R.readys1 m1 → P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′ ∧ stream_wfshutdown_stdoutsh1 → stream_wfshutdown_stdoutsh′
Hr :
R.readys m
Hreal :
P.realizesboundaryspecs s m w sh action trace s1 m1 w1 sh1
Htail :
P.runrep requests boundaryspecs host P.ShuttingDowns1 m1 w1 sh1 tail P.ShuttingDowns′ m′ w′ sh′

destruct H ; simpl in * ; try exact Hq ; eapply stream_step_wf ; eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs s m w sh trace s′ m′ w′ sh′ rep requests host Hrun
induction Hrun ; intros Hr
–split ; constructor | auto
–destruct invocation_realizes_ _ _ _ _ _ _ _ _ _ Hr H0 as target Hreal
assert Htarget : target = sh1
{inversion Hreal ; subst
eapply shutdown_step_target ; eauto
subst target
destruct IHHrunproj1E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ H0 Hr as Htail Hwf
split
+eapply P.program_next ; apply P.program_shutdown with action := action ; exact Hreal | exact Htail
+intros Hq
apply Hwf
destruct H ; simpl in * ; try exact Hq ; eapply stream_step_wf ; eauto

Conditional hi composition under the selected trusted libc contracts: exact successful entry, reached returning puts, normal shutdown calls, and an explicit completion witness at the resulting handoff. Nothing here claims that native execution supplies these witnesses or terminates.

192Theorem trusted_hi_completion
∀ specs inventory requests s0 m0 w0 argc argv envp args environment fuel first s m w callfuel calltrace n s1 m1 w1 tail s2 m2 w2 kind status pending consumed q completed : P.host_boundary
∀s m s′ m′ w, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
A.trusted_entry_contractentry_repspecs inventory s0 m0 w0 argc argv envp args environment
program_pendingw0 = inventory
P.M.runP.registryentry_repspecs inventory requests P.H.hi_genv P.M.Runninghi_entrym0 fuel, s0 w0 first P.M.Runninghi_callm callfuel, s w
normal_runspecs s1 m1 program_stdiow1 mkShutdownTls 0 program_pendingw1 [ ] program_stdoutw1 tail s2 m2 w2 mkShutdownHandedOffkind status pending consumed q
completeds2 m2 w2 mkShutdownHandedOffkind status pending consumed q
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym0 fuel, s0 w0 first ++ calltrace ++ tail ++ ProcessExitprocess_statusstatus P.Finisheds2 m2 w2 mkShutdownHandedOffkind status pending consumed q
Proof 17 steps Qed
intros specs inventory requests s0 m0 w0 argc argv envp args environment fuel first s m w callfuel calltrace n s1 m1 w1 tail s2 m2 w2 kind status pending consumed q completed Hstable Hentry Hinitial Hreach Hcall Hshutdown Hcomplete
pose proof A.trusted_entry_bodyentry_repspecs inventory s0 m0 w0 argc argv envp args environment fuel Hentry as Hbody
destruct Hentry as _ & Hr & _
assert Hclosed := reached_puts_closedspecs inventory requests _ Hstable Hbody Hr Hinitial
pose proof P.returning_puts_shutdownentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.M.Runninghi_entrym0 fuel, s0 w0 first s m w callfuel calltrace n s1 m1 w1 Hclosed Hreach Hcall as Hbridge
pose proof E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall body_ready_ _ _ _ _ _ Hreach Hr as Hr1 _
destruct normal_run_liftsspecs _ _ _ _ _ _ _ _ _ entry_repspecs inventory requests A.trusted_host_contractcompleted Hshutdown Hr1 as Hsegments Hwf
assert Hr2 : R.readys2 m2
{exact P.run_ready_ _ _ _ _ _ _ Hsegments Hr1
assert Hq : stream_wfq
{apply Hwf
exact proj1proj2proj2P.C.program_invoke_continuity_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall
replace first ++ calltrace ++ tail ++ ProcessExitprocess_statusstatus with first ++ calltrace ++ tail ++ ProcessExitprocess_statusstatus by repeat rewrite app_assoc ; reflexivity
eapply P.run_trans ; exact Hbridge |
eapply P.run_trans ; exact Hsegments |
eapply P.program_next with trace := ProcessExitprocess_statusstatus tail := [ ] ; | constructor

Finite-observation safety is separate from witnessed completion. It includes unfinished/resource leaves, promises at most one exit event, and retains the shared nonfailure classification for application stops. It does not establish native coverage of the outer relation.

245Theorem trusted_hi_observations
∀ specs inventory requests completed s m w argc argv envp args environment fuel trace last
∀s m s′ m′ w, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
A.trusted_entry_contractentry_repspecs inventory s m w argc argv envp args environment
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
P.runtime_readylast ∧ P.exit_counttrace ≤ 1%nat ∧ ∀why ms w′, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy
Explore proof 9 tactics

Initial goal

⊢
∀specs : segments inventory : listregistration requests : listword → mem → stdio_world → Z → Z → Prop completed : A.P.host_boundary s : R.state m : mem w : program_world argc : Z argv envp : ptr args environment : listlistZ fuel : Z trace : listevent last : P.state, ∀s0 : R.state m0 : mem s′ : R.state m′ : mem w0 : stdio_world, R.safepoints0 m0 s′ m′ → entry_repspecs inventory m0 w0 → stdio_readym0 w0 → entry_repspecs inventory m′ w0 ∧ stdio_readym′ w0 → A.trusted_entry_contractentry_repspecs inventory s m w argc argv envp args environment → P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last → P.runtime_readylast ∧ P.exit_counttrace ≤ 1%nat ∧ ∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

intros specs inventory requests completed s m w argc argv envp args environment fuel trace last Hstable Hentry Hrun

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hentry :
A.trusted_entry_contractentry_repspecs inventory s m w argc argv envp args environment
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
⊢
P.runtime_readylast ∧ P.exit_counttrace ≤ 1%nat ∧ ∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

pose proof A.trusted_entry_bodyentry_repspecs inventory s m w argc argv envp args environment fuel Hentry as Hbody

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hentry :
A.trusted_entry_contractentry_repspecs inventory s m w argc argv envp args environment
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
P.runtime_readylast ∧ P.exit_counttrace ≤ 1%nat ∧ ∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

destruct Hentry as _ & Hr & _

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
P.runtime_readylast ∧ P.exit_counttrace ≤ 1%nat ∧ ∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

split ; eapply P.run_ready ; eauto |

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
P.exit_counttrace ≤ 1%nat ∧ ∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

split

2 open

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
P.exit_counttrace ≤ 1%nat
focused goal
specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

–eapply P.at_most_one_exit ; eauto

deferred goal
specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
last :
P.state
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace last
Hbody :
⊢
∀why : ending ms : P.M.P.I.RM.mstate w′ : program_world, last = P.ApplicationP.M.Stoppedwhy ms w′ → ¬failure_endingwhy

–intros why ms w′ →

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
why :
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace P.ApplicationP.M.Stoppedwhy ms w′
Hbody :

eapply P.application_stopped_never_panics ; eauto

specs :
inventory :
requests :
listword → mem → stdio_world → Z → Z → Prop
s :
R.state
m :
argc :
Z
argv, envp :
args, environment :
listlistZ
fuel :
Z
trace :
listevent
Hstable :
∀s : R.state m : mem s′ : R.state m′ : mem w : stdio_world, R.safepoints m s′ m′ → entry_repspecs inventory m w → stdio_readym w → entry_repspecs inventory m′ w ∧ stdio_readym′ w
Hr :
R.readys m
why :
Hrun :
P.runentry_repspecs inventory requests boundaryspecs A.trusted_host_contractcompleted P.ApplicationP.M.Runninghi_entrym fuel, s w trace P.ApplicationP.M.Stoppedwhy ms w′
Hbody :

exact Hbody

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros specs inventory requests completed s m w argc argv envp args environment fuel trace last Hstable Hentry Hrun
pose proof A.trusted_entry_bodyentry_repspecs inventory s m w argc argv envp args environment fuel Hentry as Hbody
destruct Hentry as _ & Hr & _
split ; eapply P.run_ready ; eauto |
split
–eapply P.at_most_one_exit ; eauto
–intros why ms w′ →
exact Hbody

Logical instances exercise admission and cutpoints, not native libc. In particular the named callback below is a fixture, not an assertion that arbitrary user callbacks belong to the trusted libc boundary.

269Module SelectedChecks
271Module P ≔ S.P

One admitted callback retains an actual readable object capability.

274Definition callback_validm : mem entry : registration : Prop ≔
registration_callbackentry = OnExitTAtom"fixture_cleanup" WPtrmkPtr3072 Obj3072 ∧ access_resm 3072 Obj3072 8 Read 8 = Someok

The pending inventory and currently running callback need valid arguments; consumed history alone does not retain dead argument objects.

281Definition callbacks_validm sh : Prop ≔
∧
match shutdown_atsh with
⇒
_
⇒
True

Selection of a new registration is checked independently of token freshness.

286Definition action_selectedm action : shutdown_action : Prop ≔
match action with
_
⇒
True

A memory-backed fixture with separate readable argument and writable stdout roots. Neither root may be released; no allocations are authorized.

294Definition specs: S.segments ≔
S.mkSegmentsλm w sh ⇒ fixture_repm w ∧ callbacks_validm sh ∧ stream_wfshutdown_stdoutsh ∧ shutdown_uniquesh λm _ _ action ⇒ action_selectedm action λ_ _ _ _ ⇒ stdout_span; mkSpanmkPtr3072 Obj3072 8 λ_ _ _ _ ⇒ stdout_span λ_ _ _ _ ⇒ [ ] λ_ _ _ _ _ _ ⇒ False λ_ _ _ w _ _ _ w′ ⇒ w′ = w λ_ _ ⇒ puts_panic

A nonempty inventory, with a retained capability rather than an integer address.

306Definition entry: registration ≔
mkRegistration0 OnExitTAtom"fixture_cleanup" WPtrmkPtr3072 Obj3072

The entry representation is inhabited for every well-formed logical queue.

Explore proof 9 tactics

Initial goal

intros q Hwf

split ; split ; reflexivity |

split

2 open

focused goal

–split ; | exact I

2 open

deferred goal

constructor ; split ; reflexivity | constructor

deferred goal

–split ; exact Hwf |

repeat constructor

simpl

⊢
¬False

tauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros q Hwf
split ; split ; reflexivity |
split
–split ; | exact I
constructor ; split ; reflexivity | constructor
–split ; exact Hwf |
repeat constructor
simpl
tauto

Change only behavioral coverage: the same valid, selected source keeps its ABI/preconditions, permissions and post, but has no possible prefix. This is not a pinned native instance or a safe implementation.

Independent admission survives deleting every behavior. Thus neither admission nor absence of invocations can establish native coverage.

327Example admitted_without_behavior: let sh ≔ mkShutdownHandlers 0 entry [ ] stdout_initial in let action ≔ InvokeCallbackentry 0 in P.shutdown_admissibleS.boundaryuncovered_specs InterpRuntime.start hello_mem hello_world sh action ∧ ∀born trace s′ m′ w′, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace ending s′ m′ w′, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′
Explore proof 14 tactics

Initial goal

⊢
let action ≔ InvokeCallbackentry 0 in
P.shutdown_admissibleS.boundaryuncovered_specs InterpRuntime.start hello_mem hello_world sh action ∧ ∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

intros sh action

assert Hnone : ∀born trace s′ m′ w′, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′

2 open

focused goal
⊢
P.shutdown_admissibleS.boundaryuncovered_specs InterpRuntime.start hello_mem hello_world sh action ∧ ∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

{intros born trace s′ m′ w′ _ Hfalse

2 open

deferred goal
⊢
P.shutdown_admissibleS.boundaryuncovered_specs InterpRuntime.start hello_mem hello_world sh action ∧ ∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

exact Hfalse

deferred goal
⊢
P.shutdown_admissibleS.boundaryuncovered_specs InterpRuntime.start hello_mem hello_world sh action ∧ ∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

split

2 open

focused goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

–eapply S.selected_admits

5 open

focused goal
focused goal
⊢
shutdown_stepsh action ?full
deferred goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′
shelved goal

+split ; apply hello_ready ; split ; vm_compute ; congruence |

5 open

deferred goal
deferred goal
⊢
shutdown_stepsh action ?full
deferred goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′
shelved goal

exact nonempty_entrystdout_initial stdout_initial_wf

4 open

deferred goal
deferred goal
⊢
shutdown_stepsh action ?full
deferred goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′
shelved goal

+split ; reflexivity

3 open

deferred goal
⊢
shutdown_stepsh action ?full
deferred goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′
shelved goal

+constructor

deferred goal
⊢
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′ ∧ ∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

–split ; exact Hnone |

⊢
∀trace : listevent ending : call_end s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.invokeS.selected_contractuncovered_specs sh action CVoid [ ] [ ] InterpRuntime.start hello_mem hello_world trace ending s′ m′ w′

intros trace ending s′ m′ w′ Hcall

⊢
False

destruct S.E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born Hprefix

Hnone :
∀born : listZ trace : listevent s′ : InterpRuntime.state m′ : mem w′ : stdio_world, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′
trace :
listevent
ending :
m′ :
born :
listZ
⊢
False

exact Hnoneborn trace s′ m′ w′ Hprefix

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros sh action
assert Hnone : ∀born trace s′ m′ w′, ¬S.E.prefixS.selected_contractuncovered_specs sh action [ ] InterpRuntime.start hello_mem hello_world born trace s′ m′ w′
{intros born trace s′ m′ w′ _ Hfalse
exact Hfalse
split
+split ; apply hello_ready ; split ; vm_compute ; congruence |
+split ; reflexivity
+constructor
–split ; exact Hnone |
intros trace ending s′ m′ w′ Hcall
destruct S.E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born Hprefix
exact Hnoneborn trace s′ m′ w′ Hprefix

A fresh token cannot authorize an unknown callback, even where the logical register rule permits it. No invocation witness is needed for rejection.

357Example unknown_callback_rejected: ∀s, let sh ≔ mkShutdownInCallbackentry 0 [ ] 0%nat stdout_initial in let unknown ≔ mkRegistration1 AtExitTAtom"unknown" in ¬P.shutdown_admissibleS.boundaryspecs s hello_mem hello_world sh RegisterCallbackunknown
Explore proof 2 tactics

Initial goal

intros s sh unknown _ _ _ Hname _ _

discriminate Hname

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s sh unknown _ _ _ Hname _ _
discriminate Hname

Keeping the token and address while losing the retained capability's live bounds invalidates the entry, rather than silently removing its behavior.

Explore proof 2 tactics

Initial goal

⊢
∀ s : InterpRuntime.state  ,
let dead ≔ m_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem in

intros s dead _ _ _ _ Hread _

dead :=
m_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem : mem
Hread :
access_resdead 3072 Obj3072 8 Read 8 = Someok
⊢
False

discriminate Hread

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s dead _ _ _ _ Hread _
discriminate Hread

A selected segment really has no release ownership, even of its readable callback argument. Reuse the existing asymmetric footprint regression.

Explore proof 5 tactics

Initial goal

intros _ & Hr & _

Hr :
∀b : Z reg′ : region, object_regionb m_regionsm_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem = Somereg′ → ∃reg : region, object_regionb m_regionshello_mem = Somereg ∧ reg′ = reg ∨ Inb S.segment_releasesspecs shutdown_at ≔ Tls; shutdown_status ≔ 0; shutdown_pending ≔ entry; shutdown_consumed ≔ [ ]; shutdown_stdout ≔ stdout_initial EmptyTls hello_mem hello_world ++ [ ] ∧ r_kindreg = Heap ∧ r_lifereg = Live ∧ reg′ = r_base ≔ b; r_end ≔ b; r_kind ≔ Heap; r_life ≔ Freed
⊢
False

destruct Hr3072 mkRegion3072 3072 Heap Freed eq_refl as reg & Hreg & H | & _

Hr :
∀b : Z reg′ : region, object_regionb m_regionsm_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem = Somereg′ → ∃reg : region, object_regionb m_regionshello_mem = Somereg ∧ reg′ = reg ∨ Inb S.segment_releasesspecs shutdown_at ≔ Tls; shutdown_status ≔ 0; shutdown_pending ≔ entry; shutdown_consumed ≔ [ ]; shutdown_stdout ≔ stdout_initial EmptyTls hello_mem hello_world ++ [ ] ∧ r_kindreg = Heap ∧ r_lifereg = Live ∧ reg′ = r_base ≔ b; r_end ≔ b; r_kind ≔ Heap; r_life ≔ Freed
reg :
Hreg :
H :
r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed = reg
⊢
False

change SomemkRegion3072 3080 Heap Live = Somereg in Hreg

Hr :
∀b : Z reg′ : region, object_regionb m_regionsm_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem = Somereg′ → ∃reg : region, object_regionb m_regionshello_mem = Somereg ∧ reg′ = reg ∨ Inb S.segment_releasesspecs shutdown_at ≔ Tls; shutdown_status ≔ 0; shutdown_pending ≔ entry; shutdown_consumed ≔ [ ]; shutdown_stdout ≔ stdout_initial EmptyTls hello_mem hello_world ++ [ ] ∧ r_kindreg = Heap ∧ r_lifereg = Live ∧ reg′ = r_base ≔ b; r_end ≔ b; r_kind ≔ Heap; r_life ≔ Freed
reg :
Hreg :
Somer_base ≔ 3072; r_end ≔ 3080; r_kind ≔ Heap; r_life ≔ Live = Somereg
H :
r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed = reg
⊢
False

injection Hreg as ←

Hr :
∀b : Z reg′ : region, object_regionb m_regionsm_bytes ≔ m_byteshello_mem; m_regions ≔ r_base ≔ 1024; r_end ≔ 1030; r_kind ≔ GlobalData; r_life ≔ Live; r_base ≔ 2048; r_end ≔ 2064; r_kind ≔ Heap; r_life ≔ Live; r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed; m_aux ≔ m_auxhello_mem = Somereg′ → ∃reg : region, object_regionb m_regionshello_mem = Somereg ∧ reg′ = reg ∨ Inb S.segment_releasesspecs shutdown_at ≔ Tls; shutdown_status ≔ 0; shutdown_pending ≔ entry; shutdown_consumed ≔ [ ]; shutdown_stdout ≔ stdout_initial EmptyTls hello_mem hello_world ++ [ ] ∧ r_kindreg = Heap ∧ r_lifereg = Live ∧ reg′ = r_base ≔ b; r_end ≔ b; r_kind ≔ Heap; r_life ≔ Freed
H :
r_base ≔ 3072; r_end ≔ 3072; r_kind ≔ Heap; r_life ≔ Freed = r_base ≔ 3072; r_end ≔ 3080; r_kind ≔ Heap; r_life ≔ Live
⊢
False

discriminate H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros _ & Hr & _
destruct Hr3072 mkRegion3072 3072 Heap Freed eq_refl as reg & Hreg & H | & _
change SomemkRegion3072 3080 Heap Live = Somereg in Hreg
injection Hreg as ←
discriminate H

Read authority for the argument is not write authority for its bytes.

Explore proof 5 tactics

Initial goal

intros _ & _ & Hw & _

assert Hn : ¬write_authoritystdout_span [ ] hello_mem 3072

2 open

focused goal

{intros root & ← | & _ & Hin | base & reg & & _ ; unfold span_contains in Hin ; simpl in Hin ; lia

deferred goal

destruct Hw_ Hn as Hb _

discriminate Hb

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros _ & _ & Hw & _
assert Hn : ¬write_authoritystdout_span [ ] hello_mem 3072
{intros root & ← | & _ & Hin | base & reg & & _ ; unfold span_contains in Hin ; simpl in Hin ; lia
destruct Hw_ Hn as Hb _
discriminate Hb

An identity-memory fixture completes a selected, independently admissible logical action. Its full invocation—not merely a prefix—supplies the post.

411Lemma fixture_invocation
Explore proof 20 tactics

Initial goal

⊢
∀m : mem w : stdio_world sh : shutdown_state action : shutdown_action sh′ : shutdown_state, S.libc_validspecs m w sh → action_selectedm action → shutdown_stepsh action sh′ → S.libc_validspecs m w sh′ → S.E.invokeS.selected_contractspecs sh action CVoid [ ] [ ] InterpRuntime.start m w P.action_eventsaction CallReturn[ ] InterpRuntime.start m w

intros m w sh action sh′ Hvalid Hselect Hstep Hvalid′

eapply S.E.invoke_normal with born := [ ]

7 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
focused goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–split ; reflexivity

6 open

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–split ; reflexivity |

6 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
S.libc_validspecs m w sh ∧ S.selected_actionspecs m w sh action ∧ ∃full : shutdown_state, shutdown_stepsh action full
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

split ; exact Hvalid |

6 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
S.selected_actionspecs m w sh action ∧ ∃full : shutdown_state, shutdown_stepsh action full
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

split ; exact Hselect |

6 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∃full : shutdown_state, shutdown_stepsh action full
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

exists sh′

6 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
shutdown_stepsh action sh′
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

exact Hstep

5 open

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–split ; constructor | reflexivity

4 open

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–split ; reflexivity |

4 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∃sh'0 : shutdown_state, S.segment_finishspecs sh action P.action_eventsaction m w sh'0
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

exists sh′

4 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
S.segment_finishspecs sh action P.action_eventsaction m w sh′
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

split ; exact Hstep |

4 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

auto

3 open

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀why : reason, CallReturn[ ] ≠ CallResourcewhy
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–intros why Hbad

3 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
why :
Hbad :
⊢
False
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

discriminate Hbad

2 open

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀values : listword, CallReturn[ ] = CallReturnvalues → return_shapecontract_returnsS.selected_contractspecs sh action values ∧ Forallword_authoritycontract_sourcesS.selected_contractspecs sh action [ ] m w [ ] m values
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–intros values Heq

2 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
values :
listword
Heq :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

injection Heq as ←

2 open

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

split ; constructor

deferred goal
m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
⊢
∀status : Z, CallReturn[ ] = CallExitstatus → ∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

–intros status Hbad

m :
Hvalid :
Hselect :
Hstep :
shutdown_stepsh action sh′
Hvalid′ :
status :
Z
Hbad :
CallReturn[ ] = CallExitstatus
⊢
∃before : listevent, P.action_eventsaction = before ++ ProcessExitstatus

discriminate Hbad

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros m w sh action sh′ Hvalid Hselect Hstep Hvalid′
eapply S.E.invoke_normal with born := [ ]
–split ; reflexivity
–split ; reflexivity |
split ; exact Hvalid |
split ; exact Hselect |
exists sh′
exact Hstep
–split ; constructor | reflexivity
–split ; reflexivity |
exists sh′
split ; exact Hstep |
auto
–intros why Hbad
discriminate Hbad
–intros values Heq
injection Heq as ←
split ; constructor
–intros status Hbad
discriminate Hbad

The adapter's successful-invocation theorem is inhabited with a nonempty admitted inventory and retains the active callback's readable argument.

Explore proof 12 tactics

Initial goal

apply S.invocation_realizes ; apply hello_ready ; split ; vm_compute ; congruence |

eapply fixture_invocation with sh′ := mkShutdownInCallbackentry 0 [ ] 0%nat stdout_initial

4 open

focused goal
focused goal
focused goal

–exact nonempty_entrystdout_initial stdout_initial_wf

3 open

deferred goal
deferred goal
deferred goal

–split ; reflexivity

2 open

deferred goal
deferred goal

–constructor

deferred goal

–split ; split ; reflexivity |

split

2 open

focused goal

+split ; constructor | split ; reflexivity

deferred goal

+split ; exact stdout_initial_wf |

repeat constructor

simpl

⊢
¬False

tauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
apply S.invocation_realizes ; apply hello_ready ; split ; vm_compute ; congruence |
–split ; reflexivity
–constructor
–split ; split ; reflexivity |
split
+split ; constructor | split ; reflexivity
+split ; exact stdout_initial_wf |
repeat constructor
simpl
tauto

Valid completed cleanup cutpoints retain the same memory and consumed inventory while output obligations evolve. No terminal leaf is resumed.

449Definition cleanupq : stream_state : shutdown_state ≔
mkShutdownCleanup 0 [ ] 0%nat q

All well-formed fixture cleanup snapshots satisfy the logical post.

Explore proof 7 tactics

Initial goal

intros q Hwf

split ; split ; reflexivity |

split ; split ; constructor |

split ; exact Hwf |

repeat constructor

simpl

⊢
¬False

tauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros q Hwf
split ; split ; reflexivity |
split ; split ; constructor |
split ; exact Hwf |
repeat constructor
simpl
tauto

Each completed cutpoint comes from a real contract invocation.

Explore proof 25 tactics

Initial goal

intros q action q′ Hnot Hstream Hwf

assert Hstep : shutdown_stepcleanupq ShutdownOutputaction cleanupq′ by apply shutdown_cleanup_output ; assumption

assert Hcall := fixture_invocationhello_mem hello_world cleanupq ShutdownOutputaction cleanupq′ cleanup_valid_ Hwf I Hstep cleanup_valid_ stream_step_wf_ _ _ Hstream Hwf

assert Hevents : P.action_eventsShutdownOutputaction = [ ]

2 open

focused goal

{destruct action ; try reflexivity

2 open

deferred goal

exfalso

2 open

deferred goal

apply Hnotbytes

2 open

deferred goal

reflexivity

deferred goal

rewrite Hevents in Hcall

destruct S.E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born Hprefix

assert Hr := hello_readyInterpRuntime.start ltac:split ; vm_compute ; congruence

eapply P.realize_action with born := born

7 open

focused goal
focused goal
focused goal
focused goal
focused goal
focused goal

–exact Hstep

6 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal

–split ; exact Hr | apply cleanup_valid ; exact Hwf

5 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal

–eapply S.selected_admits ; split ; exact Hr | apply cleanup_valid ; exact Hwf | exact I | exact Hstep

4 open

deferred goal
deferred goal
deferred goal
deferred goal

–exact Hprefix

3 open

deferred goal
deferred goal
deferred goal

–split ; exact Hstep |

3 open

deferred goal
deferred goal

split ; symmetry ; exact Hevents |

3 open

deferred goal
deferred goal

apply cleanup_valid

3 open

deferred goal
deferred goal

eapply stream_step_wf ; eauto

2 open

deferred goal
deferred goal

–symmetry

2 open

deferred goal

exact Hevents

deferred goal

–split ; exact Hr |

apply cleanup_valid

eapply stream_step_wf ; eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros q action q′ Hnot Hstream Hwf
assert Hstep : shutdown_stepcleanupq ShutdownOutputaction cleanupq′ by apply shutdown_cleanup_output ; assumption
assert Hevents : P.action_eventsShutdownOutputaction = [ ]
{destruct action ; try reflexivity
exfalso
apply Hnotbytes
reflexivity
rewrite Hevents in Hcall
destruct S.E.invoke_prefix_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born Hprefix
assert Hr := hello_readyInterpRuntime.start ltac:split ; vm_compute ; congruence
eapply P.realize_action with born := born
–exact Hstep
–split ; exact Hr | apply cleanup_valid ; exact Hwf
–eapply S.selected_admits ; split ; exact Hr | apply cleanup_valid ; exact Hwf | exact I | exact Hstep
–exact Hprefix
–split ; exact Hstep |
split ; symmetry ; exact Hevents |
eapply stream_step_wf ; eauto
–symmetry
exact Hevents
–split ; exact Hr |
eapply stream_step_wf ; eauto

Delivery, a zero-progress error, and discard are three completed segments with exact intermediate queues. Silent observations do not mean delivery and discard are the same operation.

Explore proof 14 tactics

Initial goal

⊢
∀rep : mem → stdio_world → Prop requests : listword → mem → stdio_world → Z → Z → Prop host : P.host_boundary, P.runrep requests S.boundaryspecs host P.ShuttingDownInterpRuntime.start hello_mem hello_world cleanuporientation ≔ ByteOriented; outstanding ≔ 65; 66; stream_error ≔ false [ ] P.ShuttingDownInterpRuntime.start hello_mem hello_world cleanuporientation ≔ ByteOriented; outstanding ≔ [ ]; stream_error ≔ true

intros rep requests host

eapply P.program_next with trace := [ ] tail := [ ] mid := P.ShuttingDownInterpRuntime.start hello_mem hello_world cleanupmkStreamByteOriented 66 false

2 open

focused goal

–apply P.program_shutdown with action := ShutdownOutputDeliver65

2 open

deferred goal

apply cleanup_realized ; discriminate | apply stream_deliver65 66 false ; discriminate |

2 open

rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
deferred goal

split ; repeat constructor ; lia | reflexivity

deferred goal

–eapply P.program_next with trace := [ ] tail := [ ] mid := P.ShuttingDownInterpRuntime.start hello_mem hello_world cleanupmkStreamByteOriented 66 true

2 open

focused goal

+apply P.program_shutdown with action := ShutdownOutputOutputError

2 open

deferred goal

apply cleanup_realized ; discriminate | constructor |

2 open

rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
deferred goal

split ; repeat constructor ; lia | reflexivity

deferred goal

+eapply P.program_next with trace := [ ] tail := [ ]

3 open

rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
focused goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
shelved goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
⊢
P.state

∗apply P.program_shutdown with action := ShutdownOutputDiscard66

6 open

rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
deferred goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
shelved goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
shelved goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
⊢
shelved goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
shelved goal
rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop

apply cleanup_realized ; discriminate | apply stream_discard66 [ ] true ; discriminate |

2 open

rep :
mem → stdio_world → Prop
requests :
listword → mem → stdio_world → Z → Z → Prop
deferred goal

split ; repeat constructor ; lia | reflexivity

deferred goal

∗constructor

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros rep requests host
–apply P.program_shutdown with action := ShutdownOutputDeliver65
apply cleanup_realized ; discriminate | apply stream_deliver65 66 false ; discriminate |
split ; repeat constructor ; lia | reflexivity
apply cleanup_realized ; discriminate | constructor |
split ; repeat constructor ; lia | reflexivity
+eapply P.program_next with trace := [ ] tail := [ ]
∗apply P.program_shutdown with action := ShutdownOutputDiscard66
apply cleanup_realized ; discriminate | apply stream_discard66 [ ] true ; discriminate |
split ; repeat constructor ; lia | reflexivity
∗constructor

A successful logical entry with argv, environment, the generated hi literal, stdout storage and the nonempty admitted callback inventory.

The concrete startup vectors and retained callback argument are genuine readable capabilities; a logical queue is not a physical FILE claim.

526Lemma completion_entry_image
Explore proof 31 tactics

Initial goal

split

2 open

focused goal

–split ; lia |

2 open

deferred goal

split ; reflexivity |

2 open

deferred goal

split

3 open

focused goal
deferred goal

+split ; reflexivity |

3 open

deferred goal
deferred goal

exists hi_literal

3 open

deferred goal
deferred goal

split ; vm_compute ; repeat split ; congruence |

3 open

deferred goal
deferred goal

split ; vm_compute ; repeat split ; try congruence ; lia |

3 open

deferred goal
deferred goal

vm_compute

3 open

⊢
Datatypes.Eq = Datatypes.Gt → False ∧ Datatypes.Lt = Datatypes.Lt ∧ 0 = 0 ∧ CNone = CNone
deferred goal
deferred goal

repeat split ; congruence

2 open

deferred goal
deferred goal

+vm_compute

2 open

⊢
Someok = Someok ∧ Datatypes.Eq = Datatypes.Gt → False ∧ Datatypes.Lt = Datatypes.Lt ∧ 0 = 0 ∧ CNone = CNone
deferred goal

repeat split ; congruence

deferred goal

–split

2 open

focused goal

+intros q Hwf

2 open

deferred goal

split ; split ; reflexivity |

2 open

deferred goal

split

3 open

focused goal
deferred goal

∗split ; | exact I

3 open

deferred goal
deferred goal

constructor ; split ; reflexivity | constructor

2 open

deferred goal
deferred goal

∗split ; exact Hwf |

2 open

deferred goal

repeat constructor

2 open

deferred goal

simpl

2 open

⊢
¬False
deferred goal

tauto

deferred goal

+split

2 open

focused goal

∗split ; reflexivity |

2 open

deferred goal

constructor ; | constructor

2 open

deferred goal

split ; simpl ; lia |

2 open

deferred goal

exists 2048, mkRegion2048 2064 Heap Live

2 open

deferred goal

repeat split ; reflexivity

deferred goal

∗split ; reflexivity |

vm_compute

⊢
Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 104 = 104 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 101 = 101 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 108 = 108 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 108 = 108 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 111 = 111 ∧ 0 = 0

repeat split ; try congruence ; lia

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–split ; lia |
split ; reflexivity |
split
+split ; reflexivity |
exists hi_literal
split ; vm_compute ; repeat split ; congruence |
split ; vm_compute ; repeat split ; try congruence ; lia |
vm_compute
repeat split ; congruence
+vm_compute
repeat split ; congruence
–split
+intros q Hwf
split ; split ; reflexivity |
split
∗split ; | exact I
constructor ; split ; reflexivity | constructor
∗split ; exact Hwf |
repeat constructor
simpl
tauto
+split
∗split ; reflexivity |
constructor ; | constructor
split ; simpl ; lia |
exists 2048, mkRegion2048 2064 Heap Live
repeat split ; reflexivity
∗split ; reflexivity |
vm_compute
repeat split ; try congruence ; lia

Every static object is below the actual entry allocator state, and the vector/literal stores do not write above that state.

Proof 42 steps Qed
pose proof hello_readyInterpRuntime.start ltac:split ; vm_compute ; congruence as Hpos Hobj Hbytes
split ; exact Hpos |
split
–intros b reg E
change object_regionb mkRegion65552 65560 GlobalData Live :: mkRegion4096 4112 Heap Live :: mkRegion4200 4208 Heap Live :: m_regionshello_mem = Somereg in E
cbn - [ Z.eqb ] in E
destruct 65552 =? b eqn: E1
+apply Z.eqb_eq in E1
subst b
injection E as ←
simpl
split ; vm_compute ; repeat split ; congruence |
split ; vm_compute ; congruence | discriminate
+destruct 4096 =? b eqn: E2
∗apply Z.eqb_eq in E2
subst b
injection E as ←
simpl
split ; vm_compute ; repeat split ; congruence |
split ; vm_compute ; congruence | discriminate
∗destruct 4200 =? b eqn: E3
--apply Z.eqb_eq in E3
subst b
injection E as ←
simpl
split ; vm_compute ; repeat split ; congruence |
split ; vm_compute ; congruence | discriminate
--apply Hobj
exact E
–intros a Ha
destruct Hbytesa Ha as Hb Haux
change 4294967296 ≤ a in Ha
assert Hrange : 4096 ≤? a && a <? 4096 + 8 = false
{apply andb_false_iff
right
apply Z.ltb_ge
lia
assert Hslot : a =? 4096 = false by apply Z.eqb_neq ; lia
cbn - [ copy_c_bytes Z.leb Z.ltb Z.eqb Z.add ]
rewrite Hrange , Hslot , copy_c_bytes_aux , copy_c_bytes_outside by right ; simpl ; lia
exact conjHb Haux

The actual puts invocation keeps the nonempty inventory and accepts the bytes before the later hard exit, without asserting descriptor delivery.

Proof 42 steps Qed
destruct proj2completion_entry_image as Hr Hw Hl
split ; reflexivity |
split ; exact Hstr |
split ; exact puts_buffered_acceptance | split ; reflexivity
eapply S.E.invoke_normal with born := [ ]
–split ; right ; exists TAtom"v1" ; reflexivity |
exists TmpTAtom"v0"
reflexivity
–split
+split ; exact Hr |
split ; exact Hw |
auto
+split ; split ; exact stdout_initial_wf | repeat constructor ; simpl ; tauto | discriminate
–split ; constructor |
split
+split ; exact Hr |
split ; exact Hw |
split
∗apply stdio_delegates_refl ; reflexivity | exact proj2Hw
∗right
exists hi_literal, hello_bytes, hello_bytes ++ 10, [ ] : listZ
split ; reflexivity |
split ; exact Hstr |
split ; reflexivity
+split ; reflexivity |
eapply P.C.program_post_prefix ; exact Hpost
–intros why Hbad
discriminate
–intros values Heq
injection Heq as ←
split
+exists WInt6
split ; reflexivity
+constructor ; exact I | constructor
–intros status Hbad
discriminate

Three genuine logical cutpoints: TLS, callback entry, then the callback's hard exit. Tokens are consumed once, and accepted bytes stay outstanding.

Proof 36 steps Qed
assert Hwf : stream_wfProgramChecks.buffered by split ; repeat constructor ; lia | reflexivity
assert Hvalid : ∀phase pending consumed, callbacks_validcompletion_memory mkShutdownphase 0 pending consumed ProgramChecks.buffered → shutdown_uniquemkShutdownphase 0 pending consumed ProgramChecks.buffered → S.libc_validspecs completion_memory hello_world mkShutdownphase 0 pending consumed ProgramChecks.buffered
{intros phase pending consumed Hcallbacks Hunique
split ; split ; reflexivity |
split ; exact Hcallbacks |
split ; assumption
assert Htls := proj1proj2completion_entry_imageProgramChecks.buffered Hwf
{apply Hvalid ; split ; constructor ; split ; reflexivity | constructor | exact I |
repeat constructor
simpl
tauto
{apply Hvalid ; split ; constructor | split ; reflexivity |
repeat constructor
simpl
tauto
{split ; split ; reflexivity |
split ; split ; constructor |
split ; exact Hwf |
repeat constructor
simpl
tauto
eapply S.normal_next with action := EmptyTls trace := [ ] tail := [ ] sh1 := mkShutdownHandlers 0 entry [ ] ProgramChecks.buffered
–constructor
–eapply fixture_invocation ; exact Htls | exact I | constructor | exact Hhandlers
–eapply S.normal_next with action := InvokeCallbackentry 0 trace := [ ] tail := [ ] sh1 := mkShutdownInCallbackentry 0 [ ] 0%nat ProgramChecks.buffered
+constructor
+eapply fixture_invocation ; exact Hhandlers | split ; reflexivity | constructor | exact Hactive
+eapply S.normal_next with action := HandoffHardExit 258 trace := [ ] tail := [ ]
∗constructor
intros kind Hbad
discriminate
∗eapply fixture_invocation ; exact Hactive | exact I | constructor ; intros ; discriminate | exact Hhard
∗constructor

Host completion is witnessed only at this full handoff snapshot.

655Definition completion_host: P.host_boundary ≔
λs m w sh ⇒ s = InterpRuntime.start ∧ m = completion_memory ∧ w = hello_world ∧ sh = mkShutdownHandedOffHardExit 258 [ ] 0%nat ProgramChecks.buffered

A different status or an invented empty queue does not match the witness.

Explore proof 1 tactics

Initial goal

split ; intros _ & _ & _ & Hsnapshot ; discriminate Hsnapshot

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split ; intros _ & _ & _ & Hsnapshot ; discriminate Hsnapshot

This full logical path uses the composition theorem, an actual returning puts, nonempty callback admission, and a supplied exact host witness. The observed exit is 258 mod 256 = 2, not main's original zero status.

Explore proof 15 tactics

Initial goal

replace StreamBytes1 hello_bytes ++ 10; ProcessExit2 with [ ] ++ StreamBytes1 hello_bytes ++ 10 ++ [ ] ++ ProcessExitprocess_status258 by reflexivity

eapply S.trusted_hi_completion with inventory := entry argc := 1 argv := entry_argv envp := entry_envp args := hello_bytes environment := [ ] n := 6

14 open

⊢
∀s : InterpRuntime.state m : mem s′ : InterpRuntime.state m′ : mem w : stdio_world, InterpRuntime.safepoints m s′ m′ → S.entry_repspecs entry m w → stdio_readym w → S.entry_repspecs entry m′ w ∧ stdio_readym′ w
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

–apply HiChecks.interpreter_stdio_stable

13 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

–split ; exact proj1completion_entry_image |

13 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

split ; exact completion_ready |

13 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

split ; exact proj2completion_entry_image |

13 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

split

14 open

focused goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

+split ; exact stdout_initial_wf | repeat constructor ; simpl ; tauto

13 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

+discriminate

12 open

deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

–reflexivity

11 open

deferred goal
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal
shelved goal
⊢
Z
shelved goal
shelved goal
⊢
shelved goal

–apply P.H.hi_reaches_call

7 open

⊢
10 ≠ 0
deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal

lia

6 open

deferred goal
deferred goal
deferred goal
shelved goal
shelved goal
⊢
shelved goal

–exact completion_puts

2 open

deferred goal
deferred goal

–exact completion_shutdown

deferred goal

–repeat split ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
replace StreamBytes1 hello_bytes ++ 10; ProcessExit2 with [ ] ++ StreamBytes1 hello_bytes ++ 10 ++ [ ] ++ ProcessExitprocess_status258 by reflexivity
eapply S.trusted_hi_completion with inventory := entry argc := 1 argv := entry_argv envp := entry_envp args := hello_bytes environment := [ ] n := 6
–split ; exact proj1completion_entry_image |
split ; exact completion_ready |
split ; exact proj2completion_entry_image |
split
+split ; exact stdout_initial_wf | repeat constructor ; simpl ; tauto
+discriminate
–reflexivity
–repeat split ; reflexivity