rocq/theories/Ending.v
Exit requests precede terminal external dispatch. This additive bridge shares Linked's current payload and authoritative shutdown inventory. Native registration, administrative effects and host completion remain explicit trusted obligations; no native coverage or termination follows.
Only these unresolved direct symbols are plain exit requests. An already stopped ExternalExit is never decoded as another request.
A C int argument has W class and a nonreturning void call site.
Initial and nested soft requests retain the CURRENT inventory and stdout. Initial application execution uses Tls as its dormant phase. No soft request reopens closed cleanup. Hard exit never flushes.
Requests preserve all registration instances and output obligations.
Explore proof 2 tactics
Initial goal
intros kind status sh sh′ H
destruct H ; repeat split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Uniqueness survives recursive and hard exit without a new inventory.
Explore proof 2 tactics
Initial goal
intros kind status sh sh′ H
destruct H ; auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Successful registration is permitted before exit or inside a callback, never after cleanup. Tokens are fresh even for repeated function names.
Registration does not alter the active status, consumed history or stdout.
Explore proof 2 tactics
Initial goal
intros entry sh sh′ H Hu
destruct H ; unfold shutdown_unique in * ; simpl in * ; apply shutdown_unique_insert ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
This pin implements atexit with a cxa slot, null argument and null DSO. Physical representation and callback semantic admission are independent.
Even resource/unfinished prefixes retain the current inventory or add exactly one freshly installed instance. Reserved physical slots do not yet add a logical callback. No completion result is asserted here.
The native contract supplies effects, allocation and private registry authority. This overlay supplies the exact public API and couples its successful result to physical installation and the single inventory. Callback admission must be supplied independently at entry.
Only administrative actions may be delegated wholesale. Callback pop, execution and return use the separate, memory-backed rules below.
Requests and callbacks extend the labelled machine, never Machine.v.
One payload and one authoritative lifecycle, as in Linked.
Running application/callback code, a suspended exit loop, and completed host termination retain exact machine snapshots. Stopped remains stopped.
| | | Executing | ||
| | | Draining | ||
| | | Partial | ||
| | | Finished |
Every mode retains its exact machine snapshot, including partial leaves.
Readiness does not assert contract admission, progress or native coverage.
Administrative libc effects use the existing capability/effects boundary. Readiness/representation at both endpoints is an explicit obligation, not a native satisfaction theorem. A synthetic CallReturn marks a completed internal cutpoint, not a native return from host handoff. registry_rep identifies the authoritative physical chain in the payload; use this same projection as atexit_contract's represented argument.
| ending_rep | ||
| registry_rep | : mem → payload → ptr → listexit_block → Prop | |
| registry_owned | : payload → listZ | |
| action_spec | ||
| action_args | : shutdown_action → listarg | |
| action_values | : shutdown_action → listword | |
| host_complete |
The selected request syntax, evaluated independently of any invocation.
Admission is independent of successful execution. Reached-call proofs must establish it again after safepoints; its failure is visible below.
A single dispatcher: reserved names (e.g. error) are handled by a further explicit bridge, not ordinary terminal external dispatch. Safepoints at intercepted calls still run and recheck admission later.
Entry uses the actual post-pop memory, not a second chosen snapshot.
Explore proof 2 tactics
Initial goal
intros admitted ge slot entry s m w fuel callback _ & _ & _ & _ & _ & _ & fr & _ & →
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Every new edge preserves readiness and identities by its existing effect path or local teardown. This is structural preservation, not safety.
Proof 23 steps Qed
Finite prefixes need not finish a handler or reach host completion.
Finite execution retains readiness and every starting identity.
Explore proof 7 tactics
Initial goal
intros registry ge reserved b admitted st trace st′ Hfree H
induction H ; intros Hr
2 openfocused goal
–split ; auto using persists_refl
deferred goal
–destruct step_preserve_ _ _ _ _ _ _ _ Hfree H Hr as Hr1 Hp1
destruct IHrunHr1 as Hr′ Hp2
split ; exact Hr′ |
eapply persists_trans ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A request is silent and never takes the caller's ordinary continuation.
Explore proof 2 tactics
Initial goal
intros
eapply ending_request ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Partial cutpoints cannot resume shutdown or inherit a completed action.
Explore proof 2 tactics
Initial goal
intros registry ge reserved b admitted ms w trace st′ H
inversion H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Completed external exits cannot resume a callback or request shutdown.
Explore proof 4 tactics
Initial goal
intros registry ge reserved b admitted status ms w trace st′ H
inversion H ; subst
2 openfocused goal
–eapply M.stopped_no_step ; eauto
deferred goal
–match goal withHreturn : L.callback_return_ _ _ _ _ |- _⇒apply L.callback_return_only_void in Hreturn ; discriminateend
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
abort is deliberately not mapped to soft exit. A whole-program safety proof must exclude every reached abort call or provide another boundary.
Explore proof 1 tactics
Initial goal
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Signed status replacement retains partially outstanding output.
Explore proof 2 tactics
Initial goal
intros
constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Neither cleanup nor an already completed handoff can restart soft exit.
Explore proof 2 tactics
Initial goal
intros
split ; intro H ; inversion H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.