rocq/theories/ExternalMachine.v
Campaign 4's guarded, labelled extension of Machine.v (milestone 2): a machine whose steps carry the external call events of ExternalCalls.v.
Existing machine steps are silent and unchanged. A direct call of an unresolved, non-data name other than free can invoke a registered contract, only in a frame that is not doomed. A completed call carries its observations and exact runtime/memory/world snapshot.
Contract violations are specification failures, NOT native traps. Coverage and caller admissibility are checked independently of an invocation's existence. Admissible contracts may still have no completed invocation: native coverage, blocking/divergence and independent external prefixes remain obligations, not safety claims. This extension is relational; the extracted driver is unchanged.
Dispatch and the return channel
A direct call about to run: its block label, the call's result (where the returned words go), the called global's name, the argument syntax, and the instructions and jump that follow it in the block.
In the global environment ge, the configuration c is at the external call site: its frame is not doomed, its next instruction is a direct call of site's global name, and that name is neither a function of the module (defined or outside the core subset, find_fn), nor global data, nor free. This preserves core dispatch precedence: free remains the runtime's operation. In particular a doomed call cannot use this rule to escape Ahead.
Words of the declared return_shape always make an outcome.
Explore proof 10 tactics
Initial goal
intros ty xs H
destruct ty ; simpl in H
3 openfocused goal
focused goal
–destruct H as x & → & _
3 opendeferred goal
deferred goal
eexists
4 opendeferred goal
deferred goal
reflexivity
2 opendeferred goal
deferred goal
–subst xs
2 opendeferred goal
eexists
3 opendeferred goal
shelved goal
reflexivity
deferred goal
–eexists
2 openreflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The caller's environment e with the words xs a call of the contract spec returned bound as the site's result reads them (returned_env, as call_outcome_result/5); none if the declared return channel and the site's result do not fit.
The configuration after an external call returns: the same function, locals, callers and fuel, with environment e and memory m, at the instruction after the call.
How a call site fails its contract: no contract is registered for the name, an argument does not evaluate, the ABI or the precondition does not hold, or the returned words do not fit the call's result. These are specification failures, not Fil-C traps.
| | | MissingContract | ||
| | | BadArguments | ||
| | | BadABI | ||
| | | BadPrecondition | ||
| | | BadReturn |
Why the labelled machine stopped: a core outcome, a stuck core step with its diagnostic, a process exit with its status from an external call, or a contract violation at the call of symbol.
At an external_site, the core Semantics.step is stuck on the instruction, so no core continuation or allocation can compete with contract dispatch. Runtime safepoints (poll) remain.
Explore proof 9 tactics
Initial goal
intros ge c site Hd & Ha & Hfn & Hdata & Hfree
unfold Semantics.step
rewrite Ha , Hd
unfold inst_step
destruct map_optionarg_xge fr_envc_framec site_argssite ; | reflexivity
rewrite Hfn
unfold external_call
rewrite Hdata , Hfree
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The labelled machine
The labelled machine over any runtime R, with the call relations (E), the evidence invariant (P) and the single definition invariant (S) instantiated at R.
A core machine step (mstep) is also a step of the copy of the machine inside the single-definition functor. The two invariant functors instantiate the same core machine, but its inductive relation is generative; copy only its constructors.
Explore proof 2 tactics
Initial goal
intros ge ms ms′ H
destruct H ; eapply S.ID.RM.mstep_next | eapply S.ID.RM.mstep_alloc | eapply S.ID.RM.mstep_safepoint ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
At an external_site, the only core machine step is a safepoint (poll): it is due there, the runtime acts on memory, and the call point stays in place. A contract's precondition is then checked in the post-safepoint state.
Explore proof 4 tactics
Initial goal
intros ge c s c′ s′ site Hsite H
pose proof external_site_stuck_ _ _ Hsite as Hstuck
inversion H ; subst ; try congruence
eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Everything below is over one type world of logical libc state, shared by all registered contracts.
A labelled machine state: a core machine state (configuration and runtime state) and the world, either running or stopped with an ending.
| | | Running | ||
| | | Stopped |
The core machine state inside st.
The call at site is admissible under the registry (each name's contract, if any) in configuration c and world w: a contract is registered, the arguments evaluate to words xs, and the ABI and the precondition hold. These obligations are at the call site, not conditional on there being an invoke derivation. Negating pre does not grant a libc trap.
Why the call at site is rejected, checked in order: no registered contract, an argument that does not evaluate, a false ABI premise, or a false precondition. Each is the violation of the same name; a bad return is caught after the call, by step_bad_return.
One labelled step under the registry, with its events:
- a core machine step (
mstep), silent; - a core terminal, stuck step or allocation refusal, where no external call is due, stopping with the configuration as it was;
- a completed call at an
external_site: a return resumes at the next instruction with the call's memory, runtime state and world (resume_external), an exit or resource ending stops with them; - a
rejectedcall, or a return the site's result cannot take, stopping with aContractViolation.
Core terminals retain an observation snapshot. Done contains no final memory: e.g. a top-level return discards its invalidated locals.
No running state reached from start can step to a ContractViolation. Safety against specification failures is about EVERY reached state, not merely the ending a chosen path happens to take. A safepoint that later repairs pre cannot erase an earlier rejection.
Where there is no_violation from start, no external call reached from it is rejected.
Explore proof 2 tactics
Initial goal
intros registry ge start prefix c s w site why Hsafe Hrun Hsite Hbad
exact Hsafe_ _ _ _ _ _ _ _ Hrun step_rejected_ _ _ _ _ _ _ Hsite Hbad
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A stopped state does not step.
Explore proof 2 tactics
Initial goal
intros registry ge why ms w trace st H
inversion H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Where no external call is due, a step observes nothing.
Explore proof 2 tactics
Initial goal
intros registry ge c s w trace st Hnone H
inversion H ; subst ; try reflexivity ; exfalso ; eapply Hnone ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
intros registry ge c s w trace ms′ w′ why H
inversion H ; subst ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
An admissible call is not rejected.
Explore proof 2 tactics
Initial goal
intros registry ge c w site why spec & xs & Hr & Hx & Ha & Hp H
destruct H ; try congruence
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 3 tactics
Initial goal
intros registry ge st trace st′ Hfree H
destruct H ; simpl ; intros Hr ; try exact Hr ; try solve eapply mstep_ready ; eauto
4 openfocused goal
focused goal
focused goal
all: exact proj1E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ H2 Hr
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
From a ready state, every object of the memory before a labelled step persists into the memory after it.
Explore proof 4 tactics
Initial goal
intros registry ge st trace st′ Hfree H
destruct H ; simpl ; intros Hr ; try apply persists_refl
5 openfocused goal
focused goal
focused goal
focused goal
1: exact S.ID.mstep_persists_ _ _ Hfree Hr single_core_step_ _ _ H
4 openfocused goal
focused goal
focused goal
all: exact proj2E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ H2 Hr
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Continuations and Campaign 3
Resuming after an external call keeps the evidence invariant inv of a module md: the call kills the frame's live facts, so the frame is parked there (call_parked) and resumes with any result and memory (parked_resume).
Explore proof 3 tactics
Initial goal
intros ge md c s site e m′ s′ Hd & Ha & _ Hfr Hcs
split ; | exact Hcs
exact parked_resumege md m′ mkFramefr_fnc_framec fr_envc_framec fr_localsc_framec None Execsite_labelsite site_restsite site_jumpsite e call_parked_ _ _ _ _ _ _ _ _ _ Hfr Hd Ha
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Binding a call's returned values changes no temporary a but the names the site's result defines (result_names).
Explore proof 4 tactics
Initial goal
intros spec site values old e a H Ha
unfold external_env in H
destruct external_outcome_ _ as o | ; | discriminate H
exact returned_env_other_ _ _ _ _ H Ha
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Resuming after an external call keeps the single definition invariant sinv of a checked_module md, where the call's memory m' persists from the old: the result names are its only new definitions, and waiting callers keep their scopes.
Explore proof 26 tactics
Initial goal
intros ge md c site spec values e m′ Hmd Hd & Ha & _ He Hp Hsh Hsc Hcs
destruct Hsc as Hdoom | Hsc ; contradiction |
unfold shaped in Hsh
cbv zeta in Hsh
rewrite Ha in Hsh
destruct Hsh as Hin & Hr & b & k & Hb & Hk & Hsk & Hj
destruct skipn_cons_ _ _ _ _ eq_symHsk as Hki & Hrest & Hlen
assert Hpt0 : point_sitefr_fnc_framec fr_atc_framec = Somesite_labelsite, Z.of_natk by rewrite Ha , Hsk ; exact point_site_exec_ _ _ _ _ Hb Hk
assert Hpt1 : point_sitefr_fnc_framec Execsite_labelsite site_restsite site_jumpsite = Somesite_labelsite, Z.of_natSk by rewrite <- Hrest ; exact point_site_exec_ _ _ _ _ Hb Hlen
split ; | exact callers_mem_ _ _ _ _ Hcs Hp
split
2 openfocused goal
–unfold shaped
2 opendeferred goal
cbv zeta
2 opendeferred goal
simpl
2 opendeferred goal
split ; exact Hin |
2 opendeferred goal
split ; exact Hr |
2 opendeferred goal
exists b, Sk
2 opendeferred goal
split ; exact Hb |
2 opendeferred goal
split ; exact Hlen |
2 opendeferred goal
split ; symmetry ; exact Hrest | exact Hj
deferred goal
–right
refine scope_step_ _ c_framec c_frameresume_externalc site e m′ _ _ _ _ _ Callsite_resultsite Globalsite_namesite site_argssite Hmd Hin eq_refl Hr Hb Hki Hpt0 Hpt1 _ Hp _ Hsc
2 openfocused goal
+rewrite call_defs
2 opendeferred goal
exact λa Hn ⇒ external_env_other_ _ _ _ _ _ He Hn
deferred goal
+intros n Hrp
discriminate Hrp
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The single definition invariant sinv of a running state's configuration; nothing of a stopped one.
A labelled step from a ready state keeps evidence_inv of the environment's checked_module md.
Explore proof 4 tactics
Initial goal
intros registry ge md st trace st′ Hge Hmd H
destruct H ; simpl ; intros Hr Hi ; try exact I
2 openfocused goal
–eapply P.mstep_inv ; eauto
deferred goal
–eapply resume_inv ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A labelled step from a ready state keeps single_inv of the environment's checked_module md, where its free is the runtime's.
Explore proof 5 tactics
Initial goal
intros registry ge md st trace st′ Hge Hmd Hfree H
destruct H ; simpl ; intros Hr Hi ; try exact I
2 openfocused goal
–exact S.mstep_sinv_ _ _ _ Hge Hmd Hfree Hr single_core_step_ _ _ H Hi
deferred goal
–eapply resume_sinv ; eauto
exact proj2E.invoke_preserve_ _ _ _ _ _ _ _ _ _ _ _ _ H2 Hr
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The four structural guarantees for every finite labelled run of a checked_module md, from a state that has them: the runtime stays ready, objects persist, and evidence_inv and single_inv hold at the end. No completeness or absence of contract violations follows from them.
Explore proof 10 tactics
Initial goal
intros registry ge md st trace st′ Hge Hmd Hfree H
induction H ; intros Hr Hi Hs
2 openfocused goal
–split ; exact Hr |
2 opendeferred goal
split ; apply persists_refl | auto
deferred goal
–pose proof step_ready_ _ _ _ _ Hfree H Hr as Hr1
pose proof step_inv_ _ _ _ _ _ Hge Hmd H Hr Hi as Hi1
pose proof step_sinv_ _ _ _ _ _ Hge Hmd Hfree H Hr Hs as Hs1
destruct IHrunHr1 Hi1 Hs1 as Hr′ & Hp & Hi′ & Hs′
split ; exact Hr′ |
split ; eapply persists_trans ; eapply step_persists ; eauto | exact Hp | auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Public transition regressions
These are abstract contract fixtures, not native libc instances. The argument is genuinely evaluated from a temporary; the separate caller, local object, remaining instruction and fuel expose accidental whole-frame replacement or return-from-the-caller behavior.
The regressions, over the interpreter's runtime.
The temporary holding the call's argument.
The temporary a scalar or tuple result binds.
The one block's label.
The called name, unresolved in the test module.
The call's one argument: the temporary input as a pointer.
The instruction after the call, a source location.
A main of one block: the call with result r, then rest, then return.
The environment at the call: input is hello_ptr, and an unrelated temporary keep must survive the call.
One local object, at 3072.
A separate waiting caller frame.
The call stack: test_caller, waiting for a void result.
The call_site of test_config r.
A global environment with no functions or data, so symbol is unresolved.
A registry giving every name the contract spec.
The test configuration is at an external_site, whatever the call's result.
Explore proof 2 tactics
Initial goal
intros r
repeat split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The call of puts on hello from the test site completes like hello_return, for a void or word result.
Explore proof 33 tactics
Initial goal
intros r n accepted tail Hr Hb Hn
eapply M.E.invoke_normal with born := [ ]
7 openfocused goal
focused goal
focused goal
focused goal
focused goal
focused goal
–split ; exact Hr |
7 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
exists Tmparg_name
7 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
reflexivity
6 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact hello_pre
5 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–split ; constructor |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split ; split ; reflexivity |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split ; exact hello_stdio |
5 opendeferred goal
deferred goal
deferred goal
deferred goal
split
6 openfocused goal
deferred goal
deferred goal
deferred goal
deferred goal
+apply stdio_delegates_refl ; reflexivity | exact proj2hello_stdio
5 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
+right
5 opendeferred goal
deferred goal
deferred goal
deferred goal
exists hello_ptr, hello_bytes, accepted, tail
5 opendeferred goal
deferred goal
deferred goal
deferred goal
repeat split ; auto using hello_string
4 opendeferred goal
deferred goal
deferred goal
deferred goal
–exists hello_ptr, hello_bytes, accepted, tail, n
4 opendeferred goal
deferred goal
deferred goal
split ; reflexivity |
4 opendeferred goal
deferred goal
deferred goal
split ; exact hello_string |
4 opendeferred goal
deferred goal
deferred goal
split ; exact Hb |
4 opendeferred goal
deferred goal
deferred goal
split
5 openfocused goal
deferred goal
deferred goal
deferred goal
+destruct Hn as Ht → | → ; left ; split ; exact Ht | change 0 ≤ 0 < 2147483648 ; lia | right ; reflexivity
4 opendeferred goal
deferred goal
deferred goal
deferred goal
+split ; reflexivity |
4 opendeferred goal
deferred goal
deferred goal
split ; reflexivity | exact hello_stdio
3 opendeferred goal
deferred goal
deferred goal
–intros why H
3 opendeferred goal
deferred goal
discriminate H
2 opendeferred goal
deferred goal
–intros values H
2 opendeferred goal
injection H as ←
2 opendeferred goal
split
3 openfocused goal
deferred goal
+exists WIntn
3 opendeferred goal
deferred goal
split ; reflexivity |
3 opendeferred goal
deferred goal
destruct Hn as _ → | → ; reflexivity
2 opendeferred goal
deferred goal
+constructor ; exact I | constructor
deferred goal
–intros status H
discriminate H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A successful puts step emits its one event and resumes the same frame at rest with answer bound to 0, the same locals, callers, memory and fuel.
Explore proof 2 tactics
Initial goal
eapply M.step_return with site := test_siteCResultresult_name W values := WInt0 ; apply test_external | reflexivity | reflexivity | | reflexivity
apply puts_invocation_ _ _ [ ] ; right ; eexists ; reflexivity | reflexivity | left ; auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A partial EOF puts with a discarded result also resumes, with the environment unchanged.
Explore proof 2 tactics
Initial goal
eapply M.step_return with site := test_siteCVoid values := WInt2 ^ 32 − 1 ; apply test_external | reflexivity | reflexivity | | reflexivity
apply puts_invocation_ _ _ 108; 108; 111; 10 ; left ; reflexivity | reflexivity | right ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A contract with return type ty whose ABI premise, precondition and postcondition are the given propositions abi, pre and behavior, which may write only stdout_span, requests no allocation and accepts any prefix. Such deliberately independent propositions expose rejection even when no behavior exists.
An always-true test contract may return, changing nothing, any values of its return_shape whose capabilities need no source or born object (word_authority).
Explore proof 6 tactics
Initial goal
intros ty r values Hshape Hauth
eapply M.E.invoke_normal with born := [ ] ; try exact I ; try intros x H ; discriminate H
2 openfocused goal
–split ; constructor | exact I
deferred goal
–intros xs H
injection H as ←
auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Such a return is a silent machine step to resume_external with the environment external_env gives.
Explore proof 2 tactics
Initial goal
intros ty r values e Hs Ha He
eapply M.step_return with site := test_siter values := values ; apply test_external | reflexivity | reflexivity | exact test_returnty r values Hs Ha | exact He
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Void, empty-tuple and one-element-tuple returns each use their own channel.
Explore proof 3 tactics
Initial goal
split ; eapply return_channel with values := [ ] ; repeat constructor |
split ; eapply return_channel with values := [ ] ; repeat constructor |
eapply return_channel with values := WInt7 ; repeat constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A call with no registered contract stops with MissingContract.
Explore proof 1 tactics
Initial goal
eapply M.step_rejected with site := test_siteCVoid ; apply test_external | constructor ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A false precondition is rejected even when the contract has no behavior at all.
Explore proof 2 tactics
Initial goal
eapply M.step_rejected with site := test_siteCVoid ; apply test_external |
eapply M.reject_pre ; reflexivity | reflexivity | exact I | exact λH ⇒ H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A call can be admissible yet have no completed invocation: admissibility does not promise behavior.
Explore proof 3 tactics
Initial goal
split ; eexists ; eexists ; repeat split ; reflexivity || exact I |
intros trace & result & s′ & m′ & w′ & H
inversion H ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A one-word tuple returned to a scalar result stops with BadReturn, keeping the call's memory.
Explore proof 15 tactics
Initial goal
eapply M.step_bad_return with site := test_siteCResultresult_name W values := WInt7 ; apply test_external | reflexivity | reflexivity | | reflexivity
eapply M.E.invoke_normal with born := [ ] ; try exact I ; try intros x H ; discriminate H
2 openfocused goal
–split ; | exact I
2 opendeferred goal
eapply M.E.effects_local ; apply local_store_bytes | constructor
2 opendeferred goal
intros b Hb
2 opendeferred goal
left
2 opendeferred goal
exists stdout_span
2 opendeferred goal
split ; left ; reflexivity |
2 opendeferred goal
split ; exact Forall_invproj2hello_stdio |
2 opendeferred goal
unfold span_contains
2 opendeferred goal
simpl
2 opendeferred goal
lia
deferred goal
–intros values H
injection H as ←
split ; repeat constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A two-word tuple binds both names, and a void result discards it.
Explore proof 1 tactics
Initial goal
split ; eapply return_channel with values := WInt3; WInt11 ; repeat constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A false ABI premise is rejected as BadABI, without behavior.
Explore proof 2 tactics
Initial goal
eapply M.step_rejected with site := test_siteCVoid ; apply test_external |
eapply M.reject_abi ; reflexivity | reflexivity | exact λH ⇒ H
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The test configuration with an empty environment, so the argument input has no value.
An argument that does not evaluate is rejected as BadArguments.
Explore proof 2 tactics
Initial goal
eapply M.step_rejected with site := test_siteCVoid ; repeat split ; reflexivity |
eapply M.reject_arguments ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Even at a call that would be rejected, the core machine may take a safepoint (poll) step first.
Explore proof 3 tactics
Initial goal
apply M.step_core
change M.P.I.RM.msteptest_ge test_configCVoid, InterpRuntime.start M.P.I.RM.with_memtest_configCVoid hello_mem, InterpRuntime.start
eapply M.P.I.RM.mstep_safepoint ; reflexivity | split ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The test configuration with its frame doomed to trap out of bounds.
Explore proof 1 tactics
Initial goal
apply M.step_core_end ; intros site Hd & _ ; discriminate Hd | reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A defined function named puts.
An environment where puts is that defined function.
An environment where puts is a function outside the core subset.
An environment where puts is global data.
The test frame about to call free.
Calls of a defined, outside or data name, and of free, stay core calls: every step there is silent.
Explore proof 1 tactics
Initial goal
intros trace st H | H | H | H ; eapply M.non_external_silent ; try exact H ; intros site Hsite ; pose proof external_site_stuck_ _ _ Hsite as Hstuck ; discriminate Hstuck
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A puts whose allocation is refused stops as OutOfMemory with its event and its write to the libc state retained.
Explore proof 28 tactics
Initial goal
eapply M.step_resource with site := test_siteCVoid ; apply test_external | reflexivity | reflexivity |
eapply M.E.invoke_resource with born := [ ]
5 openfocused goal
focused goal
focused goal
–split ; left ; reflexivity |
5 opendeferred goal
deferred goal
deferred goal
exists Tmparg_name
5 opendeferred goal
deferred goal
deferred goal
reflexivity
4 opendeferred goal
deferred goal
deferred goal
–exact hello_pre
3 opendeferred goal
deferred goal
–split
4 openfocused goal
deferred goal
+eapply M.E.effects_local ; apply local_store_bytes | constructor
4 opendeferred goal
deferred goal
intros b Hb
4 opendeferred goal
deferred goal
left
4 opendeferred goal
deferred goal
exists stdout_span
4 opendeferred goal
deferred goal
split ; left ; reflexivity |
4 opendeferred goal
deferred goal
split ; exact Forall_invproj2hello_stdio |
4 opendeferred goal
deferred goal
unfold span_contains
4 opendeferred goal
deferred goal
simpl
4 opendeferred goal
deferred goal
lia
3 opendeferred goal
deferred goal
+split ; split ; reflexivity |
3 opendeferred goal
split ; exact hello_stdio |
3 opendeferred goal
split
4 openfocused goal
deferred goal
∗apply stdio_delegates_refl ; reflexivity | exact proj2hello_stdio
3 opendeferred goal
deferred goal
∗right
3 opendeferred goal
exists hello_ptr, hello_bytes, 104, 101; 108; 108; 111; 10
3 opendeferred goal
split ; reflexivity |
3 opendeferred goal
split ; exact hello_string |
3 opendeferred goal
split ; reflexivity
2 opendeferred goal
–eapply M.E.failure_oom with align := 16 size := 32 ; split ; reflexivity | unfold max_allocation_size ; simpl ; lia | reflexivity
–left
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
An exiting call's trace already ends in its ProcessExit; the step adds no second one.
Explore proof 7 tactics
Initial goal
eapply M.step_exit with site := test_siteCVoid ; apply test_external | reflexivity | reflexivity |
eapply M.E.invoke_normal with born := [ ] ; try exact I ; try intros x H ; discriminate H
2 openfocused goal
–split ; constructor | exact I
deferred goal
–intros status H
injection H as ←
exists StreamBytes1 65
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A top-level test frame at point pt with the given fuel and no callers.
A top-level return and running out of fuel stop with the core's outcome.
Explore proof 1 tactics
Initial goal
split ; apply M.step_core_end ; try reflexivity ; intros site H ; pose proof external_site_stuck_ _ _ H as Hs ; discriminate Hs
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A local allocation the runtime refuses stops as OutOfMemory.
Explore proof 2 tactics
Initial goal
cbv zeta
eapply M.step_core_refusal ; intros site H ; pose proof external_site_stuck_ _ _ H as Hs ; discriminate Hs | reflexivity | simpl ; lia | reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A call of a function outside the core subset stops stuck.
Explore proof 1 tactics
Initial goal
apply M.step_core_stuck ; intros site H ; pose proof external_site_stuck_ _ _ H as Hs ; discriminate Hs | reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A main that calls puts twice in a row.
double_fn's frame at its first call.
The first call, followed by the second.
The second call, the block's last instruction.
The configuration after the first call returns.
A run of the two calls observes the first call's event, then the second's.
Explore proof 7 tactics
Initial goal
eapply M.run_cons with trace := StreamBytes1 hello_bytes ++ 10 tail := StreamBytes1 104 mid := M.Runningafter_first, InterpRuntime.start hello_world
2 open–eapply M.step_return with site := first_site values := WInt0 ; repeat split ; reflexivity | reflexivity | reflexivity | | reflexivity
2 openapply puts_invocation_ _ _ [ ] ; left ; reflexivity | reflexivity | left ; auto
–eapply M.run_cons with trace := StreamBytes1 104 tail := [ ]
3 openfocused goal
shelved goal
+eapply M.step_return with site := last_site values := WInt2 ^ 32 − 1 ; repeat split ; reflexivity | reflexivity | reflexivity | | reflexivity
5 opendeferred goal
shelved goal
shelved goal
shelved goal
apply puts_invocation_ _ _ 101; 108; 108; 111; 10 ; left ; reflexivity | reflexivity | right ; reflexivity
+constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.