rocq/theories/Linked.v
Retained void callbacks at the labelled program boundary. Entry is independently admitted AFTER the exit-registry pop; execution uses ordinary ExternalMachine steps. A stopped return snapshot precedes local teardown, so the shutdown endpoint reconstructs that memory. This slice does not intercept exit requests or claim native coverage.
A detached installed slot retains its callable address AND capability. Free/reserved slots cannot select callback code.
Native argument classes, not re-evaluated IR operands. The dummy constants are immaterial to indirect_call_conv, which reads only these classes and the separately retained words.
The current signed status is passed as full canonical int bits, not the host's low-byte wait status. This pin calls cxa(arg,status).
The exact selected defined code and generic calling convention. Module checking and semantic admission are not consequences of a retained Fn capability or of a successful call_frame. Only void, nonvariadic callbacks are covered by this first bridge.
Local teardown changes only region lifetimes, never bytes or aux, including a global slot retaining a pointer into the ended frame.
Explore proof 10 tactics
Initial goal
unfold invalidate_locals
intros locals
induction locals as | x slot locals IH ; simpl ; intros m m′ H
2 openfocused goal
–injection H as ←
2 opendeferred goal
auto
deferred goal
–destruct slot as base | ; | exact IH_ _ H
destruct object_regionbase m_regionsm as reg | eqn: Er ; | rewrite fold_left_none in H ; discriminate H
destruct r_kindreg , r_lifereg ; simpl in H ; try rewrite fold_left_none in H ; discriminate H
destruct replace_regionbase _ m_regionsm as rs | eqn: Ers ; | rewrite fold_left_none in H ; discriminate H
exact IH_ _ H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
This additive boundary changes neither machine nor runtime.
One authoritative shutdown inventory accompanies arbitrary libc state. Callback effects update this very world; return never restores a registration-time snapshot.
Entry is checked at the current post-pop memory/runtime/world. The physical pop/mark and its effects remain ExitMemory's separate boundary; this relation does not claim them from a decoded slot alone. No run, successful callback or return is hidden inside admission.
Successful return reconstructs the memory that Semantics computed but did not retain in Done. It keeps the CURRENT libc payload, status, pending list, consumed history, output state, runtime and fuel. Other terminals, including an already completed ExternalExit, do not resume.
The endpoint exposes the very same m_return needed by the handler's Iris return postcondition, not merely an existential outcome state.
Explore proof 5 tactics
Initial goal
intros entry st ms′ w′ H
destruct H
exists c, s, data, mkShutdownInCallbackentry status pending consumed q, m_return
repeat split ; auto
constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Readiness and object persistence along ordinary labelled callback prefixes; this makes no return, termination or failure-freedom claim.
Explore proof 7 tactics
Initial goal
intros registry ge st trace st′ Hfree H
induction H ; intros Hr
2 openfocused goal
–split ; exact Hr | apply persists_refl
deferred goal
–pose proof M.step_ready_ _ _ _ _ _ Hfree H Hr as Hr1
destruct IHrunHr1 as Hr′ Hp
split ; exact Hr′ |
eapply persists_trans ; eapply M.step_persists ; eauto | exact Hp
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A return remains ready and retains every identity after invalidating locals; exact byte/aux preservation is stronger than mere keptness.
Explore proof 10 tactics
Initial goal
intros entry st ms′ w′ H
destruct H as c s data status pending consumed q m_return Hcallers Hunique Htoken Hlocals
simpl
intros Hr
pose proof invalidate_locals_kept_ _ _ Hlocals as Hkept
split ; eapply R.ready_kept ; eauto |
split
2 openfocused goal
–eapply kept_ids_persists ; exact Hkept |
2 opendeferred goal
eapply invalidate_locals_ids ; eauto
deferred goal
–eapply callback_locals_contents ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Existing stopped outcomes cannot silently become returned callbacks.
Explore proof 3 tactics
Initial goal
intros
inversion H
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A completed ordinary run followed by local teardown preserves readiness and every starting identity, with no reset of the runtime or fuel.
Explore proof 5 tactics
Initial goal
intros registry ge start trace stopped entry ms′ w′ Hfree Hrun Hreturn Hr
destruct callback_prefix_preserve_ _ _ _ _ Hfree Hrun Hr as Hr1 Hp1
destruct callback_return_preserve_ _ _ _ Hreturn Hr1 as Hr2 & Hp2 & _
split ; exact Hr2 |
eapply persists_trans ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Consumers accept an existing callback bridge and its exact machine inductives, rather than instantiate a generatively distinct machine.
Independent execution controls, not native exit-registry memory.
Adversarial core code makes a local escape into a global, calls another ordinary function, then returns. It deliberately uses an A word as P: it is NOT claimed to pass checking or callback admission. Finalization must still invalidate its locals, not restore a live pre-return snapshot. Checked code selection is exercised separately.
A genuine nested call, with its own enter and return steps. Its harmless null-pointer flight makes the separate module checked-stage.
The handwritten symbol map supplies callable addresses and a writable global cell. Checking code is separate from that memory image.
All three bindings are deliberately independent of the allocator.
The writable global cell initially stores canonical null.
Registration instances, not callback names, determine consumption.
The current world already contains a consumed active token and an older pending handler. Payload and signed status must survive return.
Entry retains the shared memory and an explicit finite fuel budget.
The actual allocation and pointer-store endpoint, before return.
Parent entry and helper entry each consumed one unit of fuel.
This independently named memory is NOT the stopped observation snapshot.
A separately checked handler makes address rejection nonvacuous.
Cxa's unused extras go through generic conversion before call_frame in a separately checked module; they do not add parameters to the public void(void) handler. The adversarial escape code is excluded.
Explore proof 5 tactics
Initial goal
intros status
split ; reflexivity |
split ; vm_compute ; auto |
exists TAtom"helper", mkPtr1040 FnTAtom"helper", escape_helper, [ ]
repeat split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The adversarial entry-to-return core run really allocates the local and stores its pointer. No opaque callback-success action is used; no validation or native reachability is claimed for this control.
Proof 9 steps Qed
Normalize each endpoint, but keep symbolic byte/aux functions folded.
The escaped identity is live in the stopped snapshot, freed at the reconstructed endpoint, and still present in the global's aux slot.
Explore proof 1 tactics
Initial goal
repeat split ; try reflexivity ; simpl ; lia
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Normal finalization resumes Handlers with the current pending list, status, payload, consumed token and remaining fuel, not the entry frame.
Explore proof 4 tactics
Initial goal
constructor ; reflexivity | | left ; reflexivity | reflexivity
unfold shutdown_unique
simpl
repeat constructor ; simpl ; intuition discriminate
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Correct Fn authority with a wrong callable address cannot be admitted.
Explore proof 4 tactics
Initial goal
split ; reflexivity |
intros fr _ & _ & symbol & function & f & converted & Htarget & _ & Hcheck & _
injection Htarget as ← ←
discriminate Hcheck
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Native flavor order and signed status differ from the host wait byte.
Explore proof 1 tactics
Initial goal
repeat split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Already completed external exits and fuel/resource endings do not acquire a normal callback return edge.
Explore proof 2 tactics
Initial goal
intros
split ; intro H ; inversion H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.