rocq/theories/LibcExit.v
Hard exit as a trusted nonreturning external-call summary over the consumer's exact machine. This does not replace Ending's request interceptor or execute its soft-exit loop. Host completion remains independent of the request; no callback or stdout obligation is silently settled by _exit.
Canonical C int bits, before signed shutdown status and low-byte host status are distinguished.
A hard request changes only the shutdown phase/status. Payload, registrations, consumed history and stdout all retain their identity.
Readiness alone does not exclude an already completed handoff.
Finite prefixes may be before the request, after the request but blocked in the host, or host-completed. Only the last emits exit. Observable termination leaves no mutable caller-memory continuation.
A completed host exit is not a synthetic ordinary void return.
The host witness is trusted behind this contract, not assumed to exist for each admitted call. No allocation or resource leaf is added.
Only the two hard-exit aliases are summarized here. Soft exit stays with the explicit lifecycle, callback execution and cleanup boundary.
Admission needs no host-completion promise.
Explore proof 4 tactics
Initial goal
intros
split ; exact H |
exists bits
auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
All invocation and step facts use the supplied machine's inductives.
An admitted call has an unchanged unfinished prefix even with a false host witness. There is no completion/progress theorem here.
Explore proof 6 tactics
Initial goal
intros
split ; constructor |
split ; reflexivity |
split ; reflexivity |
left
auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The explicit request cutpoint also needs no host completion.
Explore proof 9 tactics
Initial goal
intros
split ; constructor |
split ; reflexivity |
split ; reflexivity |
right
exists bits
split ; exact H |
left
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Construct a completed invocation only from an independent endpoint host witness; arguments and phase admission are checked separately.
Explore proof 22 tactics
Initial goal
intros rep host r args xs bits s m w w′ Habi Hpre Hend Hhost
eapply E.invoke_normal with born := [ ]
7 openfocused goal
focused goal
focused goal
focused goal
focused goal
focused goal
–exact Habi
6 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact Hpre
5 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–split ; constructor |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split ; reflexivity |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split ; reflexivity |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
right
5 opendeferred goal
deferred goal
deferred goal
deferred goal
exists bits
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split ; exact Hend |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
right
5 opendeferred goal
deferred goal
deferred goal
deferred goal
auto
4 opendeferred goal
deferred goal
deferred goal
deferred goal
–exists bits
4 opendeferred goal
deferred goal
deferred goal
auto
3 opendeferred goal
deferred goal
deferred goal
–intros why Hbad
3 opendeferred goal
deferred goal
discriminate
2 opendeferred goal
deferred goal
–intros values Hbad
2 opendeferred goal
discriminate
deferred goal
–intros status Hstatus
injection Hstatus as ←
exists [ ]
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
No normal or resource rule can produce an ordinary return.
Explore proof 3 tactics
Initial goal
intros rep host r args xs s m w trace values s′ m′ w′ Hcall
inversion Hcall ; subst
match goal withHpost : contract_post_ _ _ _ _ _ _ _ _ |- _⇒destruct Hpost as bits & _ & _ & Hbad & _ ; discriminate Hbadend
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
An actual completed call supplies the exact current snapshot and the global request relation used by Ending, not a sibling invoke.
Explore proof 8 tactics
Initial goal
intros rep host r args xs s m w trace ending s′ m′ w′ Hcall
destruct Hcall as trace ending s′ m′ w′ born Habi Hpre He Hp Hpost Hresource Hvalues Hexit | why trace s′ m′ w′ born Habi Hpre Hp Hfailure Hresource ; | contradiction
destruct Hp as Hborn Hm _
subst born m′
split
2 openfocused goal
–clear - He
2 opendeferred goal
induction He ; reflexivity | exact IHHe | contradiction
deferred goal
–split ; reflexivity | exact Hpost
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Ordinary-machine dispatch preserves external-site precedence and terminates in this very machine. Ending separately intercepts these symbols; relating its host/representation predicates is a further compatibility obligation, not an automatic executor equivalence.
Explore proof 2 tactics
Initial goal
intros
eapply M.step_exit ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Controls distinguish full signed shutdown status from the host byte, and requests from completed termination.
Explore proof 6 tactics
Initial goal
split ; split ; reflexivity | lia |
split ; reflexivity |
change exit_requestHardExit −257 sndbefore sndafter
apply request_hard
intros kind
discriminate
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
vm_compute
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Pending callbacks, consumed history and outstanding bytes survive; no hard-exit summary pretends to run callbacks or flush.
Explore proof 1 tactics
Initial goal
repeat split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
eapply X.hard_exit_requested
2 openshelved goal
exact signed_status_endpoint
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 3 tactics
Initial goal
intros rep r args xs s m w trace ending s′ m′ w′ Hcall
destruct X.hard_exit_exact_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as _ & _ & bits & _ & _ & _ & Hfalse
exact Hfalse
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 3 tactics
Initial goal
intros rep m _ & bits & _ & Hphase
apply HphaseHardExit
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.