Fil-C on Nix

Filnix wiki

the formal campaign

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.

From iris.proofmode Require Import proofmode
From iris.base_logic.lib Require Import gen_heap
From iris.program_logic Require Import language weakestpre
From Stdlib Require Import String ZArith List Lia
From Nanofil Require Import Term Syntax Values Memory Runtime Semantics Run ExternalCalls ExternalMachine Stdio Shutdown Streams Formatting Libc LibcStreams LibcExit Pieces Heap ContractFrame Logic StringLogic LentLogic LibcStreamLogic LibcErrnoLogic LibcStreamTokens LibcStreamAdapter HelloModule HelloLeaf HelloVersion HelloClose
Import ListNotations
Open Scope Z_scope
Open Scope list_scope
17Definition hello_literal_memory: mem ≔
Some_, m
⇒
m
None
⇒
mkMemλ_ ⇒ 0 [ ] λ_ ⇒ CNone
22Definition hello_literal_bytess : String.string : listZ ≔
26Definition hello_literal_regions : String.string : region ≔

Includes the author life tokens used by the variadic wrapper.

32Definition hello_output_literals: listString.string ≔
"version-etc#str.41"; "version_etc_copyright"; "version-etc#str.43"; "version-etc#str.44"; "version-etc#str.45"; "version-etc#str.46"; "version-etc#str.47"; "version-etc#str.51"; "version-etc#str.58"; "version-etc#str.59"; "version-etc#str.60"; "version-etc#str.61"; "version-etc#str.62"; "version-etc#str.63"; "version-etc#str.64"; "hello#str.70"; "hello#str.63"; "hello#str.71"; "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

Compute the closed fixture strings once, then rewrite by a checked equality instead of repeatedly reducing the linked initializer.

43Definition hello_literal_cache: listString.string × listZ ≔
Eval vm_compute in mapλs ⇒ s, hello_literal_bytess hello_output_literals
46Lemma hello_literal_cache_valid
List.Forallλsb ⇒ hello_literal_bytesfstsb = sndsb hello_literal_cache
Explore proof 2 tactics

Initial goal

⊢
Forallλsb : string × listZ ⇒ hello_literal_bytessb.1 = sb.2 hello_literal_cache

repeat apply List.Forall_cons ; vm_compute ; reflexivity |

⊢
Forallλsb : string × listZ ⇒ hello_literal_bytessb.1 = sb.2 [ ]

constructor

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
repeat apply List.Forall_cons ; vm_compute ; reflexivity |
constructor
52Lemma hello_literal_cached
∀ s bytes
Explore proof 4 tactics

Initial goal

⊢
∀s : string bytes : listZ, Ins, bytes hello_literal_cache → hello_literal_bytess = bytes

intros s bytes Hin

bytes :
listZ
Hin :
⊢

pose proof hello_literal_cache_valid as Hcache

bytes :
listZ
Hin :
Hcache :
Forallλsb : string × listZ ⇒ hello_literal_bytessb.1 = sb.2 hello_literal_cache
⊢

rewrite List.Forall_forall in Hcache

bytes :
listZ
Hin :
Hcache :
∀x : string × listZ, Inx hello_literal_cache → hello_literal_bytesx.1 = x.2
⊢

exact Hcaches, bytes Hin

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s bytes Hin
pose proof hello_literal_cache_valid as Hcache
rewrite List.Forall_forall in Hcache
exact Hcaches, bytes Hin
59Ltac hello_cached_format  ≔
erewrite hello_literal_cached ; | vm_compute ; eauto 30
66Definition hello_output_pieces: listpiece × pval ≔
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
intros s Hin
repeat destruct Hin as [ <-| Hin ] ; try contradiction ; vm_compute ; repeat split ; try right ; reflexivity ; repeat constructor ; congruence

This is the exact lookup/agreement interface used by HelloVersion; no condition on the current world or output result supplies bytes.

79Lemma hello_owned_literal
∀ s m h
∀l v, l, v ∈ hello_output_pieces → h !! l = Somev
Explore proof 14 tactics

Initial goal

⊢
∀s : string m : mem h : gmappiece pval, Ins hello_output_literals → ∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev → agreesm h → c_stringm version_literals hello_literal_bytess

intros s m h Hin Howned Ha

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :

apply string_c_string with b := ptr_addrversion_literals reg := hello_literal_regions

2 open

focused goal

–apply hello_literal_shape

2 open

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
deferred goal

exact Hin

deferred goal

–apply all_agree_intro

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :

intros l v Hlv

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
v :
⊢

apply Ha , Howned

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
v :
⊢

apply list_elem_of_In

unfold hello_output_pieces

apply in_flat_map

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
v :

exists s

split ; exact Hin |

apply list_elem_of_In

m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
v :
⊢

exact Hlv

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s m h Hin Howned Ha
exact Hin
intros l v Hlv
apply Ha , Howned
apply list_elem_of_In
apply in_flat_map
exists s
split ; exact Hin |
apply list_elem_of_In
exact Hlv

The default branch is used only for printf sites; registry facts below are restricted to actual footer/version call lists.

94Definition hello_output_apig : name : narrow_api ≔
98Definition hello_output_specrep requests wide g : contractlibc_world ≔

Hard aliases and the six stream entries compose without replacing the remaining libc contracts supplied by the caller.

103Definition hello_stdio_registryrep requests wide host fallback ≔
libc_hard_exit_registryrep host libc_stream_registryrep requests wide fallback

Tactics mirror the selected format constructors, not a second executable parser. Every %s must prove its owned C string.

108Ltac hello_format Hstring ≔
first apply format_end | eapply format_string ; apply Hstring ; simpl ; tauto | hello_format Hstring | eapply format_signed with text := 50; 48; 50; 54 ; vm_compute ; repeat split ; repeat constructor ; congruence | hello_format Hstring | apply format_percent ; hello_format Hstring | apply format_literal ; lia | discriminate | hello_format Hstring
116Lemma hello_version_text
∀ stream g xs m h
Ing, xs version_output_argsstream
∀l v, l, v ∈ hello_output_pieces → h !! l = Somev
∃bytes, output_texthello_output_apig m xs bytes
Explore proof 4 tactics

Initial goal

⊢
∀stream : ptr g : name xs : listword m : mem h : gmappiece pval, Ing, xs version_output_argsstream → ∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev → agreesm h → ∃bytes : listZ, output_texthello_output_apig m xs bytes

intros stream g xs m h Hin Howned Ha

stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apig m xs bytes

assert Hstring := λs Hin ⇒ hello_owned_literals m h Hin Howned Ha

stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apig m xs bytes

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ←

6 open

stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fprintf" m WPtrstream; WPtrversion_literal"version-etc#str.41"; WPtrversion_literal"hello#str.70"; WPtrversion_literal"hello#str.63"; WPtrversion_literal"hello#str.71" bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fprintf" m WPtrstream; WPtrversion_literal"version_etc_copyright"; WPtrversion_literal"version-etc#str.44"; WInt2026 bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fputs" m WPtrversion_literal"version-etc#str.45"; WPtrstream bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fprintf" m WPtrstream; WPtrversion_literal"version-etc#str.46"; WPtrversion_literal"version-etc#str.47" bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fputs" m WPtrversion_literal"version-etc#str.45"; WPtrstream bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fprintf" m WPtrstream; WPtrversion_literal"version-etc#str.51"; WPtrversion_literal"hello#str.72"; WPtrversion_literal"hello#str.73"; WPtrversion_literal"hello#str.74"; WPtrversion_literal"hello#str.75" bytes

all: (match goal with|- ∃bytes, output_text?api ?m ?xs bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;|reflexivity|;split;|apply Hstring ; simpl ; tauto|;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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 ← ←
all: (match goal with|- ∃bytes, output_text?api ?m ?xs bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;|reflexivity|;split;|apply Hstring ; simpl ; tauto|;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)
Explore proof 4 tactics

Initial goal

⊢
∀stream : ptr g : name xs : listword m : mem h : gmappiece pval, Ing, xs emit_output_argsstream → ∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev → agreesm h → ∃bytes : listZ, output_texthello_output_apig m xs bytes

intros stream g xs m h Hin Howned Ha

stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apig m xs bytes

assert Hstring := λs Hin ⇒ hello_owned_literals m h Hin Howned Ha

stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apig m xs bytes

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ←

4 open

stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"fputs" m WPtrversion_literal"version-etc#str.45"; WPtrstream bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"printf" m WPtrversion_literal"version-etc#str.58"; WPtrversion_literal"version-etc#str.59" bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"printf" m WPtrversion_literal"version-etc#str.60"; WPtrversion_literal"version-etc#str.61"; WPtrversion_literal"version-etc#str.62" bytes
focused goal
stream :
m :
h :
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
⊢
∃bytes : listZ, output_texthello_output_apiTAtom"printf" m WPtrversion_literal"version-etc#str.63"; WPtrversion_literal"version-etc#str.64" bytes

all: (match goal with|- ∃bytes, output_text?api ?m ?xs bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;|reflexivity|;split;|apply Hstring ; simpl ; tauto|;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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 ← ←
all: (match goal with|- ∃bytes, output_text?api ?m ?xs bytes⇒let actual ≔ eval vm_compute in api in change ∃bytes, output_textactual m xs bytesend;eexists;unfold output_text;eexists;eexists;eexists;split;|reflexivity|;split;|apply Hstring ; simpl ; tauto|;cbv beta iota zeta;try reflexivity;hello_cached_format;hello_format Hstring)

Class-only admission of the selected promoted ABI, independent of argument expressions and their evaluated values.

Explore proof 4 tactics

Initial goal

⊢
∀ args : listarg  ,
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
→

intros args H

args :
listarg
H :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
⊢

induction args as | k v args IH ; constructor |

args :
listarg
H :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
Argk v :: args
IH :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
→
⊢
Forallpromoted_argument Argk v :: args

inversion H as [ |? ? Hk Hrest ] ; subst

args :
listarg
H :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
Argk v :: args
IH :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
→
Hk :
k = P ∨ k = W
Hrest :
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
⊢
Forallpromoted_argument Argk v :: args

constructor ; exists v ; destruct Hk ; subst ; auto | auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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
164Lemma output_abi_classes
∀ api d args
match api with
⇒
∃ rest  ,
map
λ a  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk ⇒ k = P ∨ k = W rest
⇒
∃ rest  ,
map
λ a  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk ⇒ k = P ∨ k = W rest
⇒
map
λ a  ⇒
match a with
Argk _
⇒
k
args
=
P; P
Explore proof 23 tactics

Initial goal

⊢
∀ api : narrow_api d : name args : listarg  ,
match api with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
→

intros api d args H

d :
args :
listarg
H :
match api with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢

split ; right ; exists d ; reflexivity |

d :
args :
listarg
H :
match api with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
match api with
⇒
∃fmt : value rest : listarg, args = ArgP fmt :: rest ∧ Forallpromoted_argument rest
⇒
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
⇒
∃text file : value, args = ArgP text; ArgP file

destruct api

3 open

d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃fmt : value rest : listarg, args = ArgP fmt :: rest ∧ Forallpromoted_argument rest
focused goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
focused goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

–destruct H as rest & Hargs & Hrest

3 open

d :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃fmt : value rest0 : listarg, args = ArgP fmt :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

destruct args as | k fmt args ; discriminate |

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
Argk fmt :: args
=
P :: rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃fmt0 : value rest0 : listarg, Argk fmt :: args = ArgP fmt0 :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

injection Hargs as → Hargs

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃fmt0 : value rest0 : listarg, ArgP fmt :: args = ArgP fmt0 :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

exists fmt, args

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
ArgP fmt :: args = ArgP fmt :: args ∧ Forallpromoted_argument args
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

split ; reflexivity |

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

apply promoted_classes

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

rewrite Hargs

3 open

d :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
Forallλk : class ⇒ k = P ∨ k = W rest
deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

exact Hrest

2 open

deferred goal
d :
args :
listarg
H :
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest : listarg, args = ArgP file :: ArgP fmt :: rest ∧ Forallpromoted_argument rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

–destruct H as rest & Hargs & Hrest

2 open

d :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file fmt : value rest0 : listarg, args = ArgP file :: ArgP fmt :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

destruct args as | k file | k′ fmt args ; try discriminate

2 open

d :
file :
k′ :
fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
Argk file :: Argk′ fmt :: args
=
P :: P :: rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file0 fmt0 : value rest0 : listarg, Argk file :: Argk′ fmt :: args = ArgP file0 :: ArgP fmt0 :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

injection Hargs as → → Hargs

2 open

d :
file, fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
∃file0 fmt0 : value rest0 : listarg, ArgP file :: ArgP fmt :: args = ArgP file0 :: ArgP fmt0 :: rest0 ∧ Forallpromoted_argument rest0
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

exists file, fmt, args

2 open

d :
file, fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
ArgP file :: ArgP fmt :: args = ArgP file :: ArgP fmt :: args ∧ Forallpromoted_argument args
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

split ; reflexivity |

2 open

d :
file, fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

apply promoted_classes

2 open

d :
file, fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
Forallλk : class ⇒ k = P ∨ k = W
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

rewrite Hargs

2 open

d :
file, fmt :
args :
listarg
rest :
listclass
Hargs :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
rest
Hrest :
Forallλk : class ⇒ k = P ∨ k = W rest
⊢
Forallλk : class ⇒ k = P ∨ k = W rest
deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

exact Hrest

deferred goal
d :
args :
listarg
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
⊢
∃text file : value, args = ArgP text; ArgP file

–destruct args as | k text | k′ file | extra args ; try discriminate

d :
text :
k′ :
file :
H :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
Argk text; Argk′ file
=
P; P
⊢
∃text0 file0 : value, Argk text; Argk′ file = ArgP text0; ArgP file0

injection H as → →

d :
text, file :
⊢
∃text0 file0 : value, ArgP text; ArgP file = ArgP text0; ArgP file0

exists text, file

d :
text, file :
⊢
ArgP text; ArgP file = ArgP text; ArgP file

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros api d args H
split ; right ; exists d ; reflexivity |
destruct api
–destruct H as rest & Hargs & Hrest
destruct args as | k fmt args ; discriminate |
injection Hargs as → Hargs
exists fmt, args
split ; reflexivity |
rewrite Hargs
exact Hrest
–destruct H as rest & Hargs & Hrest
destruct args as | k file | k′ fmt args ; try discriminate
injection Hargs as → → Hargs
exists file, fmt, args
split ; reflexivity |
rewrite Hargs
exact Hrest
–destruct args as | k text | k′ file | extra args ; try discriminate
injection H as → →
exists text, file
reflexivity
187Lemma hello_version_registry
∀ rep requests wide fallback stream g xs
Ing, xs version_output_argsstream
libc_stream_registryrep requests wide fallback g = Somehello_output_specrep requests wide g
Explore proof 2 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop fallback : name → optioncontractlibc_world stream : ptr g : name xs : listword, Ing, xs version_output_argsstream → libc_stream_registryrep requests wide fallback g = Somehello_output_specrep requests wide g

intros rep requests wide fallback stream g xs Hin

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
fallback :
stream :
g :
xs :
listword
Hin :
Ing, xs version_output_argsstream
⊢
libc_stream_registryrep requests wide fallback g = Somehello_output_specrep requests wide g

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros rep requests wide fallback stream g xs Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
Explore proof 2 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop fallback : name → optioncontractlibc_world stream : ptr g : name xs : listword, Ing, xs emit_output_argsstream → libc_stream_registryrep requests wide fallback g = Somehello_output_specrep requests wide g

intros rep requests wide fallback stream g xs Hin

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
fallback :
stream :
g :
xs :
listword
Hin :
Ing, xs emit_output_argsstream
⊢
libc_stream_registryrep requests wide fallback g = Somehello_output_specrep requests wide g

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros rep requests wide fallback stream g xs Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
203Lemma hello_output_return_class
∀ rep requests wide g
Explore proof 1 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop g : name, contract_returnshello_output_specrep requests wide g = RClassW

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity
207Lemma hello_version_abi
∀ stream g xs d args
Ing, xs version_output_argsstream
map
λ a  ⇒
match a with
Argk _
⇒
k
args
=
Explore proof 4 tactics

Initial goal

⊢
∀ stream : ptr g : name xs : listword d : name args : listarg  ,
Ing, xs version_output_argsstream
→
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
→

intros stream g xs d args Hin Hclasses

stream :
g :
xs :
listword
d :
args :
listarg
Hin :
Ing, xs version_output_argsstream
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=

apply output_abi_classes

stream :
g :
xs :
listword
d :
args :
listarg
Hin :
Ing, xs version_output_argsstream
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
⊢
match hello_output_apig with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses

4 open

stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
version_output_classesWPtrstream; WPtrversion_literal"version-etc#str.41"; WPtrversion_literal"hello#str.70"; WPtrversion_literal"hello#str.63"; WPtrversion_literal"hello#str.71"
⊢
match hello_output_apiTAtom"fprintf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
focused goal
stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
version_output_classesWPtrstream; WPtrversion_literal"version_etc_copyright"; WPtrversion_literal"version-etc#str.44"; WInt2026
⊢
match hello_output_apiTAtom"fprintf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
focused goal
stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
version_output_classesWPtrstream; WPtrversion_literal"version-etc#str.46"; WPtrversion_literal"version-etc#str.47"
⊢
match hello_output_apiTAtom"fprintf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
focused goal
stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
version_output_classesWPtrstream; WPtrversion_literal"version-etc#str.51"; WPtrversion_literal"hello#str.72"; WPtrversion_literal"hello#str.73"; WPtrversion_literal"hello#str.74"; WPtrversion_literal"hello#str.75"
⊢
match hello_output_apiTAtom"fprintf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P

all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros stream g xs d args Hin Hclasses
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses
all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor
Explore proof 4 tactics

Initial goal

⊢
∀ stream : ptr g : name xs : listword d : name args : listarg  ,
Ing, xs emit_output_argsstream
→
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthxs P
→

intros stream g xs d args Hin Hclasses

stream :
g :
xs :
listword
d :
args :
listarg
Hin :
Ing, xs emit_output_argsstream
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthxs P

apply output_abi_classes

stream :
g :
xs :
listword
d :
args :
listarg
Hin :
Ing, xs emit_output_argsstream
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthxs P
⊢
match hello_output_apig with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses

3 open

stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthWPtrversion_literal"version-etc#str.58"; WPtrversion_literal"version-etc#str.59" P
⊢
match hello_output_apiTAtom"printf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
focused goal
stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthWPtrversion_literal"version-etc#str.60"; WPtrversion_literal"version-etc#str.61"; WPtrversion_literal"version-etc#str.62" P
⊢
match hello_output_apiTAtom"printf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P
focused goal
stream :
d :
args :
listarg
Hclasses :
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
replicateDatatypes.lengthWPtrversion_literal"version-etc#str.63"; WPtrversion_literal"version-etc#str.64" P
⊢
match hello_output_apiTAtom"printf" with
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
∃ rest : listclass  ,
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P :: P :: rest
∧
Forallλk : class ⇒ k = P ∨ k = W rest
⇒
map
λ a : arg  ⇒
match a with
Argk _
⇒
k
args
=
P; P

all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros stream g xs d args Hin Hclasses
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; cbn [ hello_output_api name_eqb ] ; try exact Hclasses
all: eexists ; split ; exact Hclasses | repeat apply Forall_cons ; auto | ; constructor

Actual stdout-facing version/footer calls keep their stream open and non-wide. The fixed handle is a world fact, not a second token.

231Definition hello_stdio_wirep stream m w h : Prop ≔
libc_stream_wirep stream m w h ∧ libc_stdoutw = stream ∧ ∃file, libc_file_atw stream = Somefile ∧ orientationlibc_stream_statew stream ≠ WideOriented
236Lemma hello_version_target
∀ stream g xs w
Ing, xs version_output_argsstream
Explore proof 2 tactics

Initial goal

⊢
∀stream : ptr g : name xs : listword w : libc_world, Ing, xs version_output_argsstream → output_targethello_output_apig libc_stdout w xs = stream

intros stream g xs w Hin

stream :
g :
xs :
listword
Hin :
Ing, xs version_output_argsstream

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros stream g xs w Hin
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; reflexivity
Explore proof 2 tactics

Initial goal

⊢
∀stream : ptr g : name xs : listword w : libc_world, Ing, xs emit_output_argsstream → libc_stdoutw = stream → output_targethello_output_apig libc_stdout w xs = stream

intros stream g xs w Hin Hstdout

stream :
g :
xs :
listword
Hin :
Ing, xs emit_output_argsstream
Hstdout :
libc_stdoutw = stream

repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros stream g xs w Hin Hstdout
repeat destruct Hin as Hin | Hin ; try contradiction ; injection Hin as ← ← ; auto
252Lemma hello_version_admitted
∀ rep requests wide stream g xs m w h
Ing, xs version_output_argsstream
∀l v, l, v ∈ hello_output_pieces → h !! l = Somev
hello_stdio_wirep stream m w h
contract_prehello_output_specrep requests wide g xs m w
Explore proof 5 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop stream : ptr g : name xs : listword m : mem w : libc_world h : gmappiece pval, Ing, xs version_output_argsstream → ∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev → agreesm h → hello_stdio_wirep stream m w h → contract_prehello_output_specrep requests wide g xs m w

intros rep requests wide stream g xs m w h Hin Howned Ha Hr & _ & Hstdout & Hfile & Hn

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
⊢
contract_prehello_output_specrep requests wide g xs m w

destruct hello_version_textstream g xs m h Hin Howned Ha as bytes Htext

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
bytes :
listZ
Htext :
⊢
contract_prehello_output_specrep requests wide g xs m w

unfold hello_output_spec

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
bytes :
listZ
Htext :

destruct Hfile as file Hfile

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs version_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
file :
Hfile :
libc_file_atw stream = Somefile
bytes :
listZ
Htext :

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
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
destruct Hfile as file Hfile
apply libc_output_admitted with file := file bytes := bytes ; exact Hr | | | exact Htext ; rewrite hello_version_target_ _ _ _ Hin ; assumption
Explore proof 5 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop stream : ptr g : name xs : listword m : mem w : libc_world h : gmappiece pval, Ing, xs emit_output_argsstream → ∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev → agreesm h → hello_stdio_wirep stream m w h → contract_prehello_output_specrep requests wide g xs m w

intros rep requests wide stream g xs m w h Hin Howned Ha Hr & _ & Hstdout & Hfile & Hn

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
⊢
contract_prehello_output_specrep requests wide g xs m w

destruct hello_footer_textstream g xs m h Hin Howned Ha as bytes Htext

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
bytes :
listZ
Htext :
⊢
contract_prehello_output_specrep requests wide g xs m w

unfold hello_output_spec

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
bytes :
listZ
Htext :

destruct Hfile as file Hfile

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
m :
h :
Hin :
Ing, xs emit_output_argsstream
Howned :
∀l : piece v : pval, l, v ∈ hello_output_pieces → h !! l = Somev
Ha :
Hstdout :
libc_stdoutw = stream
file :
Hfile :
libc_file_atw stream = Somefile
bytes :
listZ
Htext :

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
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
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

The actual author life-token premise, with fixture-derived regions.

279Lemma hello_author_live
∀ s
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"
Explore proof 8 tactics

Initial goal

⊢
∀s : string, Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75" → PLiveptr_addrversion_literals, VLivehello_literal_regions ∈ hello_output_pieces

intros s Hin

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

apply list_elem_of_In

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

unfold hello_output_pieces

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

apply in_flat_map

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

exists s

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

split ; simpl in * ; tauto |

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

left

Hin :
Ins "hello#str.72"; "hello#str.73"; "hello#str.74"; "hello#str.75"

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s Hin
apply list_elem_of_In
apply in_flat_map
exists s
split ; simpl in * ; tauto |
left
reflexivity

Bind the very machine used by HelloVersion's triples. The proofs below type-check invocation transport across the helper aliases.

289Module HelloStdioOn R : Runtime LG0 : LogicSigR
290Module LG ≔ LG0
291Module V ≔ HelloVersionOn R LG0
292Module M ≔ V.L.M
293Module SL ≔ LibcStreamLogicOn R LG0
294Module C ≔ HelloCloseOn R LG0
295Module X ≔ LibcExitOn R C.L.M
296Module A ≔ LibcStreamAdapterOn R LG0

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.

301Theorem hello_fclose_frame
∀ rep requests wide out err b o dt pending fifo xs r args s m w trace values s′ m′ w′ h
dt = out ∨ dt = err
lengthxs = 4%nat
R.readys m
stream_tokens_wirep out err b o m w h
∀l v, l, v ∈ stream_psdt pending fifo ++ byte_psb o xs → h !! l = Somev
M.E.invokefclose_contractlibc_stream_modelrep requests wide r args WPtrtoken_handledt s m w trace CallReturnvalues s′ m′ w′
∃n ys, values = WIntn ∧ 0 ≤ n < 2 ^ 32 ∧ lengthys = 4%nat ∧ closed_psdt ++ byte_psb o ys.*1 = stream_psdt pending fifo ++ byte_psb o xs.*1 ∧ agreesm′ overwriteclosed_psdt ++ byte_psb o ys h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ stream_tokens_wirep out err b o m′ w′ overwriteclosed_psdt ++ byte_psb o ys h
Proof 35 steps Qed
intros rep requests wide out err b o dt pending fifo xs r args s m w trace values s′ m′ w′ h Hdt Hxs Ha Hd Hr Hw Howned Hcall
destruct A.close_framerep requests wide out err b o dt r args s m w trace values s' m' w' h xs Hdt Hcall Ha Hd Hr Hw Hxs as ys & Hys & Hkeys & Ha′ & Hd′ & Hr′ & Hw′
{intros l v Hin
apply Howned , elem_of_app
right
exact Hin
assert Heq : overwriteclosed_psdt ++ byte_psb o ys h = <[PNametoken_keydt ≔ VStreamtoken_handledt None]>overwritebyte_psb o ys h
{rewrite overwrite_app
apply fin_maps.insert_id
rewrite lookup_insert_ne ; | discriminate
–apply Howned , elem_of_app
left
unfold stream_ps
apply elem_of_cons
left
reflexivity
–rewrite byte_ps_keys
intros Hin
apply list_elem_of_fmap in Hin as i & E & _
discriminate E
destruct A.T.EL.S.fclose_invocation_ _ _ _ _ _ _ _ _ _ _ _ _ Hcall as born & p & info & final & n & _ & _ & _ & _ & Hn & _ & _ & _ & _ & _ & Hend | why & Hbad & _ ; | discriminate Hbad
injection Hend as Hvalues
subst values
exists n, ys
split ; reflexivity |
split
{destruct Hn as → | → ; unfold stream_eof ; lia
split ; exact Hys |
split
{rewrite ! fmap_app stream_closed_keysdt pending fifo Hkeys
reflexivity
rewrite Heq
auto
335Section callback_rules
Import LG LG.L
337Context `{!invGS_genhlc Σ, !gen_heapGSpiece pval Σ}
338Context registry : name → optioncontractlibc_world wi : mem → libc_world → gmappiece pval → Prop `{!SafepointStablewi} ge : genv
340Instance callback_irisGS: irisGS_genhlc nanofil_langregistry ge Σ ≔
nanofil_irisGSregistry wi ge
342Notation cexpr ≔ language.exprnanofil_langregistry ge

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.

349Lemma hello_callback_entry
∀ rep out err b o σ h op oq ep eq Kentry : wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
gen_heap_interph ⇛ heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq
Explore proof 11 tactics

Initial goal

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
⊢
agreesls_memσ h → live_disjointls_memσ → R.readyls_rtσ ls_memσ → wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ h → live_atls_memσ token_baseout token_regionout → live_atls_memσ token_baseerr token_regionerr → stream_observationls_worldσ token_handleout Someop, oq → stream_observationls_worldσ token_handleerr Someep, eq → ∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None → gen_heap_interph ⇛ heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq

intros Ha Hd Hr Hw Htokens Hol Hel Hoo Heo Hfresh

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
⊢
gen_heap_interph ⇛ heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq

iIntros Hh

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hh :
gen_heap_interph
∗
|⇛ heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq

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)

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hh :
gen_heap_interpoverwritestream_psout op oq ++ stream_pserr ep eq h
Ho :
ptsstream_psout op oq
He :
ptsstream_pserr ep eq
∗
|⇛ heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq

iModIntro

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hh :
gen_heap_interpoverwritestream_psout op oq ++ stream_pserr ep eq h
Ho :
ptsstream_psout op oq
He :
ptsstream_pserr ep eq
∗
heap_interpwi σ ∗ ptsstream_psout op oq ∗ ptsstream_pserr ep eq

iFrame Ho He

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hh :
gen_heap_interpoverwritestream_psout op oq ++ stream_pserr ep eq h
∗
heap_interpwi σ

iExists _

2 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hh :
gen_heap_interpoverwritestream_psout op oq ++ stream_pserr ep eq h
∗
gen_heap_interp?g ∗ ⌜agreesls_memσ ?g ∧ live_disjointls_memσ ∧ R.readyls_rtσ ls_memσ ∧ wils_memσ ls_worldσ ?g⌝
shelved goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
⊢

iFrame Hh

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
∗
⌜agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ live_disjointls_memσ ∧ R.readyls_rtσ ls_memσ ∧ wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h⌝

iPureIntro

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Hnew :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
⊢
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ live_disjointls_memσ ∧ R.readyls_rtσ ls_memσ ∧ wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h

destruct Hnew as Ha′ Hw′

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Ha′ :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hw′ :
stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
⊢
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h ∧ live_disjointls_memσ ∧ R.readyls_rtσ ls_memσ ∧ wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h

repeat split ; try assumption

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
registry :
wi :
mem → libc_world → gmappiece pval → Prop
SafepointStable0 :
ge :
rep :
mem → libc_world → Prop
out, err :
b, o :
Z
h :
op :
Z
oq :
listZ
ep :
Z
eq :
listZ
Kentry :
wils_memσ ls_worldσ h → stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h → wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
Ha :
Hr :
R.readyls_rtσ ls_memσ
Hw :
Htokens :
stream_tokens_wirep out err b o ls_memσ ls_worldσ h
Hfresh :
∀l : piece v : pval, l, v ∈ stream_psout op oq ++ stream_pserr ep eq → h !! l = None
Ha′ :
agreesls_memσ overwritestream_psout op oq ++ stream_pserr ep eq h
Hw′ :
stream_tokens_wirep out err b o ls_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h
⊢
wils_memσ ls_worldσ overwritestream_psout op oq ++ stream_pserr ep eq h

exact KentryHw Hw′

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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 _
iFrame Hh
iPureIntro
destruct Hnew as Ha′ Hw′
repeat split ; try assumption
exact KentryHw Hw′

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.

375Lemma wp_hello_fclose
∀ rep requests wide out err b o dt pending fifo xs f e ls lab result v rest j Φ Htokens : ∀m w h, wim w h → stream_tokens_wirep out err b o m w h Kclose : ∀s m w h trace values s′ m′ w′ ys, M.E.invokefclose_contractlibc_stream_modelrep requests wide CResultresult W ArgP v WPtrtoken_handledt s m w trace CallReturnvalues s′ m′ w′ → ∀l u, l, u ∈ stream_psdt pending fifo ++ byte_psb o xs → h !! l = Someu → wim w h → lengthys = 4%nat → stream_tokens_wirep out err b o m′ w′ overwriteclosed_psdt ++ byte_psb o ys h → wim′ w′ overwriteclosed_psdt ++ byte_psb o ys h
dt = out ∨ dt = err
lengthxs = 4%nat
find_fnge TAtom"fclose" = None
lookupTAtom"fclose" ge_globalsge = None
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelrep requests wide
ptsstream_psdt pending fifo −∗ ptsbyte_psb o xs −∗ ▷∀n ys, ⌜0 ≤ n < 2 ^ 32 ∧ lengthys = 4%nat⌝ −∗ ptsclosed_psdt −∗ ptsbyte_psb o ys −∗ WPERunmkFramef putresult WIntn e ls None Execlab rest j : cexpr {Φ} −∗ WPERunmkFramef e ls None Execlab CallCResultresult W GlobalTAtom"fclose" ArgP v :: rest j : cexpr {Φ}
Proof 39 steps Qed
intros Hdt Hxs Hfn Hg Hreg Hv
iIntros Hs Hx HK
iApply C.wp_close_contractregistry wi ge f e ls lab result W TAtom"fclose" _ _ _ fclose_contractlibc_stream_modelrep requests wide WPtrtoken_handledt stream_psdt pending fifo ++ byte_psb o xs λys ⇒ closed_psdt ++ byte_psb o ys λn ys ⇒ 0 ≤ n < 2 ^ 32 ∧ lengthys = 4%nat with [Hs Hx] [HK]
–exact Hfn
–exact Hg
–reflexivity
–exact Hreg
–reflexivity
–left
reflexivity
–cbn [ map_option ]
rewrite Hv
reflexivity
–split ; right ; eexists ; reflexivity | eexists ; reflexivity
–intros m w h Hw Hl
eapply A.open_admitted ; exact Hdt | apply Htokens ; exact Hw |
intros l u Hin
apply Hl , elem_of_app
left
exact Hin
–intros s m w h tr vs s′ m′ w′ Ha Hd Hr Hw Hl Hi
destruct hello_fclose_framerep requests wide out err b o dt pending fifo xs _ _ s m w tr vs s' m' w' h Hdt Hxs Ha Hd Hr Htokens_ _ _ Hw Hl Hi as n & ys & → & Hn & Hys & Hkeys & Ha′ & Hd′ & Hr′ & Htokens′
exists n, ys
split ; reflexivity |
split ; exact Hn |
split ; auto |
split ; exact Hkeys |
split ; exact Ha' |
split ; exact Hd' |
split ; exact Hr' |
eapply Kclose ; eauto
–rewrite pts_app
iFrame
–iNext
iIntros n ys %Hgood Hps
rewrite pts_app
iDestruct Hps as [Hs Hx]
iApply HK with [%] Hs Hx
exact Hgood
425Theorem hello_output_frame
∀ rep requests wide stream g r args xs s m w trace values s′ m′ w′ h
R.readys m
hello_stdio_wirep stream m w h
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Explore proof 10 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop stream : ptr g : name r : call_result args : listarg xs : listword s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world h : gmappiece pval, output_targethello_output_apig libc_stdout w xs = stream → agreesm h → live_disjointm → R.readys m → hello_stdio_wirep stream m w h → M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′ → agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

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

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
⊢
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

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

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
⊢
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

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′

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

split ; exact Ha′ |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

split ; exact Hd′ |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

split ; exact Hr′ |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

split ; | exact Hresult

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
hello_stdio_wirep stream m′ w′ h

split ; exact Hw′ |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
libc_stdoutw′ = stream ∧ ∃file : libc_file, libc_file_atw′ stream = Somefile ∧ orientationlibc_stream_statew′ stream ≠ WideOriented

split ; congruence |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
args :
listarg
xs :
listword
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
h :
Ha :
Hr :
R.readys m
Hw :
libc_stream_wirep stream m w h
Hstdout :
libc_stdoutw = stream
Hfile :
∃file : libc_file, libc_file_atw stream = Somefile
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
Ha′ :
agreesm′ h
Hd′ :
Hr′ :
R.readys′ m′
Hw′ :
libc_stream_wirep stream m′ w′ h
Hresult :
∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Hfile′ :
∃file : libc_file, libc_file_atw′ stream = Somefile
Hstdout′ :
⊢
∃file : libc_file, libc_file_atw′ stream = Somefile ∧ orientationlibc_stream_statew′ stream ≠ WideOriented

auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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

These statements are HelloVersion's two output-frame premises, specialized to the concrete registry/spec and represented world.

447Theorem hello_version_frame
∀ rep requests wide stream g xs r args s m w h trace values s′ m′ w′
Ing, xs version_output_argsstream
R.readys m
hello_stdio_wirep stream m w h
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n, values = WIntn ∧ 0 ≤ n < 2 ^ 32
Explore proof 3 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop stream : ptr g : name xs : listword r : call_result args : listarg s : R.state m : mem w : libc_world h : gmappiece pval trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, Ing, xs version_output_argsstream → agreesm h → live_disjointm → R.readys m → hello_stdio_wirep stream m w h → M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′ → agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

intros

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
args :
listarg
s :
R.state
m :
h :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
H :
Ing, xs version_output_argsstream
H0 :
H2 :
R.readys m
H3 :
hello_stdio_wirep stream m w h
H4 :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
⊢
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

eapply hello_output_frame ; eauto

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
args :
listarg
s :
R.state
m :
h :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
H :
Ing, xs version_output_argsstream
H0 :
H2 :
R.readys m
H3 :
hello_stdio_wirep stream m w h
H4 :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′

eapply hello_version_target ; eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros
eapply hello_output_frame ; eauto
eapply hello_version_target ; eauto
Explore proof 3 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop stream : ptr g : name xs : listword r : call_result args : listarg s : R.state m : mem w : libc_world h : gmappiece pval trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, Ing, xs emit_output_argsstream → agreesm h → live_disjointm → R.readys m → hello_stdio_wirep stream m w h → M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′ → agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

intros rep requests wide stream g xs r args s m w h trace values s′ m′ w′ Hin Ha Hd Hr Hw Hcall

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
args :
listarg
s :
R.state
m :
h :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
Hin :
Ing, xs emit_output_argsstream
Ha :
Hr :
R.readys m
Hw :
hello_stdio_wirep stream m w h
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′
⊢
agreesm′ h ∧ live_disjointm′ ∧ R.readys′ m′ ∧ hello_stdio_wirep stream m′ w′ h ∧ ∃n : Z, values = WIntn ∧ 0 ≤ n < 2 ^ 32

eapply hello_output_frame ; eauto

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
stream :
g :
xs :
listword
args :
listarg
s :
R.state
m :
h :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
Hin :
Ing, xs emit_output_argsstream
Ha :
Hr :
R.readys m
Hw :
hello_stdio_wirep stream m w h
Hcall :
M.E.invokehello_output_specrep requests wide g r args xs s m w trace CallReturnvalues s′ m′ w′

eapply hello_footer_target ; exact Hin | exact proj1proj2Hw

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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

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.

474Theorem hello_close_exit_contract
∀ rep requests wide host fallback p
hello_stdio_registryrep requests wide host fallback TAtom"_exit" = Somelibc_hard_exit_contractrep host ∧ contract_returnslibc_hard_exit_contractrep host = RVoid ∧ ∀v, contract_abilibc_hard_exit_contractrep host CVoid ArgW v ∧ ∀n m w h, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args n s m w trace values s′ m′ w′, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False
Explore proof 13 tactics

Initial goal

⊢
∀rep : mem → libc_world → Prop requests : libc_world → ptr → Z → Z → Prop wide : libc_world → ptr → stream_state → stream_state → bool → Prop host : mem → libc_world → Prop fallback : name → optioncontractlibc_world p : ptr, hello_stdio_registryrep requests wide host fallback TAtom"_exit" = Somelibc_hard_exit_contractrep host ∧ contract_returnslibc_hard_exit_contractrep host = RVoid ∧ ∀v : value, contract_abilibc_hard_exit_contractrep host CVoid ArgW v ∧ ∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

intros rep requests wide host fallback p

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
hello_stdio_registryrep requests wide host fallback TAtom"_exit" = Somelibc_hard_exit_contractrep host ∧ contract_returnslibc_hard_exit_contractrep host = RVoid ∧ ∀v : value, contract_abilibc_hard_exit_contractrep host CVoid ArgW v ∧ ∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

split ; reflexivity |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
contract_returnslibc_hard_exit_contractrep host = RVoid ∧ ∀v : value, contract_abilibc_hard_exit_contractrep host CVoid ArgW v ∧ ∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

split ; reflexivity |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀v : value, contract_abilibc_hard_exit_contractrep host CVoid ArgW v ∧ ∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

split ; intros ; split ; reflexivity | eexists ; reflexivity |

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w ∧ ∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

split

2 open

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀n : Z m : mem w : libc_world h : gmappiece pval, 0 ≤ n < 2 ^ 32 → libc_closing_wirep p m w h → contract_prelibc_hard_exit_contractrep host WIntn m w
focused goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

–intros n m w h Hn Hready & _ & Hphase

2 open

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

apply hard_exit_admitted with bits := n

4 open

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
⊢
libc_readyrep m w
focused goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
focused goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
⊢
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

+apply libc_stream_ready_libc

4 open

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
⊢
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

exact Hready

3 open

deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
⊢
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

+split ; reflexivity | exact Hn

2 open

deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
n :
Z
m :
h :
Hn :
0 ≤ n < 2 ^ 32
Hready :
Hphase :
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
⊢
∀kind : handoff_kind, shutdown_atw.2 ≠ HandedOffkind
deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

+exact Hphase

deferred goal
rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
⊢
∀args : listarg n : Z s : R.state m : mem w : libc_world trace : listevent values : listword s′ : R.state m′ : mem w′ : libc_world, C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′ → False

–intros

rep :
mem → libc_world → Prop
requests :
libc_world → ptr → Z → Z → Prop
wide :
libc_world → ptr → stream_state → stream_state → bool → Prop
host :
mem → libc_world → Prop
fallback :
p :
args :
listarg
n :
Z
s :
R.state
m :
trace :
listevent
values :
listword
s′ :
R.state
m′ :
H :
C.L.M.E.invokelibc_hard_exit_contractrep host CVoid args WIntn s m w trace CallReturnvalues s′ m′ w′
⊢
False

eapply X.hard_exit_no_return ; eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros rep requests wide host fallback p
split ; reflexivity |
split ; reflexivity |
split ; intros ; split ; reflexivity | eexists ; reflexivity |
split
–intros n m w h Hn Hready & _ & Hphase
apply hard_exit_admitted with bits := n
exact Hready
+split ; reflexivity | exact Hn
+exact Hphase
–intros
eapply X.hard_exit_no_return ; eauto

Standalone users retain the original functor and theorem paths.

499Module HelloStdio R : Runtime
500Module LG0 ≔ Logic R
Include HelloStdioOn R LG0

Main supplies one instance beneath output and callback triples.

505Module HelloStdioSharedChecks
506Module LG ≔ Logic InterpRuntime
509Example version_expr_identity: H.V.L.expr = LG.L.expr
Explore proof 1 tactics

Initial goal

⊢
H.V.L.expr = LG.L.expr

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity
512Example close_expr_identity: H.C.L.expr = LG.L.expr
Explore proof 1 tactics

Initial goal

⊢
H.C.L.expr = LG.L.expr

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity
515Example shared_invoke_identity: @H.M.E.invoke = @H.C.L.M.E.invoke
Explore proof 1 tactics

Initial goal

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity

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.

523Module HelloCallbackChecks
524Module LG ≔ StreamHandleChecks.LG
526Module F ≔ LibcStreamChecks
527Module T ≔ StreamTokenChecks
Import LG LG.L
530Definition close_wi ≔
stream_tokens_wiλ_ _ ⇒ True T.out T.err 5120 0
531Definition registry: name → optioncontractlibc_world ≔
532Definition ge ≔
mkGenv[ ] [ ] λ_ _ ⇒ None
533Definition stub ≔
mkFuncTAtom"close-control" TAtom"local" RClassW [ ] [ ]
534Definition entry_env ≔
536Instance close_stable: SafepointStableclose_wi
Explore proof 3 tactics

Initial goal

apply H.A.tokens_safepoint

⊢
∀s : InterpRuntime.state m : mem s′ : InterpRuntime.state m′ : mem w : libc_world, InterpRuntime.safepoints m s′ m′ → libc_stream_readyλ_ : mem _ : libc_world ⇒ True m w → libc_stream_readyλ_ : mem _ : libc_world ⇒ True m′ w

intros s m s′ m′ w → → Hw

⊢
libc_stream_readyλ_ : mem _ : libc_world ⇒ True m w

exact Hw

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros s m s′ m′ w → → Hw
exact Hw
541Example fixture_invoke_identity: @H.M.E.invoke = @T.A.M.E.invoke
Explore proof 1 tactics

Initial goal

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity
544Section iris
545Context `{!invGS_genhlc Σ, !gen_heapGSpiece pval Σ}
546Instance test_irisGS: irisGS_genhlc nanofil_langregistry ge Σ ≔
nanofil_irisGSregistry close_wi ge

Instantiate the entry wrapper itself, retaining separately owned errno. Freshness is true before allocation, not after it.

551Example callback_entry_resources: gen_heap_interpHelloErrnoChecks.heap ∗ ptsbyte_ps5120 0 0; 0; 0; 0 ⇛ heap_interpclose_wi mkLstateconversion_mem InterpRuntime.start 64 F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0
Explore proof 18 tactics

Initial goal

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
gen_heap_interpHelloErrnoChecks.heap ∗ ptsbyte_ps5120 0 0; 0; 0; 0 ⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

iIntros [Hh Herrno]

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Hh :
gen_heap_interpHelloErrnoChecks.heap
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

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 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap → stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue overwritestream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] HelloErrnoChecks.heap → close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue overwritestream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] HelloErrnoChecks.heap
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
agreesH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
live_disjointH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
InterpRuntime.readyH.LG.L.ls_rtH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–intros _ Hnew

12 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Hnew :
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue overwritestream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] HelloErrnoChecks.heap
⊢
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
agreesH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
live_disjointH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
InterpRuntime.readyH.LG.L.ls_rtH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

exact Hnew

11 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
agreesH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
live_disjointH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
InterpRuntime.readyH.LG.L.ls_rtH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact HelloErrnoChecks.heap_agrees

10 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
live_disjointH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
InterpRuntime.readyH.LG.L.ls_rtH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact HelloErrnoChecks.disjoint

9 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
InterpRuntime.readyH.LG.L.ls_rtH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact HelloErrnoChecks.ready

8 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
close_wiH.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact T.entry_wi

7 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 H.LG.L.ls_memH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue H.LG.L.ls_worldH.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue HelloErrnoChecks.heap
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact T.entry_wi

6 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–split ; reflexivity

5 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–split ; reflexivity

4 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exists mkStreamInfo1 mkStreamByteOriented 65; 66 true 7

4 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

repeat split ; reflexivity

3 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exists mkStreamInfo2 stdout_initial 3

3 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

repeat split ; reflexivity

2 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀l : piece v : pval, l, v ∈ stream_psT.out 7 65; 66 ++ stream_psT.err 3 [ ] → HelloErrnoChecks.heap !! l = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–exact T.entry_fresh

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
|⇛ heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

–iModIntro

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
Hσ :
H.LG.heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue
Ho :
∗
heap_interpclose_wi H.C.L.ls_mem ≔ conversion_mem; H.C.L.ls_rt ≔ InterpRuntime.start; H.C.L.ls_fuel ≔ 64; H.C.L.ls_world ≔ F.worldtrue ∗ ptsstream_psT.out 7 65; 66 ∗ ptsstream_psT.err 3 [ ] ∗ ptsbyte_ps5120 0 0; 0; 0; 0

iFrame

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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)
–intros _ Hnew
exact Hnew
–exact T.entry_wi
–exact T.entry_wi
–split ; reflexivity
–split ; reflexivity
–exists mkStreamInfo1 mkStreamByteOriented 65; 66 true 7
repeat split ; reflexivity
repeat split ; reflexivity
–exact T.entry_fresh
–iModIntro
iFrame
575Example close_then_return_resources: ptsstream_psT.out 7 65; 66 −∗ ptsbyte_ps5120 0 0; 0; 0; 0 −∗ WPERunmkFramestub entry_env [ ] None ExecTAtom"body" CallCResultTAtom"r" W GlobalTAtom"fclose" ArgP TmpTAtom"p" JRetTmpTAtom"r" : language.exprnanofil_langregistry ge {result. ∃n ys, ⌜result = RetWIntn ∧ lengthys = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys}
Explore proof 23 tactics

Initial goal

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
ptsstream_psT.out 7 65; 66 −∗ ptsbyte_ps5120 0 0; 0; 0; 0 −∗ WPERunfr_fn ≔ stub; fr_env ≔ entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" CallCResultTAtom"r" W GlobalTAtom"fclose" ArgP TmpTAtom"p" JRetTmpTAtom"r" : language.exprnanofil_langregistry ge {result. ∃n : Z ys : listZ, ⌜result = RetWIntn ∧ Datatypes.lengthys = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys}

iIntros Ho Herrno

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
Ho :
Herrno :
ptsbyte_ps5120 0 0; 0; 0; 0
∗
WPERunfr_fn ≔ stub; fr_env ≔ entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" CallCResultTAtom"r" W GlobalTAtom"fclose" ArgP TmpTAtom"p" JRetTmpTAtom"r" {result. ∃n : Z ys : listZ, ⌜result = RetWIntn ∧ Datatypes.lengthys = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys}

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 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀m : mem w : libc_world h : gmappiece pval, close_wim w h → stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m w h
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀s : InterpRuntime.state m : mem w : libc_world h : gmappiece pval trace : listevent values : listword s′ : InterpRuntime.state m′ : mem w′ : libc_world ys : listZ, H.LG.L.M.E.invokefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False CResultTAtom"r" W ArgP TmpTAtom"p" WPtrtoken_handleT.out s m w trace CallReturnvalues s′ m′ w′ → ∀l : piece u : pval, l, u ∈ stream_psT.out 7 65; 66 ++ byte_ps5120 0 0; 0; 0; 0 → h !! l = Someu → close_wim w h → Datatypes.lengthys = 4%nat → stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h → close_wim′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
T.out = T.out ∨ T.out = T.err
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–intros m w h Hw

9 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
m :
h :
Hw :
⊢
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m w h
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀s : InterpRuntime.state m : mem w : libc_world h : gmappiece pval trace : listevent values : listword s′ : InterpRuntime.state m′ : mem w′ : libc_world ys : listZ, H.LG.L.M.E.invokefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False CResultTAtom"r" W ArgP TmpTAtom"p" WPtrtoken_handleT.out s m w trace CallReturnvalues s′ m′ w′ → ∀l : piece u : pval, l, u ∈ stream_psT.out 7 65; 66 ++ byte_ps5120 0 0; 0; 0; 0 → h !! l = Someu → close_wim w h → Datatypes.lengthys = 4%nat → stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h → close_wim′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
T.out = T.out ∨ T.out = T.err
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

exact Hw

8 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
∀s : InterpRuntime.state m : mem w : libc_world h : gmappiece pval trace : listevent values : listword s′ : InterpRuntime.state m′ : mem w′ : libc_world ys : listZ, H.LG.L.M.E.invokefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False CResultTAtom"r" W ArgP TmpTAtom"p" WPtrtoken_handleT.out s m w trace CallReturnvalues s′ m′ w′ → ∀l : piece u : pval, l, u ∈ stream_psT.out 7 65; 66 ++ byte_ps5120 0 0; 0; 0; 0 → h !! l = Someu → close_wim w h → Datatypes.lengthys = 4%nat → stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h → close_wim′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
T.out = T.out ∨ T.out = T.err
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–intros s m w h tr vs s′ m′ w′ ys Hi Hl Hw Hlen Hnew

8 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
m :
h :
tr :
listevent
vs :
listword
m′ :
ys :
listZ
Hi :
H.LG.L.M.E.invokefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False CResultTAtom"r" W ArgP TmpTAtom"p" WPtrtoken_handleT.out s m w tr CallReturnvs s′ m′ w′
Hl :
∀l : piece u : pval, l, u ∈ stream_psT.out 7 65; 66 ++ byte_ps5120 0 0; 0; 0; 0 → h !! l = Someu
Hw :
Hlen :
Datatypes.lengthys = 4%nat
Hnew :
stream_tokens_wiλ_ : mem _ : libc_world ⇒ True T.out T.err 5120 0 m′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h
⊢
close_wim′ w′ overwriteclosed_psT.out ++ byte_ps5120 0 ys h
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
T.out = T.out ∨ T.out = T.err
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

exact Hnew

7 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
T.out = T.out ∨ T.out = T.err
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–left

7 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

reflexivity

6 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
Datatypes.length0; 0; 0; 0 = 4%nat
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–reflexivity

5 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
find_fnge TAtom"fclose" = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–reflexivity

4 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
lookupTAtom"fclose" ge_globalsge = None
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–reflexivity

3 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
⊢
registryTAtom"fclose" = Somefclose_contractlibc_stream_modelλ_ : mem _ : libc_world ⇒ True λ_ : libc_world _ : ptr _ _ : Z ⇒ False λ_ : libc_world _ : ptr _ _ : stream_state _ : bool ⇒ False
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–reflexivity

2 open

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–reflexivity

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
▷∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

–iNext

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
∗
∀n : Z ys : listZ, ⌜0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat⌝ −∗ ptsclosed_psT.out −∗ ptsbyte_ps5120 0 ys −∗ WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

iIntros n ys %Hgood Ho Herrno

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hgood :
0 ≤ n < 2 ^ 32 ∧ Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

destruct Hgood as Hn Hys

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
WPH.LG.L.ERunfr_fn ≔ stub; fr_env ≔ putTAtom"r" WIntn entry_env; fr_locals ≔ [ ]; fr_doomed ≔ None; fr_at ≔ ExecTAtom"body" [ ] JRetTmpTAtom"r" {result. ∃n0 : Z ys0 : listZ, ⌜result = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0}

iApply wp_retregistry close_wi ge stub _ TAtom"body" TmpTAtom"r" W WIntn ; reflexivity | |

2 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
focused goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
▷∃n0 : Z ys0 : listZ, ⌜RetWIntn = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0

+change SomeWIntn mod 2 ^ 32 = SomeWIntn

2 open

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
⊢
SomeWIntn mod 2 ^ 32 = SomeWIntn
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
▷∃n0 : Z ys0 : listZ, ⌜RetWIntn = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0

rewrite Z.mod_small ; reflexivity | exact Hn

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
▷∃n0 : Z ys0 : listZ, ⌜RetWIntn = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0

+iNext

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
∃n0 : Z ys0 : listZ, ⌜RetWIntn = RetWIntn0 ∧ Datatypes.lengthys0 = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys0

iExists n, ys

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
Herrno :
ptsbyte_ps5120 0 ys
∗
⌜RetWIntn = RetWIntn ∧ Datatypes.lengthys = 4%nat⌝ ∗ ptsclosed_psT.out ∗ ptsbyte_ps5120 0 ys

iFrame

hlc :
has_lc
Σ :
gFunctors
invGS_gen0 :
invGS_genhlc Σ
gen_heapGS0 :
gen_heapGSpiece pval Σ
n :
Z
ys :
listZ
Hn :
0 ≤ n < 2 ^ 32
Hys :
Datatypes.lengthys = 4%nat
∗
⌜RetWIntn = RetWIntn ∧ Datatypes.lengthys = 4%nat⌝

auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
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 []
–intros m w h Hw
exact Hw
–intros s m w h tr vs s′ m′ w′ ys Hi Hl Hw Hlen Hnew
exact Hnew
–left
reflexivity
–reflexivity
–reflexivity
–reflexivity
–reflexivity
–reflexivity
–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 | |
+change SomeWIntn mod 2 ^ 32 = SomeWIntn
rewrite Z.mod_small ; reflexivity | exact Hn
+iNext
iExists n, ys
iFrame
auto