rocq/theories/HelloStdio.v
Admission of Hello's actual version/footer literals. The bytes and object bounds come from the linked fixture, but current memory is read from program-owned pieces, not assumed to equal startup memory.
Includes the author life tokens used by the variadic wrapper.
Compute the closed fixture strings once, then rewrite by a checked equality instead of repeatedly reducing the linked initializer.
Explore proof 2 tactics
Initial goal
repeat apply List.Forall_cons ; vm_compute ; reflexivity |
constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 4 tactics
Initial goal
intros s bytes Hin
pose proof hello_literal_cache_valid as Hcache
rewrite List.Forall_forall in Hcache
exact Hcaches, bytes Hin
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
intros s Hin
repeat destruct Hin as [ <-| Hin ] ; try contradiction ; vm_compute ; repeat split ; try right ; reflexivity ; repeat constructor ; congruence
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
This is the exact lookup/agreement interface used by HelloVersion; no condition on the current world or output result supplies bytes.
Explore proof 14 tactics
Initial goal
intros s m h Hin Howned Ha
apply string_c_string with b := ptr_addrversion_literals reg := hello_literal_regions
2 openfocused goal
–apply hello_literal_shape
2 opendeferred goal
exact Hin
deferred goal
–apply all_agree_intro
intros l v Hlv
apply Ha , Howned
apply list_elem_of_In
unfold hello_output_pieces
apply in_flat_map
exists s
split ; exact Hin |
apply list_elem_of_In
exact Hlv
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The default branch is used only for printf sites; registry facts below are restricted to actual footer/version call lists.
Hard aliases and the six stream entries compose without replacing the remaining libc contracts supplied by the caller.
Tactics mirror the selected format constructors, not a second executable parser. Every %s must prove its owned C string.
Explore proof 4 tactics
Initial goal
intros stream g xs m h Hin Howned Ha
assert Hstring := λs Hin ⇒ hello_owned_literals m h Hin Howned Ha
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ←
6 openfocused goal
focused goal
focused goal
focused goal
focused goal
all: (match goal with|- ∃bytes, output_text bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;;split;;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 4 tactics
Initial goal
intros stream g xs m h Hin Howned Ha
assert Hstring := λs Hin ⇒ hello_owned_literals m h Hin Howned Ha
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ←
4 openfocused goal
focused goal
focused goal
all: (match goal with|- ∃bytes, output_text bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;;split;;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Class-only admission of the selected promoted ABI, independent of argument expressions and their evaluated values.
Explore proof 4 tactics
Initial goal
intros args H
induction args as | k v args IH ; constructor |
inversion H as [ |? ? Hk Hrest ] ; subst
constructor ; exists v ; destruct Hk ; subst ; auto | auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 23 tactics
Initial goal
intros api d args H
split ; right ; exists d ; reflexivity |
destruct api
3 openfocused goal
–destruct H as rest & Hargs & Hrest
3 opendeferred goal
destruct args as | k fmt args ; discriminate |
3 opendeferred goal
injection Hargs as → Hargs
3 opendeferred goal
exists fmt, args
3 opendeferred goal
split ; reflexivity |
3 opendeferred goal
apply promoted_classes
3 opendeferred goal
rewrite Hargs
3 opendeferred goal
exact Hrest
2 opendeferred goal
–destruct H as rest & Hargs & Hrest
2 opendestruct args as | k file | k′ fmt args ; try discriminate
2 openinjection Hargs as → → Hargs
2 openexists file, fmt, args
2 opensplit ; reflexivity |
2 openapply promoted_classes
2 openrewrite Hargs
2 openexact Hrest
–destruct args as | k text | k′ file | extra args ; try discriminate
injection H as → →
exists text, file
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
intros rep requests wide fallback stream g xs Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
intros rep requests wide fallback stream g xs Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 1 tactics
Initial goal
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 4 tactics
Initial goal
intros stream g xs d args Hin Hclasses
apply output_abi_classes
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses
4 openfocused goal
focused goal
focused goal
all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 4 tactics
Initial goal
intros stream g xs d args Hin Hclasses
apply output_abi_classes
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses
3 openfocused goal
focused goal
all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Actual stdout-facing version/footer calls keep their stream open and non-wide. The fixed handle is a world fact, not a second token.
Explore proof 2 tactics
Initial goal
intros stream g xs w Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 2 tactics
Initial goal
intros stream g xs w Hin Hstdout
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 5 tactics
Initial goal
intros rep requests wide stream g xs m w h Hin Howned Ha Hr & _ & Hstdout & Hfile & Hn
destruct hello_version_textstream g xs m h Hin Howned Ha as bytes Htext
unfold hello_output_spec
destruct Hfile as file Hfile
apply libc_output_admitted with file := file bytes := bytes ; exact Hr | | | exact Htext ; rewrite hello_version_target_ _ _ _ Hin ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 5 tactics
Initial goal
intros rep requests wide stream g xs m w h Hin Howned Ha Hr & _ & Hstdout & Hfile & Hn
destruct hello_footer_textstream g xs m h Hin Howned Ha as bytes Htext
unfold hello_output_spec
destruct Hfile as file Hfile
apply libc_output_admitted with file := file bytes := bytes ; exact Hr | | | exact Htext ; rewrite hello_footer_target_ _ _ _ Hin Hstdout ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The actual author life-token premise, with fixture-derived regions.
Explore proof 8 tactics
Initial goal
intros s Hin
apply list_elem_of_In
unfold hello_output_pieces
apply in_flat_map
exists s
split ; simpl in * ; tauto |
left
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Bind the very machine used by HelloVersion's triples. The proofs below type-check invocation transport across the helper aliases.
The ordinary endpoint has exactly the overwrite shape consumed by HelloClose. The life insertion is redundant only because it is OWNED at entry; the name and errno updates still need their Iris fragments.
Proof 35 steps Qed
Expose the CURRENT authoritative heap at this boundary, not a saved main-entry heap. Freshness belongs only to this one allocation: it is not an invariant the post-state must re-establish. Unneeded main resources frame through. Kentry supplies compatibility with the consumer's other private pools without switching its interpretation.
Explore proof 11 tactics
Initial goal
intros Ha Hd Hr Hw Htokens Hol Hel Hoo Heo Hfresh
iIntros Hh
iMod stream_entry_allocrep out err b o _ _ h op oq ep eq Ha Htokens Hol Hel Hoo Heo Hfresh with Hh as (Hh & Ho & He & %Hnew)
iModIntro
iFrame Ho He
iExists _
2 openshelved goal
iFrame Hh
iPureIntro
destruct Hnew as Ha′ Hw′
repeat split ; try assumption
exact KentryHw Hw′
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A designated-handle fclose rule, not a dispatcher for arbitrary pointers. The consumer keeps its abstract wi and supplies its local K premise for the rest of that interpretation, as for conversion.
Proof 39 steps Qed
Explore proof 10 tactics
Initial goal
intros rep requests wide stream g r args xs s m w trace values s′ m′ w′ h Htarget Ha Hd Hr Hw & Hstdout & Hfile & Hn Hcall
destruct SL.output_return_framerep requests wide hello_output_apig r args xs stream s m w trace values s′ m′ w′ h eq_symHtarget Hcall Ha Hd Hr Hw as Ha′ & Hd′ & Hr′ & Hw′ & Hresult
destruct SL.output_open_narrowrep requests wide hello_output_apig r args xs stream s m w trace CallReturnvalues s′ m′ w′ eq_symHtarget Hn Hcall as Hfile′ & Hn′ & Hstdout′
split ; exact Ha′ |
split ; exact Hd′ |
split ; exact Hr′ |
split ; | exact Hresult
split ; exact Hw′ |
split ; congruence |
auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
These statements are HelloVersion's two output-frame premises, specialized to the concrete registry/spec and represented world.
Explore proof 3 tactics
Initial goal
intros
eapply hello_output_frame ; eauto
eapply hello_version_target ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 3 tactics
Initial goal
intros rep requests wide stream g xs r args s m w h trace values s′ m′ w′ Hin Ha Hd Hr Hw Hcall
eapply hello_output_frame ; eauto
eapply hello_footer_target ; exact Hin | exact proj1proj2Hw
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
HelloClose's complete ordinary _exit interface over its actual invocation relation. It requires no successful host completion to establish admission or absence of ordinary returns.
Explore proof 13 tactics
Initial goal
intros rep requests wide host fallback p
split ; reflexivity |
split ; reflexivity |
split ; intros ; split ; reflexivity | eexists ; reflexivity |
split
2 openfocused goal
–intros n m w h Hn Hready & _ & Hphase
2 opendeferred goal
apply hard_exit_admitted with bits := n
4 openfocused goal
focused goal
deferred goal
+apply libc_stream_ready_libc
4 opendeferred goal
deferred goal
deferred goal
exact Hready
3 opendeferred goal
deferred goal
deferred goal
+split ; reflexivity | exact Hn
2 opendeferred goal
deferred goal
+exact Hphase
deferred goal
–intros
eapply X.hard_exit_no_return ; eauto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Standalone users retain the original functor and theorem paths.
Main supplies one instance beneath output and callback triples.
Exercise the Iris rule, not just its pure replacement map: an actual fclose call instruction returns closed-token and sampled-byte resources through the following return instruction, on the fixture's exact LG.
Explore proof 3 tactics
Initial goal
apply H.A.tokens_safepoint
intros s m s′ m′ w → → Hw
exact Hw
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 1 tactics
Initial goal
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Instantiate the entry wrapper itself, retaining separately owned errno. Freshness is true before allocation, not after it.
Explore proof 18 tactics
Initial goal
iIntros [Hh Herrno]
iMod H.hello_callback_entryclose_wi λ_ _ ⇒ True T.out T.err 5120 0 mkLstateconversion_mem InterpRuntime.start 64 F.worldtrue HelloErrnoChecks.heap 7 65; 66 3 [ ] with Hh as (Hσ & Ho & He)
12 openfocused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
–intros _ Hnew
12 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
exact Hnew
11 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact HelloErrnoChecks.heap_agrees
10 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact HelloErrnoChecks.disjoint
9 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact HelloErrnoChecks.ready
8 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact T.entry_wi
7 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–exact T.entry_wi
6 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–split ; reflexivity
5 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–split ; reflexivity
4 opendeferred goal
deferred goal
deferred goal
deferred goal
–exists mkStreamInfo1 mkStreamByteOriented 65; 66 true 7
4 opendeferred goal
deferred goal
deferred goal
repeat split ; reflexivity
3 opendeferred goal
deferred goal
deferred goal
–exists mkStreamInfo2 stdout_initial 3
3 opendeferred goal
deferred goal
repeat split ; reflexivity
2 opendeferred goal
deferred goal
–exact T.entry_fresh
deferred goal
–iModIntro
iFrame
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Explore proof 23 tactics
Initial goal
iIntros Ho Herrno
iApply H.wp_hello_fcloseregistry close_wi ge λ_ _ ⇒ True λ_ _ _ _ ⇒ False λ_ _ _ _ _ ⇒ False T.out T.err 5120 0 T.out 7 65; 66 0; 0; 0; 0 stub entry_env [ ] TAtom"body" TAtom"r" TmpTAtom"p" [ ] JRetTmpTAtom"r" _ with Ho Herrno []
9 openfocused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
focused goal
–intros m w h Hw
9 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
exact Hw
8 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–intros s m w h tr vs s′ m′ w′ ys Hi Hl Hw Hlen Hnew
8 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
exact Hnew
7 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–left
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
–reflexivity
5 opendeferred goal
deferred goal
deferred goal
deferred goal
deferred goal
–reflexivity
4 opendeferred goal
deferred goal
deferred goal
deferred goal
–reflexivity
3 opendeferred goal
deferred goal
deferred goal
–reflexivity
2 opendeferred goal
deferred goal
–reflexivity
deferred goal
–iNext
iIntros n ys %Hgood Ho Herrno
destruct Hgood as Hn Hys
iApply wp_retregistry close_wi ge stub _ TAtom"body" TmpTAtom"r" W WIntn ; reflexivity | |
2 openfocused goal
+change SomeWIntn mod 2 ^ 32 = SomeWIntn
2 opendeferred goal
rewrite Z.mod_small ; reflexivity | exact Hn
deferred goal
+iNext
iExists n, ys
iFrame
auto
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.