Fil-C on Nix

Filnix wiki

the formal campaign

rocq/theories/HelloWorld.v

One fixed-launch Hello world. The layout below is a model witness, not a fabricated exported name for libc's private getopt_data. Identifying it with the selected native image, including errno TLS, remains the trusted libc/startup binding. No runtime axiom supplies it.

From Stdlib Require Import String ZArith List Bool Lia
From stdpp Require Import list
From iris.base_logic.lib Require Import gen_heap
From Nanofil Require Import Term Syntax Values Memory Runtime Ops Semantics ExternalCalls ExternalMachine Startup Locale Stdio Shutdown Getopt Libc LibcStreams Pieces Heap ContractFrame StringLogic MemLogic LentLogic LocaleLogic GetoptLogic HelloModule HelloLeaf HelloName HelloReach HelloMain HelloStdio
Import ListNotations
Open Scope Z_scope
Open Scope list_scope
Arguments Z.add : simpl nomatch
Arguments Z.sub : simpl nomatch
Arguments Z.mul : simpl nomatch
20Module HelloWorld
21Module Reach ≔ HelloReach InterpRuntime

Shared getopt storage is not thread-local. Only the selected errno cell is the current thread's TLS binding. All native identities are disjoint from Hello's own image and the copied launch arguments.

26Definition parser: ptr ≔
mkPtr131072 Obj131072

Public optarg cell.

28Definition optarg_cell: ptr ≔
mkPtr131136 Obj131136

Public optind cell.

30Definition optind_cell: ptr ≔
mkPtr131152 Obj131152

Public opterr cell.

32Definition opterr_cell: ptr ≔
mkPtr131168 Obj131168

Public optopt cell.

34Definition optopt_cell: ptr ≔
mkPtr131184 Obj131184

The selected thread's errno cell.

36Definition errno_pointer: ptr ≔
mkPtr131200 Obj131200

Public stdout pointer cell.

38Definition out_cell: ptr ≔
mkPtr131216 Obj131216

Public stderr pointer cell.

40Definition err_cell: ptr ≔
mkPtr131232 Obj131232

Public full invocation-name cell, handed to main.

42Definition full_name_cell: ptr ≔
mkPtr131248 Obj131248

Public short invocation-name cell, handed to main.

44Definition short_name_cell: ptr ≔
mkPtr131264 Obj131264

The synthetic stdout FILE object.

46Definition out_handle: ptr ≔
mkPtr131328 Obj131328

The synthetic stderr FILE object.

48Definition err_handle: ptr ≔
mkPtr131584 Obj131584

Borrowed initial C-locale name.

50Definition locale_pointer: ptr ≔
mkPtr131840 Ro131840

The launch's empty environment vector.

52Definition environment_pointer: ptr ≔
mkPtr131856 Obj131856

Only the actual public data imports extend Hello's symbol map.

55Definition globals: listname × ptr ≔
TAtom"stdout", out_cell; TAtom"stderr", err_cell; TAtom"program_invocation_name", full_name_cell; TAtom"program_invocation_short_name", short_name_cell; TAtom"optarg", optarg_cell; TAtom"optind", optind_cell

Hello's own symbols together with its public libc data imports.

61Definition ge: genv ≔

The two launch strings and their copied writable vector.

64Definition arguments: listargument ≔
mkArgumentmkPtr196640 Obj196640 196640 mkRegion196640 196656 Heap Live 104; 101; 108; 108; 111; mkArgumentmkPtr196672 Obj196672 196672 mkRegion196672 196688 Heap Live 45; 45; 118; 101; 114; 115; 105; 111; 110

The copied argv vector's object identity.

70Definition argv_base: Z ≔
196608

The actual getopt arguments for this fixed launch.

Exact private inventory, not merely membership of the parser root. Argv is deliberately absent: it is the program-owned output.

76Definition parser_roots: listspan ≔

Environment storage the parser may inspect on initialization.

78Definition parser_reads: listspan ≔

Fixed identities and exact private parser inventory.

A completed exact-option scan. The private continuation is decoded from memory, not named by an independent ghost phase. Bounds permit both the selected return and a subsequent end-of-options control.

89Definition parser_finishedm : mem g : getopt_world : Prop ≔
getopt_parser_storageparser m g ∧ getopt_optindg = 2 ∧ ptr_addrgetopt_optargg = 0 ∧ load_bytesm ptr_addrparser + 24 4 = 1 ∧ pointer_slotm ptr_addrparser + 32 null ∧ 0 ≤ load_bytesm ptr_addrparser + 40 4 ≤ 2 ∧ ∃bound, 1 ≤ bound ≤ 2 ∧ load_bytesm ptr_addrparser + 44 4 = bound ∧ load_bytesm ptr_addrparser + 48 4 = bound

Ordinary coherent cutpoints for this launch only. Running resource prefixes do not inherit this disjunction. Errno is sampled through getopt_state_at; it is not frozen across locale or output calls.

Positive argument/input facts are essential here: getopt_step existentially quantifies a transition without requiring an invoke. A false argument guard must never admit a spurious return code.

110Definition selected_transitionxs m w _ : listZ trace : listevent values m′ w′ : Prop ≔

The physical native component has no ghost heap, returned code or call-restoration law. FILE/native realization is still the libc trust boundary; these are the concrete model's coherent views.

Private identities exclude caller memory pieces, including life pieces. This main-stage interpretation owns neither FILE lives nor errno bytes. Callback acquisition is a distinct later operation.

One composite interpretation. Current ghost names observe the same payload as physical locale/parser/FILE readiness. Native pools must stay apart from the program, but getopt's public argv writes are intentionally not classified as private roots.

The initial ghost token rules out the finished cutpoint by its public optind, exposing the actual decoded fresh private storage.

158Lemma first_call_fresh
∀ m w h
wim w h
∀l v, l, v ∈ getopt_psnull 1 → h !! l = Somev
Explore proof 6 tactics

Initial goal

⊢
∀m : mem w : libc_world h : gmappiece pval, wim w h → ∀l : piece v : pval, l, v ∈ getopt_psnull 1 → h !! l = Somev → getopt_parser_freshparser m libc_getopt_vieww

intros m w h Hnative & _ & _ & _ & _ & Hcurrent Htoken

m :
h :
Hnative :
Htoken :
∀l : piece v : pval, l, v ∈ getopt_psnull 1 → h !! l = Somev

destruct Hnative as _ & _ & _ & Hfresh | Hfinished & _ ; exact Hfresh |

m :
h :
Htoken :
∀l : piece v : pval, l, v ∈ getopt_psnull 1 → h !! l = Somev

assert Hin : PNamegetopt_key, VGetoptnull 1 ∈ getopt_psnull 1 by constructor

destruct Hcurrentnull 1 Htoken_ _ Hin as _ Hi

destruct Hfinished as _ & Hi′ & _

congruence

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros m w h Hnative & _ & _ & _ & _ & Hcurrent Htoken
destruct Hnative as _ & _ & _ & Hfresh | Hfinished & _ ; exact Hfresh |
assert Hin : PNamegetopt_key, VGetoptnull 1 ∈ getopt_psnull 1 by constructor
destruct Hcurrentnull 1 Htoken_ _ Hin as _ Hi
destruct Hfinished as _ & Hi′ & _
congruence

This is the selection implication main_to_version consumes. It applies to every transition witness, not only to admitted invokes.

173Lemma first_call_selected
∀ xs m w h born trace values m′ w′
wim w h
∀l v, l, v ∈ getopt_psnull 1 → h !! l = Somev
selected_transitionxs m w born trace values m′ w′
values = WInt129
Explore proof 2 tactics

Initial goal

⊢
∀xs : listword m : mem w : libc_world h : gmappiece pval born : listZ trace : listevent values : listword m′ : mem w′ : libc_world, wim w h → ∀l : piece v : pval, l, v ∈ getopt_psnull 1 → h !! l = Somev → selected_transitionxs m w born trace values m′ w′ → values = WInt129

intros xs m w h born trace values m′ w′ Hw Htoken _ & _ & Hselected & _

xs :
listword
m :
h :
born :
listZ
trace :
listevent
values :
listword
m′ :
Hw :
wim w h
Htoken :
∀l : piece v : pval, l, v ∈ getopt_psnull 1 → h !! l = Somev
⊢
values = WInt129

exact proj1Hselectedfirst_call_fresh_ _ _ Hw Htoken

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros xs m w h born trace values m′ w′ Hw Htoken _ & _ & Hselected & _
exact proj1Hselectedfirst_call_fresh_ _ _ Hw Htoken

One joint model image extends, rather than replaces, the actual linked initializer. Its private parser starts zero-initialized; public optopt starts at '?' independently of that private copy.

185Definition native_regions: listregion ≔
mkRegion131072 131128 GlobalData Live; mkRegion131136 131144 GlobalData Live; mkRegion131152 131156 GlobalData Live; mkRegion131168 131172 GlobalData Live; mkRegion131184 131188 GlobalData Live; mkRegion131200 131204 GlobalData Live; mkRegion131216 131224 GlobalData Live; mkRegion131232 131240 GlobalData Live; mkRegion131248 131256 GlobalData Live; mkRegion131264 131272 GlobalData Live; mkRegion131328 131584 GlobalData Live; mkRegion131584 131840 GlobalData Live; mkRegion131840 131842 GlobalData Live; mkRegion131856 131864 GlobalData Live

Program-owned launch regions, outside the linked image.

201Definition launch_regions: listregion ≔

Keep the linked initializer below the native/launch allocation band.

204Definition image_seed: mem ≔

Address, width and integer value for each nonzero startup store.

209Definition image_words: listZ × Z × Z ≔
131152, 4, 1; 131168, 4, 1; 131184, 4, 63; 131216, 8, 131328; 131232, 8, 131584; 131248, 8, 196640; 131264, 8, 196640; 131840, 1, 67; 196608, 8, 196640; 196616, 8, 196672; 196640, 1, 104; 196641, 1, 101; 196642, 1, 108; 196643, 1, 108; 196644, 1, 111; 196672, 1, 45; 196673, 1, 45; 196674, 1, 118; 196675, 1, 101; 196676, 1, 114; 196677, 1, 115; 196678, 1, 105; 196679, 1, 111; 196680, 1, 110

Capabilities written by the six nonnull pointer stores.

220Definition image_pointers: listZ × cap ≔
131216, Obj131328; 131232, Obj131584; 131248, Obj196640; 131264, Obj196640; 196608, Obj196640; 196616, Obj196672

The single physical entry image; scalar folds avoid expanding memory records underneath symbolic addresses during certificate checking.

226Definition entry_memory: mem ≔
λ a  ⇒
fold_right
λ aw old  ⇒
fstfstaw ≤? a && a <? fstfstaw + sndfstaw
→
byte_ofsndaw a − fstfstaw
else
old
λ a  ⇒
fold_right
λ ac old  ⇒
a =? fstac
→
sndac
else
old

Initial C-locale observation and its private name storage.

237Definition entry_locale: locale_world ≔
mkLocaleWorld0 λ_ ⇒ locale_pointer λ_ ⇒ 67 TAtom"C" mkSpanlocale_pointer 2 [ ] [ ]

Public initial values and the private parser's exact authorities.

Structural stdout representation with no pending bytes.

245Definition entry_out: libc_file ≔

Structural stderr representation with no pending bytes.

247Definition entry_err: libc_file ≔

One shared payload, errno cell and authoritative shutdown inventory.

Opaque hello_literal_memory
257Ltac image_bounds  ≔
repeat match goal with|- context [Z.leb?a ?b]⇒destruct Z.leb_speca b ; cbn ; try lia|- context [Z.ltb?a ?b]⇒destruct Z.ltb_speca b ; cbn ; try lia|- context [Z.eqb?a ?b]⇒destruct Z.eqb_speca b ; subst ; cbn ; try liaend

Outside startup writes, the seed's byte is preserved.

265Lemma entry_bytes_unwritten
∀ a
Forallλaw ⇒ a < fstfstaw ∨ fstfstaw + sndfstaw ≤ a image_words
Explore proof 18 tactics

Initial goal

⊢
∀ a : Z  ,
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a image_words
→

intros a Houtside

a :
Z
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a image_words

change fold_rightλaw old ⇒ if fstfstaw ≤? a && a <? fstfstaw + sndfstaw then byte_ofsndaw a − fstfstaw else old m_bytesimage_seed a image_words = m_bytesimage_seed a

a :
Z
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a image_words
⊢
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
=

generalize dependent image_words

a :
Z
⊢
∀ l : listZ × Z × Z  ,
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a l
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
l
=

intros ws

a :
Z
ws :
listZ × Z × Z
⊢
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

induction ws as | p n x ws IH ; intros Houtside ; reflexivity |

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
⊢
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
p, n, x :: ws
=

inversion Houtside as [ |? ? Hspan Htail ] ; subst

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
p, n, x :: ws
=

change if p ≤? a && a <? p + n then byte_ofx a − p else fold_rightλaw old ⇒ if fstfstaw ≤? a && a <? fstfstaw + sndfstaw then byte_ofsndaw a − fstfstaw else old m_bytesimage_seed a ws = m_bytesimage_seed a

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

assert Htest : p ≤? a && a <? p + n = false

2 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a && a <? p + n = false
focused goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

{apply andb_false_iff

2 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

destruct Hspan as Hspan | Hspan

3 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
focused goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

–left

3 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

apply Z.leb_gt

3 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
a < p
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

exact Hspan

2 open

deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p ≤? a = false ∨ a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

–right

2 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
a <? p + n = false
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

apply Z.ltb_ge

2 open

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
⊢
p + n ≤ a
deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

exact Hspan

deferred goal
a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
p ≤? a && a <? p + n
→
byte_ofx a − p
else
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

rewrite Htest

a, p, n, x :
Z
ws :
listZ × Z × Z
IH :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
→
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=
Houtside :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a p, n, x :: ws
Hspan :
a < p, n, x.1.1 ∨ p, n, x.1.1 + p, n, x.1.2 ≤ a
Htail :
Forallλaw : Z × Z × Z ⇒ a < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ a ws
Htest :
p ≤? a && a <? p + n = false
⊢
foldr
λ aw : Z × Z × Z old : Z  ⇒
aw.1.1 ≤? a && a <? aw.1.1 + aw.1.2
→
byte_ofaw.2 a − aw.1.1
else
old
ws
=

exact IHHtail

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a Houtside
change fold_rightλaw old ⇒ if fstfstaw ≤? a && a <? fstfstaw + sndfstaw then byte_ofsndaw a − fstfstaw else old m_bytesimage_seed a image_words = m_bytesimage_seed a
generalize dependent image_words
intros ws
induction ws as | p n x ws IH ; intros Houtside ; reflexivity |
inversion Houtside as [ |? ? Hspan Htail ] ; subst
change if p ≤? a && a <? p + n then byte_ofx a − p else fold_rightλaw old ⇒ if fstfstaw ≤? a && a <? fstfstaw + sndfstaw then byte_ofsndaw a − fstfstaw else old m_bytesimage_seed a ws = m_bytesimage_seed a
assert Htest : p ≤? a && a <? p + n = false
{apply andb_false_iff
destruct Hspan as Hspan | Hspan
–left
apply Z.leb_gt
exact Hspan
–right
apply Z.ltb_ge
exact Hspan
rewrite Htest
exact IHHtail

The entire private parser is zero-initialized, byte by byte.

290Lemma entry_parser_zero
∀ i
0 ≤ i < 56
Explore proof 7 tactics

Initial goal

⊢
∀i : Z, 0 ≤ i < 56 → m_bytesentry_memory ptr_addrparser + i = 0

intros i Hi

i :
Z
Hi :
0 ≤ i < 56

rewrite entry_bytes_unwritten

2 open

i :
Z
Hi :
0 ≤ i < 56
focused goal
i :
Z
Hi :
0 ≤ i < 56
⊢
Forallλaw : Z × Z × Z ⇒ ptr_addrparser + i < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ ptr_addrparser + i image_words

–unfold parser ; cbn [ ptr_addr ]

2 open

i :
Z
Hi :
0 ≤ i < 56
⊢
131072 + i <? 131072
→
else
0
=
0
deferred goal
i :
Z
Hi :
0 ≤ i < 56
⊢
Forallλaw : Z × Z × Z ⇒ ptr_addrparser + i < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ ptr_addrparser + i image_words

destruct Z.ltb_spec131072 + i 131072 ; lia | reflexivity

deferred goal
i :
Z
Hi :
0 ≤ i < 56
⊢
Forallλaw : Z × Z × Z ⇒ ptr_addrparser + i < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ ptr_addrparser + i image_words

–change Forallλaw ⇒ 131072 + i < fstfstaw ∨ fstfstaw + sndfstaw ≤ 131072 + i image_words

i :
Z
Hi :
0 ≤ i < 56
⊢
Forallλaw : Z × Z × Z ⇒ 131072 + i < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ 131072 + i image_words

repeat apply List.Forall_cons ; cbn [ fst snd ] ; lia |

i :
Z
Hi :
0 ≤ i < 56
⊢
Forallλaw : Z × Z × Z ⇒ 131072 + i < aw.1.1 ∨ aw.1.1 + aw.1.2 ≤ 131072 + i [ ]

constructor

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros i Hi
–unfold parser ; cbn [ ptr_addr ]
destruct Z.ltb_spec131072 + i 131072 ; lia | reflexivity
–change Forallλaw ⇒ 131072 + i < fstfstaw ∨ fstfstaw + sndfstaw ≤ 131072 + i image_words
repeat apply List.Forall_cons ; cbn [ fst snd ] ; lia |
constructor

Freshness decodes the initialized word from the joint physical image.

Explore proof 20 tactics

Initial goal

split

2 open

focused goal

–split ; left ; reflexivity |

2 open

deferred goal

split

3 open

focused goal
deferred goal

+split ; simpl ; lia |

3 open

⊢
∃base : Z reg : region, ptr_capparser = Objbase ∨ ptr_capparser = Robase ∧ object_regionbase m_regionsentry_memory = Somereg ∧ r_lifereg = Live ∧ access_resentry_memory ptr_addrparser ptr_capparser 56 Read 1 = Someok ∧ ∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

split

4 open

⊢
∃base : Z reg : region, ptr_capparser = Objbase ∨ ptr_capparser = Robase ∧ object_regionbase m_regionsentry_memory = Somereg ∧ r_lifereg = Live
focused goal
⊢
access_resentry_memory ptr_addrparser ptr_capparser 56 Read 1 = Someok ∧ ∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

∗exists 131072, mkRegion131072 131128 GlobalData Live

4 open

⊢
ptr_capparser = Obj131072 ∨ ptr_capparser = Ro131072 ∧ object_region131072 m_regionsentry_memory = Somer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live ∧ r_lifer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live = Live
deferred goal
⊢
access_resentry_memory ptr_addrparser ptr_capparser 56 Read 1 = Someok ∧ ∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

split ; left ; reflexivity |

4 open

⊢
object_region131072 m_regionsentry_memory = Somer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live ∧ r_lifer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live = Live
deferred goal
⊢
access_resentry_memory ptr_addrparser ptr_capparser 56 Read 1 = Someok ∧ ∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

split ; reflexivity

3 open

deferred goal
⊢
access_resentry_memory ptr_addrparser ptr_capparser 56 Read 1 = Someok ∧ ∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

∗split ; reflexivity |

3 open

⊢
∀i : Z, 0 ≤ i < 56 → 0 ≤ m_bytesentry_memory ptr_addrparser + i < 256
deferred goal
deferred goal

intros i Hi

3 open

i :
Z
Hi :
0 ≤ i < 56
⊢
deferred goal
deferred goal

rewrite entry_parser_zeroi Hi

3 open

i :
Z
Hi :
0 ≤ i < 56
⊢
0 ≤ 0 < 256
deferred goal
deferred goal

lia

2 open

deferred goal
deferred goal

+split

3 open

focused goal
deferred goal

∗split ; simpl ; lia |

3 open

⊢
∃base : Z reg : region, ptr_capspan_ptrspan_ptr ≔ parser; span_size ≔ 56 = Objbase ∧ object_regionbase m_regionsentry_memory = Somereg ∧ r_lifereg = Live ∧ access_resentry_memory ptr_addrspan_ptrspan_ptr ≔ parser; span_size ≔ 56 Objbase span_sizespan_ptr ≔ parser; span_size ≔ 56 Write 1 = Someok
deferred goal
deferred goal

exists 131072, mkRegion131072 131128 GlobalData Live

3 open

⊢
ptr_capspan_ptrspan_ptr ≔ parser; span_size ≔ 56 = Obj131072 ∧ object_region131072 m_regionsentry_memory = Somer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live ∧ r_lifer_base ≔ 131072; r_end ≔ 131128; r_kind ≔ GlobalData; r_life ≔ Live = Live ∧ access_resentry_memory ptr_addrspan_ptrspan_ptr ≔ parser; span_size ≔ 56 Obj131072 span_sizespan_ptr ≔ parser; span_size ≔ 56 Write 1 = Someok
deferred goal
deferred goal

repeat split ; reflexivity

2 open

deferred goal
deferred goal

∗reflexivity

deferred goal

–split ; reflexivity |

change load_bytesentry_memory 131096 4 = 0

⊢

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–split ; left ; reflexivity |
split
+split ; simpl ; lia |
split
∗exists 131072, mkRegion131072 131128 GlobalData Live
split ; left ; reflexivity |
split ; reflexivity
∗split ; reflexivity |
intros i Hi
rewrite entry_parser_zeroi Hi
lia
+split
∗split ; simpl ; lia |
exists 131072, mkRegion131072 131128 GlobalData Live
repeat split ; reflexivity
∗reflexivity
–split ; reflexivity |
change load_bytesentry_memory 131096 4 = 0
reflexivity
321Ltac entry_writable  ≔
split ; cbn [ span_size ] ; lia | ; eexists ; eexists ; split ; reflexivity | ; split ; reflexivity | ; split ; reflexivity
326Ltac entry_pointer  ≔
split ; entry_writable | ; split ; reflexivity | ; split ; reflexivity | ; split ; cbv [ ptr_addr null out_handle err_handle entry_parser getopt_optarg ] ; lia | ; split ; reflexivity
331Ltac entry_int  ≔
split ; unfold getopt_int ; cbn [ entry_parser getopt_optind getopt_opterr getopt_optopt getopt_errno ] ; lia | ; split ; entry_writable | ; split ; reflexivity | ; split ; reflexivity

All public getopt observations, including sampled errno, are coherent.

Explore proof 4 tactics

Both imported stream cells expose the corresponding FILE capability.

Explore proof 1 tactics

Initial goal

split ; entry_pointer

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script

The empty environment is a readable sentinel-terminated vector.

Explore proof 3 tactics

Initial goal

split ; reflexivity |

split ; cbn ; lia |

split ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split ; reflexivity |
split ; cbn ; lia |
split ; reflexivity

No synthetic FILE shadow slot delegates an external object.

355Lemma entry_file_aux
∀ a
131328 ≤ a < 131840
Explore proof 3 tactics

Initial goal

⊢
∀a : Z, 131328 ≤ a < 131840 → m_auxentry_memory a = CNone

intros a Ha

a :
Z
Ha :
131328 ≤ a < 131840

cbn [ entry_memory image_pointers fold_right fst snd m_aux image_seed ]

a :
Z
Ha :
131328 ≤ a < 131840
⊢
a =? 131216
→
Obj131328
a =? 131232
→
Obj131584
a =? 131248
→
Obj196640
a =? 131264
→
Obj196640
a =? 196608
→
Obj196640
a =? 196616
→
Obj196672
a <? 131072
→
else
=

image_bounds ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a Ha
cbn [ entry_memory image_pointers fold_right fst snd m_aux image_seed ]
image_bounds ; reflexivity

Neither FILE owns or reaches the shared errno cell.

362Lemma entry_file_errno
∀ a
a = 131328 ∨ a = 131584
Explore proof 13 tactics

Initial goal

⊢
∀a : Z, a = 131328 ∨ a = 131584 → file_errno_apartentry_memory errno_pointer file_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ]

intros a Ha

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢

split

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀root : span, Inroot file_rootsfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] → spans_apartroot span_ptr ≔ errno_pointer; span_size ≔ 4
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀base : Z, ptr_caperrno_pointer = Objbase ∨ ptr_caperrno_pointer = Robase → ¬Inbase file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Objbase ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Robase

–intros root [ <-| [ ] ]

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
deferred goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀base : Z, ptr_caperrno_pointer = Objbase ∨ ptr_caperrno_pointer = Robase → ¬Inbase file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Objbase ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Robase

unfold spans_apart

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
deferred goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀base : Z, ptr_caperrno_pointer = Objbase ∨ ptr_caperrno_pointer = Robase → ¬Inbase file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Objbase ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Robase

cbn [ span_ptr span_size ptr_addr errno_pointer ]

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
a + 256 ≤ 131200 ∨ 131200 + 4 ≤ a
deferred goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀base : Z, ptr_caperrno_pointer = Objbase ∨ ptr_caperrno_pointer = Robase → ¬Inbase file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Objbase ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Robase

lia

deferred goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
∀base : Z, ptr_caperrno_pointer = Objbase ∨ ptr_caperrno_pointer = Robase → ¬Inbase file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Objbase ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Robase

–intros b Hb | Hb ; injection Hb as <-| discriminate

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
¬In131200 file_ownedfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Obj131200 ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Ro131200

split ; intros |

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Obj131200 ∧ ¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Ro131200

split

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Obj131200
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
⊢
¬available_capfile_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ] [ ] entry_memory Ro131200

all: intros Hnone | source & Hin & Hcap | source & addr & Hin & Haddr & Hsize & _ & Haux | b & & _ ; try discriminate

4 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
source :
Hin :
Insource file_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ]
Hcap :
Obj131200 = ptr_capspan_ptrsource
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
source :
addr :
Z
Hin :
Insource file_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ]
Haddr :
span_containssource addr
Hsize :
addr + 8 ≤ ptr_addrspan_ptrsource + span_sizesource
Haux :
Obj131200 = m_auxentry_memory addr
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
source :
Hin :
Insource file_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ]
Hcap :
Ro131200 = ptr_capspan_ptrsource
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
source :
addr :
Z
Hin :
Insource file_sourcesfile_handle ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; file_pending ≔ 0; file_reads ≔ [ ]; file_roots ≔ span_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256; file_owned ≔ [ ]
Haddr :
span_containssource addr
Hsize :
addr + 8 ≤ ptr_addrspan_ptrsource + span_sizesource
Haux :
Ro131200 = m_auxentry_memory addr
⊢
False

all: cbn [ file_sources file_handle file_reads file_roots app ] in Hin ; destruct Hin as [ <-| [ <-| [ ] ] ] ; cbn [ file_handle span_ptr ptr_cap span_size ptr_addr ] in * ; try discriminate ; try injection Hcap ; lia

4 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 0
Haddr :
span_containsspan_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 0 addr
Haux :
Obj131200 = m_auxentry_memory addr
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 256
Haddr :
span_containsspan_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256 addr
Haux :
Obj131200 = m_auxentry_memory addr
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 0
Haddr :
span_containsspan_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 0 addr
Haux :
Ro131200 = m_auxentry_memory addr
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 256
Haddr :
span_containsspan_ptr ≔ ptr_addr ≔ a; ptr_cap ≔ Obja; span_size ≔ 256 addr
Haux :
Ro131200 = m_auxentry_memory addr
⊢
False

all: unfold span_contains in Haddr ; cbn [ file_handle span_ptr span_size ptr_addr ] in Haddr ; try lia

2 open

a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 256
Haddr :
a ≤ addr < a + 256
Haux :
Obj131200 = m_auxentry_memory addr
⊢
False
focused goal
a :
Z
Ha :
a = 131328 ∨ a = 131584
addr :
Z
Hsize :
addr + 8 ≤ a + 256
Haddr :
a ≤ addr < a + 256
Haux :
Ro131200 = m_auxentry_memory addr
⊢
False

all: rewrite entry_file_auxaddr ltac:lia in Haux ; discriminate

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a Ha
split
–intros root [ <-| [ ] ]
lia
–intros b Hb | Hb ; injection Hb as <-| discriminate
split ; intros |
split
all: intros Hnone | source & Hin & Hcap | source & addr & Hin & Haddr & Hsize & _ & Haux | b & & _ ; try discriminate
all: cbn [ file_sources file_handle file_reads file_roots app ] in Hin ; destruct Hin as [ <-| [ <-| [ ] ] ] ; cbn [ file_handle span_ptr ptr_cap span_size ptr_addr ] in * ; try discriminate ; try injection Hcap ; lia
all: unfold span_contains in Haddr ; cbn [ file_handle span_ptr span_size ptr_addr ] in Haddr ; try lia
all: rewrite entry_file_auxaddr ltac:lia in Haux ; discriminate

Both synthetic FILE objects meet structural capability readiness.

Proof 27 steps Qed
assert Hfile : ∀a, a = 131328 ∨ a = 131584 → libc_file_readyentry_memory errno_pointer mkLibcFilemkPtra Obja 0 [ ] mkSpanmkPtra Obja 256 [ ]
{intros a Ha
split ; cbn ; lia |
split
–destruct Ha as → | → ; split ; simpl ; lia | | simpl ; lia | ; split
+exists 131328, mkRegion131328 131584 GlobalData Live
split ; left ; reflexivity |
split ; reflexivity
+split ; reflexivity |
intros i Hi
assert i = 0 as → by lia
change 0 ≤ 0 < 256
lia
+exists 131584, mkRegion131584 131840 GlobalData Live
split ; left ; reflexivity |
split ; reflexivity
+split ; reflexivity |
intros i Hi
assert i = 0 as → by lia
change 0 ≤ 0 < 256
lia
–split ; simpl ; lia |
split
+constructor ; destruct Ha as → | → ; entry_writable | constructor
+split ; constructor |
split ; constructor | apply entry_file_errno ; exact Ha
split ; apply Hfile ; auto

Exact pointer-slot capabilities, with empty interior shadow slots.

405Definition argv_aux: listcap ≔
Obj196640 :: replicate7 CNone ++ Obj196672 :: replicate7 CNone ++ replicate8 CNone

The full three-slot argv allocation.

408Definition argv_region: region ≔

Hello's own program_name cell, from its linked initializer.

410Definition name_region: region ≔

The full invocation-name cell's allocation.

412Definition full_region: region ≔
mkRegion131248 131256 GlobalData Live

The short invocation-name cell's allocation.

414Definition short_region: region ≔
mkRegion131264 131272 GlobalData Live

Ownership of all three cells consumed by Hello's name setup.

416Definition name_pieces: listpiece × pval ≔
PLive66080, VLivename_region :: cell66080 0 0 ++ PAux66080 0, VAuxCNone ++ PLive131248, VLivefull_region :: cell131248 0 196640 ++ PAux131248 0, VAuxObj196640 ++ PLive131264, VLiveshort_region :: cell131264 0 196640 ++ PAux131264 0, VAuxObj196640

One resource bundle for main's selected version path.

The single ghost heap holding that resource bundle.

429Definition entry_heap: gmappiece pval ≔
Transparent hello_literal_memory

These pieces supply main_to_version's resources, not separate per-contract admissions. In particular the full argv block, actual strings, name cells, locale names and output literals coexist.

436Lemma entry_keys_unique
NoDupmapfst entry_pieces
Explore proof 4 tactics

Initial goal

⊢
NoDupmapfst entry_pieces

pose eqp := ltac:intros x y ; change x = y + x ≠ y ; decide equality ; apply Z.eq_dec : EqDecisionpiece

eqp :=
λx y : piece ⇒ piece_recλx0 : piece ⇒ ∀x1 : piece, x0 = x1 + x0 ≠ x1 λb : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PLiveb = PLiveb1 + PLiveb ≠ PLiveb1 λa : b = b1 ⇒ lefteq_ind_rλb2 : Z ⇒ PLiveb2 = PLiveb1 eq_refl a λdiseq : b ≠ b1 ⇒ rightλabsurd : PLiveb = PLiveb1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PLiveb2 ⇒ b2 | _ ⇒ b end absurd in λH0 : b = b1 ⇒ H0H : PLiveb ≠ PLiveb1 Z.eq_decb b1b0 | PByteb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PByteb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PByteb1 o0 H in False_indFalse H0 : PLiveb ≠ PByteb1 o0b0 o | PAuxb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PAuxb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PAuxb1 o0 H in False_indFalse H0 : PLiveb ≠ PAuxb1 o0b0 o | PNamek ⇒ λk0 : Z ⇒ rightλH : PLiveb = PNamek0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PLiveb ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PByteb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PByteb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PByteb2 o = PByteb1 o1 eq_ind_rλo2 : Z ⇒ PByteb1 o2 = PByteb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PByteb2 o ≠ PByteb1 o1 λabsurd : PByteb1 o = PByteb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PByteb1 o ≠ PByteb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PByteb o = PByteb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PByteb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PByteb o ≠ PByteb1 o1 Z.eq_decb b1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PByteb o = PAuxb1 o1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PAuxb1 o1 H in False_indFalse H0 : PByteb o ≠ PAuxb1 o1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PByteb o = PNamek0 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PByteb o ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PAuxb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PAuxb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PAuxb o = PByteb1 o1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PByteb1 o1 H in False_indFalse H0 : PAuxb o ≠ PByteb1 o1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PAuxb2 o = PAuxb1 o1 eq_ind_rλo2 : Z ⇒ PAuxb1 o2 = PAuxb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PAuxb2 o ≠ PAuxb1 o1 λabsurd : PAuxb1 o = PAuxb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PAuxb1 o ≠ PAuxb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PAuxb o = PAuxb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PAuxb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PAuxb o ≠ PAuxb1 o1 Z.eq_decb b1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PAuxb o = PNamek0 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PAuxb o ≠ PNamek0k end λk : Z x0 : piece ⇒ match x0 as p with PLiveb ⇒ λb0 : Z ⇒ rightλH : PNamek = PLiveb0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PLiveb0 H in False_indFalse H0 : PNamek ≠ PLiveb0b | PByteb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PByteb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PByteb0 o0 H in False_indFalse H0 : PNamek ≠ PByteb0 o0b o | PAuxb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PAuxb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PAuxb0 o0 H in False_indFalse H0 : PNamek ≠ PAuxb0 o0b o | PNamek0 ⇒ λk1 : Z ⇒ sumbool_recλ_ : k = k1 + k ≠ k1 ⇒ PNamek = PNamek1 + PNamek ≠ PNamek1 λa : k = k1 ⇒ lefteq_ind_rλk2 : Z ⇒ PNamek2 = PNamek1 eq_refl a λdiseq : k ≠ k1 ⇒ rightλabsurd : PNamek = PNamek1 ⇒ diseqlet H : k = k1 ≔ f_equalλe : piece ⇒ match e with PNamek2 ⇒ k2 | _ ⇒ k end absurd in λH0 : k = k1 ⇒ H0H : PNamek ≠ PNamek1 Z.eq_deck k1k0 end x y : EqDecisionpiece : EqDecisionpiece : EqDecisionpiece
⊢
NoDupmapfst entry_pieces

apply @bool_decide_eq_true_ @NoDup_decpiece eqp _

eqp :=
λx y : piece ⇒ piece_recλx0 : piece ⇒ ∀x1 : piece, x0 = x1 + x0 ≠ x1 λb : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PLiveb = PLiveb1 + PLiveb ≠ PLiveb1 λa : b = b1 ⇒ lefteq_ind_rλb2 : Z ⇒ PLiveb2 = PLiveb1 eq_refl a λdiseq : b ≠ b1 ⇒ rightλabsurd : PLiveb = PLiveb1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PLiveb2 ⇒ b2 | _ ⇒ b end absurd in λH0 : b = b1 ⇒ H0H : PLiveb ≠ PLiveb1 Z.eq_decb b1b0 | PByteb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PByteb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PByteb1 o0 H in False_indFalse H0 : PLiveb ≠ PByteb1 o0b0 o | PAuxb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PAuxb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PAuxb1 o0 H in False_indFalse H0 : PLiveb ≠ PAuxb1 o0b0 o | PNamek ⇒ λk0 : Z ⇒ rightλH : PLiveb = PNamek0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PLiveb ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PByteb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PByteb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PByteb2 o = PByteb1 o1 eq_ind_rλo2 : Z ⇒ PByteb1 o2 = PByteb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PByteb2 o ≠ PByteb1 o1 λabsurd : PByteb1 o = PByteb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PByteb1 o ≠ PByteb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PByteb o = PByteb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PByteb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PByteb o ≠ PByteb1 o1 Z.eq_decb b1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PByteb o = PAuxb1 o1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PAuxb1 o1 H in False_indFalse H0 : PByteb o ≠ PAuxb1 o1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PByteb o = PNamek0 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PByteb o ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PAuxb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PAuxb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PAuxb o = PByteb1 o1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PByteb1 o1 H in False_indFalse H0 : PAuxb o ≠ PByteb1 o1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PAuxb2 o = PAuxb1 o1 eq_ind_rλo2 : Z ⇒ PAuxb1 o2 = PAuxb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PAuxb2 o ≠ PAuxb1 o1 λabsurd : PAuxb1 o = PAuxb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PAuxb1 o ≠ PAuxb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PAuxb o = PAuxb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PAuxb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PAuxb o ≠ PAuxb1 o1 Z.eq_decb b1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PAuxb o = PNamek0 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PAuxb o ≠ PNamek0k end λk : Z x0 : piece ⇒ match x0 as p with PLiveb ⇒ λb0 : Z ⇒ rightλH : PNamek = PLiveb0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PLiveb0 H in False_indFalse H0 : PNamek ≠ PLiveb0b | PByteb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PByteb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PByteb0 o0 H in False_indFalse H0 : PNamek ≠ PByteb0 o0b o | PAuxb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PAuxb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PAuxb0 o0 H in False_indFalse H0 : PNamek ≠ PAuxb0 o0b o | PNamek0 ⇒ λk1 : Z ⇒ sumbool_recλ_ : k = k1 + k ≠ k1 ⇒ PNamek = PNamek1 + PNamek ≠ PNamek1 λa : k = k1 ⇒ lefteq_ind_rλk2 : Z ⇒ PNamek2 = PNamek1 eq_refl a λdiseq : k ≠ k1 ⇒ rightλabsurd : PNamek = PNamek1 ⇒ diseqlet H : k = k1 ≔ f_equalλe : piece ⇒ match e with PNamek2 ⇒ k2 | _ ⇒ k end absurd in λH0 : k = k1 ⇒ H0H : PNamek ≠ PNamek1 Z.eq_deck k1k0 end x y : EqDecisionpiece : EqDecisionpiece : EqDecisionpiece
⊢
bool_decideNoDupmapfst entry_pieces = true

vm_compute

eqp :=
λx y : piece ⇒ piece_recλx0 : piece ⇒ ∀x1 : piece, x0 = x1 + x0 ≠ x1 λb : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PLiveb = PLiveb1 + PLiveb ≠ PLiveb1 λa : b = b1 ⇒ lefteq_ind_rλb2 : Z ⇒ PLiveb2 = PLiveb1 eq_refl a λdiseq : b ≠ b1 ⇒ rightλabsurd : PLiveb = PLiveb1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PLiveb2 ⇒ b2 | _ ⇒ b end absurd in λH0 : b = b1 ⇒ H0H : PLiveb ≠ PLiveb1 Z.eq_decb b1b0 | PByteb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PByteb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PByteb1 o0 H in False_indFalse H0 : PLiveb ≠ PByteb1 o0b0 o | PAuxb0 o ⇒ λb1 o0 : Z ⇒ rightλH : PLiveb = PAuxb1 o0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PAuxb1 o0 H in False_indFalse H0 : PLiveb ≠ PAuxb1 o0b0 o | PNamek ⇒ λk0 : Z ⇒ rightλH : PLiveb = PNamek0 ⇒ let H0 : False ≔ eq_indPLiveb λe : piece ⇒ match e with PLive_ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PLiveb ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PByteb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PByteb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PByteb o = PByteb1 o1 + PByteb o ≠ PByteb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PByteb2 o = PByteb1 o1 eq_ind_rλo2 : Z ⇒ PByteb1 o2 = PByteb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PByteb2 o ≠ PByteb1 o1 λabsurd : PByteb1 o = PByteb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PByteb1 o ≠ PByteb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PByteb o = PByteb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PByteb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PByte_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PByteb o ≠ PByteb1 o1 Z.eq_decb b1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PByteb o = PAuxb1 o1 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PAuxb1 o1 H in False_indFalse H0 : PByteb o ≠ PAuxb1 o1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PByteb o = PNamek0 ⇒ let H0 : False ≔ eq_indPByteb o λe : piece ⇒ match e with PByte_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PByteb o ≠ PNamek0k end λb o : Z x0 : piece ⇒ match x0 as p with PLiveb0 ⇒ λb1 : Z ⇒ rightλH : PAuxb o = PLiveb1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PLiveb1 H in False_indFalse H0 : PAuxb o ≠ PLiveb1b0 | PByteb0 o0 ⇒ λb1 o1 : Z ⇒ rightλH : PAuxb o = PByteb1 o1 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PByteb1 o1 H in False_indFalse H0 : PAuxb o ≠ PByteb1 o1b0 o0 | PAuxb0 o0 ⇒ λb1 o1 : Z ⇒ sumbool_recλ_ : b = b1 + b ≠ b1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa : b = b1 ⇒ sumbool_recλ_ : o = o1 + o ≠ o1 ⇒ PAuxb o = PAuxb1 o1 + PAuxb o ≠ PAuxb1 o1 λa0 : o = o1 ⇒ lefteq_ind_rλb2 : Z ⇒ PAuxb2 o = PAuxb1 o1 eq_ind_rλo2 : Z ⇒ PAuxb1 o2 = PAuxb1 o1 eq_refl a0 a λdiseq : o ≠ o1 ⇒ righteq_ind_rλb2 : Z ⇒ PAuxb2 o ≠ PAuxb1 o1 λabsurd : PAuxb1 o = PAuxb1 o1 ⇒ diseqlet H : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λH0 : o = o1 ⇒ H0H : PAuxb1 o ≠ PAuxb1 o1 a Z.eq_deco o1 λdiseq : b ≠ b1 ⇒ rightλabsurd : PAuxb o = PAuxb1 o1 ⇒ diseqlet H : b = b1 ≔ f_equalλe : piece ⇒ match e with PAuxb2 _ ⇒ b2 | _ ⇒ b end absurd in let H0 : o = o1 ≔ f_equalλe : piece ⇒ match e with PAux_ o2 ⇒ o2 | _ ⇒ o end absurd in λ_ : o = o1 H1 : b = b1 ⇒ H1H0H : PAuxb o ≠ PAuxb1 o1 Z.eq_decb b1b0 o0 | PNamek ⇒ λk0 : Z ⇒ rightλH : PAuxb o = PNamek0 ⇒ let H0 : False ≔ eq_indPAuxb o λe : piece ⇒ match e with PAux_ _ ⇒ True | _ ⇒ False end I PNamek0 H in False_indFalse H0 : PAuxb o ≠ PNamek0k end λk : Z x0 : piece ⇒ match x0 as p with PLiveb ⇒ λb0 : Z ⇒ rightλH : PNamek = PLiveb0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PLiveb0 H in False_indFalse H0 : PNamek ≠ PLiveb0b | PByteb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PByteb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PByteb0 o0 H in False_indFalse H0 : PNamek ≠ PByteb0 o0b o | PAuxb o ⇒ λb0 o0 : Z ⇒ rightλH : PNamek = PAuxb0 o0 ⇒ let H0 : False ≔ eq_indPNamek λe : piece ⇒ match e with PName_ ⇒ True | _ ⇒ False end I PAuxb0 o0 H in False_indFalse H0 : PNamek ≠ PAuxb0 o0b o | PNamek0 ⇒ λk1 : Z ⇒ sumbool_recλ_ : k = k1 + k ≠ k1 ⇒ PNamek = PNamek1 + PNamek ≠ PNamek1 λa : k = k1 ⇒ lefteq_ind_rλk2 : Z ⇒ PNamek2 = PNamek1 eq_refl a λdiseq : k ≠ k1 ⇒ rightλabsurd : PNamek = PNamek1 ⇒ diseqlet H : k = k1 ≔ f_equalλe : piece ⇒ match e with PNamek2 ⇒ k2 | _ ⇒ k end absurd in λH0 : k = k1 ⇒ H0H : PNamek ≠ PNamek1 Z.eq_deck k1k0 end x y : EqDecisionpiece : EqDecisionpiece : EqDecisionpiece
⊢
true = true

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
pose eqp := ltac:intros x y ; change x = y + x ≠ y ; decide equality ; apply Z.eq_dec : EqDecisionpiece
apply @bool_decide_eq_true_ @NoDup_decpiece eqp _
vm_compute
reflexivity

A finite certificate checks the unique registered region rather than expanding a universally quantified region once per literal byte. Exact aux equality is sufficient for the weaker collector-aware agreement. This checker is only a proof device for the model image.

447Definition checked_piecem : mem l : piece v : pval : Prop ≔
match l, v with
⇒
live_atm b reg
⇒
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = x
None
⇒
False
PAuxb o, VAuxc
⇒
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
PName_, VName_ _ | PName_, VCodec_ | PName_, VGetopt_ _
⇒
True
_, _
⇒
False

The finite certificate implies the public heap agreement predicate.

465Lemma checked_piece_sound
∀ m l v
Explore proof 18 tactics

Initial goal

m :
v :
⊢
checked_piecem l v → agree_piecem l v

destruct l , v ; cbn [ checked_piece agree_piece ] ; try tauto

2 open

m :
b, o, v :
Z
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
None
⇒
False
→
registeredm b ∧ in_livem b o m_bytesm b + o = v
focused goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

–destruct object_regionb m_regionsm as reg | eqn: E ; | tauto

2 open

m :
b, o, v :
Z
reg :
E :
⊢
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v → registeredm b ∧ in_livem b o m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

intros H

2 open

m :
b, o, v :
Z
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
⊢
registeredm b ∧ in_livem b o m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

split ; unfold registered ; congruence |

2 open

m :
b, o, v :
Z
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
⊢
in_livem b o m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

intros reg′ E′ Hlive

2 open

m :
b, o, v :
Z
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
reg′ :
E′ :
object_regionb m_regionsm = Somereg′
Hlive :
r_lifereg′ = Live
⊢
0 ≤ o ∧ b + o < r_endreg′ ∧ m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

rewrite E in E′

2 open

m :
b, o, v :
Z
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
reg′ :
Hlive :
r_lifereg′ = Live
E′ :
Somereg = Somereg′
⊢
0 ≤ o ∧ b + o < r_endreg′ ∧ m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

injection E′ as ←

2 open

m :
b, o, v :
Z
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
Hlive :
r_lifereg = Live
⊢
0 ≤ o ∧ b + o < r_endreg ∧ m_bytesm b + o = v
deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

exact HHlive

deferred goal
m :
b, o :
Z
c :
⊢
Somereg
⇒
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
None
⇒
False
→
registeredm b ∧ in_livem b o aux_holdsm b + o c

–destruct object_regionb m_regionsm as reg | eqn: E ; | tauto

m :
b, o :
Z
c :
reg :
E :
⊢
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c → registeredm b ∧ in_livem b o aux_holdsm b + o c

intros H

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
⊢
registeredm b ∧ in_livem b o aux_holdsm b + o c

split ; unfold registered ; congruence |

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
⊢
in_livem b o aux_holdsm b + o c

intros reg′ E′ Hlive

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
reg′ :
E′ :
object_regionb m_regionsm = Somereg′
Hlive :
r_lifereg′ = Live
⊢
0 ≤ o ∧ b + o < r_endreg′ ∧ aux_holdsm b + o c

rewrite E in E′

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
reg′ :
Hlive :
r_lifereg′ = Live
E′ :
Somereg = Somereg′
⊢
0 ≤ o ∧ b + o < r_endreg′ ∧ aux_holdsm b + o c

injection E′ as ←

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
Hlive :
r_lifereg = Live
⊢
0 ≤ o ∧ b + o < r_endreg ∧ aux_holdsm b + o c

destruct HHlive as Ho & Hb & Ha

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
Hlive :
r_lifereg = Live
Ho :
0 ≤ o
Hb :
b + o < r_endreg
Ha :
m_auxm b + o = c
⊢
0 ≤ o ∧ b + o < r_endreg ∧ aux_holdsm b + o c

repeat split ; try assumption

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
Hlive :
r_lifereg = Live
Ho :
0 ≤ o
Hb :
b + o < r_endreg
Ha :
m_auxm b + o = c
⊢
aux_holdsm b + o c

left

m :
b, o :
Z
c :
reg :
E :
H :
r_lifereg = Live → 0 ≤ o ∧ b + o < r_endreg ∧ m_auxm b + o = c
Hlive :
r_lifereg = Live
Ho :
0 ≤ o
Hb :
b + o < r_endreg
Ha :
m_auxm b + o = c
⊢
m_auxm b + o = c

exact Ha

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
destruct l , v ; cbn [ checked_piece agree_piece ] ; try tauto
–destruct object_regionb m_regionsm as reg | eqn: E ; | tauto
intros H
split ; unfold registered ; congruence |
intros reg′ E′ Hlive
rewrite E in E′
injection E′ as ←
exact HHlive
–destruct object_regionb m_regionsm as reg | eqn: E ; | tauto
intros H
split ; unfold registered ; congruence |
intros reg′ E′ Hlive
rewrite E in E′
injection E′ as ←
destruct HHlive as Ho & Hb & Ha
repeat split ; try assumption
left
exact Ha

All operations in a certificate have transparent finite decisions.

478Instance checked_piece_decm l v : Decisionchecked_piecem l v
Proof 5 steps Defined
pose eqr := ltac:intros x y ; change x = y + x ≠ y ; decide equality ; try apply Z.eq_dec ; decide equality : EqDecisionregion
pose eql := ltac:intros x y ; change x = y + x ≠ y ; decide equality : EqDecisionlife
pose eqt := ltac:intros x y ; change x = y + x ≠ y ; destruct term_eqbx y eqn: E ; left ; apply term_eqb_eq ; exact E | right ; intros → ; rewrite term_eqb_refl in E ; discriminate : EqDecisionterm
pose eqc := ltac:intros x y ; change x = y + x ≠ y ; decide equality ; first apply eqt | apply Z.eq_dec : EqDecisioncap
destruct l , v ; cbn [ checked_piece ] ; try apply _ ; destruct object_regionb m_regionsm ; apply _

Every piece in the single initial resource bundle agrees.

495Lemma entry_pieces_agree
Explore proof 9 tactics

Initial goal

assert Hcheck : forallbλlv ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true by vm_compute ; reflexivity

Hcheck :
forallbλlv : piece × pval ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true

apply all_agree_intro

Hcheck :
forallbλlv : piece × pval ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true
⊢
∀l : piece v : pval, l, v ∈ entry_pieces → agree_pieceentry_memory l v

intros l v Hin

Hcheck :
forallbλlv : piece × pval ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true
v :
Hin :
l, v ∈ entry_pieces

apply checked_piece_sound

Hcheck :
forallbλlv : piece × pval ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true
v :
Hin :
l, v ∈ entry_pieces

rewrite forallb_forall in Hcheck

v :
Hin :
l, v ∈ entry_pieces
Hcheck :
∀x : piece × pval, Inx entry_pieces → bool_decidechecked_pieceentry_memory x.1 x.2 = true

apply bool_decide_eq_true_1checked_pieceentry_memory l v

v :
Hin :
l, v ∈ entry_pieces
Hcheck :
∀x : piece × pval, Inx entry_pieces → bool_decidechecked_pieceentry_memory x.1 x.2 = true
⊢
bool_decidechecked_pieceentry_memory l v = true

apply Hcheckl, v

v :
Hin :
l, v ∈ entry_pieces
Hcheck :
∀x : piece × pval, Inx entry_pieces → bool_decidechecked_pieceentry_memory x.1 x.2 = true
⊢

clear Hcheck

v :
Hin :
l, v ∈ entry_pieces
⊢

induction Hin ; cbn ; auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
assert Hcheck : forallbλlv ⇒ bool_decidechecked_pieceentry_memory lv.1 lv.2 entry_pieces = true by vm_compute ; reflexivity
intros l v Hin
rewrite forallb_forall in Hcheck
apply bool_decide_eq_true_1checked_pieceentry_memory l v
apply Hcheckl, v
clear Hcheck
induction Hin ; cbn ; auto
Opaque entry_pieces

Agreement lifts from the entire resource list to its ghost heap.

Explore proof 5 tactics

Initial goal

intros l v Hlookup

v :
Hlookup :
entry_heap !! l = Somev

apply lookup_overwrite in Hlookup as Hin | _ Hempty

2 open

focused goal
v :
Hempty :
∅ !! l = Somev

–exact all_agree_elem_ _ _ _ entry_pieces_agree Hin

deferred goal
v :
Hempty :
∅ !! l = Somev

–rewrite lookup_empty in Hempty

v :
Hempty :
None = Somev

discriminate

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros l v Hlookup
apply lookup_overwrite in Hlookup as Hin | _ Hempty
–rewrite lookup_empty in Hempty
discriminate

Every initial locale name is a readable aligned C string.

516Lemma entry_locale_ready
Explore proof 23 tactics

Initial goal

split ; exact I |

split ; constructor |

split

2 open

⊢
∀category : Z, Incategory locale_categories → ptr_addrlocale_nameentry_locale category ≠ 0 ∧ c_stringentry_memory locale_nameentry_locale category locale_textentry_locale category
focused goal

–intros k Hk

2 open

deferred goal

split ; discriminate |

2 open

deferred goal

split ; reflexivity |

2 open

deferred goal

split ; simpl ; lia |

2 open

deferred goal

split ; reflexivity

deferred goal

–split

2 open

focused goal

+constructor ; | constructor

2 open

deferred goal

split ; simpl ; lia |

2 open

deferred goal

split

3 open

⊢
∃base : Z reg : region, ptr_capspan_ptrspan_ptr ≔ locale_pointer; span_size ≔ 2 = Objbase ∨ ptr_capspan_ptrspan_ptr ≔ locale_pointer; span_size ≔ 2 = Robase ∧ object_regionbase m_regionsentry_memory = Somereg ∧ r_lifereg = Live
focused goal
deferred goal

∗exists 131840, mkRegion131840 131842 GlobalData Live

3 open

⊢
ptr_capspan_ptrspan_ptr ≔ locale_pointer; span_size ≔ 2 = Obj131840 ∨ ptr_capspan_ptrspan_ptr ≔ locale_pointer; span_size ≔ 2 = Ro131840 ∧ object_region131840 m_regionsentry_memory = Somer_base ≔ 131840; r_end ≔ 131842; r_kind ≔ GlobalData; r_life ≔ Live ∧ r_lifer_base ≔ 131840; r_end ≔ 131842; r_kind ≔ GlobalData; r_life ≔ Live = Live
deferred goal
deferred goal

split ; right ; reflexivity |

3 open

⊢
object_region131840 m_regionsentry_memory = Somer_base ≔ 131840; r_end ≔ 131842; r_kind ≔ GlobalData; r_life ≔ Live ∧ r_lifer_base ≔ 131840; r_end ≔ 131842; r_kind ≔ GlobalData; r_life ≔ Live = Live
deferred goal
deferred goal

split ; reflexivity

2 open

deferred goal
deferred goal

∗split ; reflexivity |

2 open

⊢
∀i : Z, 0 ≤ i < span_sizespan_ptr ≔ locale_pointer; span_size ≔ 2 → 0 ≤ m_bytesentry_memory ptr_addrspan_ptrspan_ptr ≔ locale_pointer; span_size ≔ 2 + i < 256
deferred goal

intros i Hi

2 open

i :
Z
Hi :
0 ≤ i < span_sizespan_ptr ≔ locale_pointer; span_size ≔ 2
deferred goal

cbn [ span_size ] in Hi

2 open

i :
Z
Hi :
0 ≤ i < 2
deferred goal

assert i = 0 ∨ i = 1 as → | → by lia ; change 0 ≤ 67 < 256 | change 0 ≤ 0 < 256 ; lia

deferred goal

+split ; constructor |

intros k Hk

k :
Z
⊢
∃ base : Z, (ptr_cap (locale_name entry_locale k) = Obj base ∨ ptr_cap (locale_name entry_locale k) = Ro base) ∧ base `mod` 8 = 0

exists 131840

k :
Z
⊢
(ptr_cap (locale_name entry_locale k) = Obj 131840 ∨ ptr_cap (locale_name entry_locale k) = Ro 131840) ∧ 131840 `mod` 8 = 0

split ; right ; reflexivity | reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split ; exact I |
split ; constructor |
split
–intros k Hk
split ; discriminate |
split ; reflexivity |
split ; simpl ; lia |
split ; reflexivity
–split
+constructor ; | constructor
split ; simpl ; lia |
split
∗exists 131840, mkRegion131840 131842 GlobalData Live
split ; right ; reflexivity |
split ; reflexivity
∗split ; reflexivity |
intros i Hi
cbn [ span_size ] in Hi
assert i = 0 ∨ i = 1 as → | → by lia ; change 0 ≤ 67 < 256 | change 0 ≤ 0 < 256 ; lia
+split ; constructor |
intros k Hk
exists 131840
split ; right ; reflexivity | reflexivity

Locale, FILEs, errno and shutdown are structurally coherent together.

533Lemma entry_stream_ready
Explore proof 17 tactics

Initial goal

split ; exact I |

split ; exact entry_locale_ready |

split

2 open

focused goal

–split ; discriminate |

2 open

⊢
writable_span entry_memory {| span_ptr := libc_errno entry_world.1; span_size := 4 |} ∧ ptr_addr (libc_errno entry_world.1) `mod` 4 = 0
deferred goal

split ; entry_writable | reflexivity

deferred goal

–split ; apply stdout_initial_wf |

split ; apply stdout_initial_wf |

split ; constructor |

split ; simpl ; lia |

split ; exact I |

split ; discriminate |

split ; reflexivity |

split ; intros _ ; exact proj1entry_files_ready |

split ; intros _ ; exact proj2entry_files_ready |

intros p file Hfile b Hin

p :
file :
Hfile :
b :
Z
Hin :
Inb file_ownedfile
⊢

unfold libc_file_at in Hfile

destruct same_filep libc_stdoutentry_world ; | destruct same_filep libc_stderrentry_world ; try discriminate ; injection Hfile as ← ; contradiction

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split ; exact I |
split ; exact entry_locale_ready |
split
–split ; discriminate |
split ; entry_writable | reflexivity
–split ; apply stdout_initial_wf |
split ; apply stdout_initial_wf |
split ; constructor |
split ; simpl ; lia |
split ; exact I |
split ; discriminate |
split ; reflexivity |
split ; intros _ ; exact proj1entry_files_ready |
split ; intros _ ; exact proj2entry_files_ready |
intros p file Hfile b Hin
unfold libc_file_at in Hfile
destruct same_filep libc_stdoutentry_world ; | destruct same_filep libc_stderrentry_world ; try discriminate ; injection Hfile as ← ; contradiction

Hello's actual option string and sentinel-terminated table are readable.

Explore proof 8 tactics

Initial goal

unfold hello_table_at

split

2 open

focused goal

–vm_compute

2 open

⊢
Someok = Someok ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 103 = 103 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 58 = 58 ∧ Datatypes.Lt = Datatypes.Lt ∧ Datatypes.Lt = Datatypes.Lt ∧ 116 = 116 ∧ 0 = 0
deferred goal

repeat split ; congruence

deferred goal

–split ; reflexivity |

cbn [ getopt_records hello_options ]

⊢
pointer_slot entry_memory (ptr_addr longopts_ptr) (option_name {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ∧ ptr_addr (option_name {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ≠ 0 ∧ c_string entry_memory (option_name {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) (option_text {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ∧ 0 ≤ option_argument {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |} ≤ 2 ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 8) 4 = option_argument {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |} ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 16) (option_flag {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ∧ getopt_int (option_value {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 24) 4 = option_value {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |} `mod` 2 ^ 32 ∧ getopt_optional_int entry_memory (option_flag {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |}) ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32) (option_name {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ∧ ptr_addr (option_name {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ≠ 0 ∧ c_string entry_memory (option_name {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) (option_text {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ∧ 0 ≤ option_argument {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |} ≤ 2 ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 8) 4 = option_argument {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |} ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 16) (option_flag {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ∧ getopt_int (option_value {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |} `mod` 2 ^ 32 ∧ getopt_optional_int entry_memory (option_flag {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |}) ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 32) (option_name {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ∧ ptr_addr (option_name {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ≠ 0 ∧ c_string entry_memory (option_name {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [ 104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) (option_text {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [ 104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ∧ 0 ≤ option_argument {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |} ≤ 2 ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 8) 4 = option_argument {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |} ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 32 + 16) (option_flag {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ∧ getopt_int (option_value {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |} `mod` 2 ^ 32 ∧ getopt_optional_int entry_memory (option_flag {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |}) ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32) (option_name {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ∧ ptr_addr (option_name {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ≠ 0 ∧ c_string entry_memory (option_name {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) (option_text {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ∧ 0 ≤ option_argument {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |} ≤ 2 ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32 + 8) 4 = option_argument {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |} ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32 + 16) (option_flag {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ∧ getopt_int (option_value {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ∧ load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |} `mod` 2 ^ 32 ∧ getopt_optional_int entry_memory (option_flag {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |}) ∧ ∃ p : ptr, ptr_addr p = 0 ∧ pointer_slot entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32 + 32) p

repeat match goal with|- _ ∧ _⇒splitend

41 open

⊢
pointer_slotentry_memory ptr_addrlongopts_ptr option_nameoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
ptr_addroption_nameoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103 ≠ 0
focused goal
⊢
c_stringentry_memory option_nameoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103 option_textoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
0 ≤ option_argumentoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
option_argumentoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103 ≤ 2
focused goal
⊢
load_bytesentry_memory ptr_addrlongopts_ptr + 8 4 = option_argumentoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 16 option_flagoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
getopt_intoption_valueoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
load_bytes entry_memory (ptr_addr longopts_ptr + 24) 4 = option_value {| option_name := {| ptr_addr := 69456; ptr_cap := Ro 69456 |}; option_text := [103; 114; 101; 101; 116; 105; 110; 103]; option_argument := 1; option_flag := null; option_value := 103 |} `mod` 2 ^ 32
focused goal
⊢
getopt_optional_intentry_memory option_flagoption_name ≔ ptr_addr ≔ 69456; ptr_cap ≔ Ro69456; option_text ≔ 103; 114; 101; 101; 116; 105; 110; 103; option_argument ≔ 1; option_flag ≔ null; option_value ≔ 103
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 option_nameoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
ptr_addroption_nameoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116 ≠ 0
focused goal
⊢
c_stringentry_memory option_nameoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116 option_textoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
0 ≤ option_argumentoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
option_argumentoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116 ≤ 2
focused goal
⊢
load_bytesentry_memory ptr_addrlongopts_ptr + 32 + 8 4 = option_argumentoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 16 option_flagoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
getopt_intoption_valueoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69488; ptr_cap := Ro 69488 |}; option_text := [116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108]; option_argument := 0; option_flag := null; option_value := 116 |} `mod` 2 ^ 32
focused goal
⊢
getopt_optional_intentry_memory option_flagoption_name ≔ ptr_addr ≔ 69488; ptr_cap ≔ Ro69488; option_text ≔ 116; 114; 97; 100; 105; 116; 105; 111; 110; 97; 108; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 116
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 32 option_nameoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
ptr_addroption_nameoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128 ≠ 0
focused goal
⊢
c_stringentry_memory option_nameoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128 option_textoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
0 ≤ option_argumentoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
option_argumentoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128 ≤ 2
focused goal
⊢
load_bytesentry_memory ptr_addrlongopts_ptr + 32 + 32 + 8 4 = option_argumentoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 32 + 16 option_flagoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
getopt_intoption_valueoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69520; ptr_cap := Ro 69520 |}; option_text := [104; 101; 108; 112]; option_argument := 0; option_flag := null; option_value := 128 |} `mod` 2 ^ 32
focused goal
⊢
getopt_optional_intentry_memory option_flagoption_name ≔ ptr_addr ≔ 69520; ptr_cap ≔ Ro69520; option_text ≔ 104; 101; 108; 112; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 128
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 32 + 32 option_nameoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
ptr_addroption_nameoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129 ≠ 0
focused goal
⊢
c_stringentry_memory option_nameoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129 option_textoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
0 ≤ option_argumentoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
option_argumentoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129 ≤ 2
focused goal
⊢
load_bytesentry_memory ptr_addrlongopts_ptr + 32 + 32 + 32 + 8 4 = option_argumentoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 32 + 32 + 16 option_flagoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
getopt_intoption_valueoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
load_bytes entry_memory (ptr_addr longopts_ptr + 32 + 32 + 32 + 24) 4 = option_value {| option_name := {| ptr_addr := 69552; ptr_cap := Ro 69552 |}; option_text := [118; 101; 114; 115; 105; 111; 110]; option_argument := 0; option_flag := null; option_value := 129 |} `mod` 2 ^ 32
focused goal
⊢
getopt_optional_intentry_memory option_flagoption_name ≔ ptr_addr ≔ 69552; ptr_cap ≔ Ro69552; option_text ≔ 118; 101; 114; 115; 105; 111; 110; option_argument ≔ 0; option_flag ≔ null; option_value ≔ 129
focused goal
⊢
∃p : ptr, ptr_addrp = 0 ∧ pointer_slotentry_memory ptr_addrlongopts_ptr + 32 + 32 + 32 + 32 p

all: lazymatch goal with|- pointer_slot_ _ _⇒vm_compute ; repeat split ; congruence|- c_string_ _ _⇒vm_compute ; repeat split ; congruence|- getopt_int_⇒unfold getopt_int ; cbn [ option_value ] ; lia|- getopt_optional_int_ _⇒left ; reflexivity|- ∃p, _⇒exists null ; vm_compute ; repeat split ; congruence_⇒vm_compute ; congruenceend

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–vm_compute
repeat split ; congruence
–split ; reflexivity |
repeat match goal with|- _ ∧ _⇒splitend
all: lazymatch goal with|- pointer_slot_ _ _⇒vm_compute ; repeat split ; congruence|- c_string_ _ _⇒vm_compute ; repeat split ; congruence|- getopt_int_⇒unfold getopt_int ; cbn [ option_value ] ; lia|- getopt_optional_int_ _⇒left ; reflexivity|- ∃p, _⇒exists null ; vm_compute ; repeat split ; congruence_⇒vm_compute ; congruenceend

The native-view predicate has this explicit synthetic model witness.

Explore proof 12 tactics

Initial goal

split ; exact entry_stream_ready |

split

2 open

focused goal

–split ; repeat split ; reflexivity |

2 open

deferred goal

split ; exact entry_public_state |

2 open

deferred goal

left

2 open

deferred goal

exact entry_parser_fresh

deferred goal

–split ; reflexivity |

split ; reflexivity |

split ; reflexivity |

split ; exact proj1entry_stream_cells |

split ; exact proj2entry_stream_cells |

split ; exact entry_environment | exact entry_table

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split ; exact entry_stream_ready |
split
–split ; repeat split ; reflexivity |
split ; exact entry_public_state |
left
–split ; reflexivity |
split ; reflexivity |
split ; reflexivity |
split ; exact proj1entry_stream_cells |
split ; exact proj2entry_stream_cells |
split ; exact entry_environment | exact entry_table

Every initial heap lookup comes from the one joint resource bundle.

577Lemma entry_lookup_member
∀ l v
entry_heap !! l = Somev
l, v ∈ entry_pieces
Explore proof 4 tactics

Initial goal

v :
⊢
entry_heap !! l = Somev → l, v ∈ entry_pieces

intros Hl

v :
Hl :
entry_heap !! l = Somev
⊢
l, v ∈ entry_pieces

apply lookup_overwrite in Hl as Hin | _ Hempty ; exact Hin |

v :
Hempty :
∅ !! l = Somev
⊢
l, v ∈ entry_pieces

rewrite lookup_empty in Hempty

v :
Hempty :
None = Somev
⊢
l, v ∈ entry_pieces

discriminate

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Hl
apply lookup_overwrite in Hl as Hin | _ Hempty ; exact Hin |
rewrite lookup_empty in Hempty
discriminate

The initial bundle's only ghost observations are the parser token, the locale names and the codec; none freezes native FILE contents.

585Lemma entry_ghost_lookup
∀ k v
entry_heap !! PNamek = Somev
Explore proof 12 tactics

Initial goal

k :
Z
v :
⊢
entry_heap !! PNamek = Somev → InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

intros Hl

k :
Z
v :
Hl :
entry_heap !! PNamek = Somev
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

apply entry_lookup_member in Hl

k :
Z
v :
Hl :
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

apply list_elem_of_In in Hl

k :
Z
v :
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

Local Transparent entry_pieces

k :
Z
v :
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

assert Hfilter : List.filterλlv ⇒ match lv.1 with PName_ ⇒ true | _ ⇒ false end entry_pieces = getopt_psnull 1 ++ mapλk ⇒ PNamek, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

2 open

k :
Z
v :
⊢
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
focused goal
k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

{unfold entry_pieces

2 open

k :
Z
v :
⊢
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
block_psargv_base argv_region 0 argv_bytesmaparg_ptr arguments argv_aux ++ flat_maparg_ps arguments ++ getopt_psnull 1 ++ string_pslibs_ptr 66112 r_base ≔ 66112; r_end ≔ 66120; r_kind ≔ GlobalData; r_life ≔ Live libs_bytes ++ string_pslt_ptr 66144 r_base ≔ 66144; r_end ≔ 66152; r_kind ≔ GlobalData; r_life ≔ Live lt_bytes ++ name_pieces ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C" ++ string_psempty_ptr 69968 r_base ≔ 69968; r_end ≔ 69976; r_kind ≔ GlobalData; r_life ≔ Live [ ] ++ hello_output_pieces
=
deferred goal
k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

vm_compute

2 open

k :
Z
v :
⊢
PName64, VGetoptptr_addr ≔ 0; ptr_cap ≔ CNone 1; PName0, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName1, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName2, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName3, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName4, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName5, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName6, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName7, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName8, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName9, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName10, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName11, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName12, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName−1, VCodecTAtom"C" = PName64, VGetoptptr_addr ≔ 0; ptr_cap ≔ CNone 1; PName0, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName1, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName2, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName3, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName4, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName5, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName6, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName7, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName8, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName9, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName10, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName11, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName12, VNameptr_addr ≔ 131840; ptr_cap ≔ Ro131840 67; PName−1, VCodecTAtom"C"
deferred goal
k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

reflexivity

deferred goal
k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

Local Opaque entry_pieces

k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v getopt_psnull 1 ++ mapλk0 : Z ⇒ PNamek0, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"

rewrite <- Hfilter

k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
InPNamek, v
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false

apply filter_In

k :
Z
v :
Hfilter :
List.filter
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
false
=
⊢
∧
match PNamek, v.1 with
⇒
true
_
⇒
false
=
true

split ; exact Hl | reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Hl
apply list_elem_of_In in Hl
Local Transparent entry_pieces
assert Hfilter : List.filterλlv ⇒ match lv.1 with PName_ ⇒ true | _ ⇒ false end entry_pieces = getopt_psnull 1 ++ mapλk ⇒ PNamek, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C"
{unfold entry_pieces
vm_compute
reflexivity
rewrite <- Hfilter
apply filter_In
split ; exact Hl | reflexivity

The concrete model's native capability inventories are private from every memory piece of main, including object lives.

601Lemma entry_private
Explore proof 16 tactics

Initial goal

Local Transparent entry_pieces

assert Hcheck : forallbλsource ⇒ forallbλlv ⇒ match lv.1, ptr_capspan_ptrsource with PName_, _ ⇒ true | _, Objb | _, Rob ⇒ negbZ.eqbpiece_idlv.1 b | _, _ ⇒ true end entry_pieces private_sourcesentry_world = true

2 open

⊢
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true
focused goal
Hcheck :
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

{unfold entry_pieces

2 open

⊢
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
block_psargv_base argv_region 0 argv_bytesmaparg_ptr arguments argv_aux ++ flat_maparg_ps arguments ++ getopt_psnull 1 ++ string_pslibs_ptr 66112 r_base ≔ 66112; r_end ≔ 66120; r_kind ≔ GlobalData; r_life ≔ Live libs_bytes ++ string_pslt_ptr 66144 r_base ≔ 66144; r_end ≔ 66152; r_kind ≔ GlobalData; r_life ≔ Live lt_bytes ++ name_pieces ++ mapλk : Z ⇒ PNamek, VNamelocale_pointer 67 locale_categories ++ codec_psTAtom"C" ++ string_psempty_ptr 69968 r_base ≔ 69968; r_end ≔ 69976; r_kind ≔ GlobalData; r_life ≔ Live [ ] ++ hello_output_pieces
=
true
deferred goal
Hcheck :
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

vm_compute

2 open

⊢
true = true
deferred goal
Hcheck :
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

reflexivity

deferred goal
Hcheck :
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

Local Opaque entry_pieces

Hcheck :
forallb
λ source : span  ⇒
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

rewrite forallb_forall in Hcheck

Hcheck :
∀ x : span  ,
→
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrx with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

apply List.Forall_forall

Hcheck :
∀ x : span  ,
→
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrx with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true

intros source Hin b Hcap

Hcheck :
∀ x : span  ,
→
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrx with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true
source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob

specialize Hchecksource Hin

source :
Hcheck :
forallb
λ lv : piece × pval  ⇒
match lv.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idlv.1 =? b
_
⇒
true
=
true
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob

rewrite forallb_forall in Hcheck

source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob
Hcheck :
∀ x : piece × pval  ,
→
match x.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idx.1 =? b
_
⇒
true
=
true

intros b′ l v [ <-| [ ] ] Hl Hmem

source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob
Hcheck :
∀ x : piece × pval  ,
→
match x.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idx.1 =? b
_
⇒
true
=
true
v :
Hl :
entry_heap !! l = Somev
Hmem :
⊢
piece_idl ≠ b

apply entry_lookup_member in Hl

source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob
Hcheck :
∀ x : piece × pval  ,
→
match x.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idx.1 =? b
_
⇒
true
=
true
v :
Hl :
l, v ∈ entry_pieces
Hmem :
⊢
piece_idl ≠ b

apply list_elem_of_In in Hl

source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob
Hcheck :
∀ x : piece × pval  ,
→
match x.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idx.1 =? b
_
⇒
true
=
true
v :
Hl :
Hmem :
⊢
piece_idl ≠ b

specialize Hcheckl, v Hl

source :
b :
Z
Hcap :
ptr_capspan_ptrsource = Objb ∨ ptr_capspan_ptrsource = Rob
v :
Hcheck :
match l, v.1 with
⇒
true
_
⇒
match ptr_capspan_ptrsource with
Objb | Rob
⇒
negbpiece_idl, v.1 =? b
_
⇒
true
=
true
Hl :
Hmem :
⊢
piece_idl ≠ b

destruct Hcap as Hcap | Hcap ; rewrite Hcap in Hcheck ; destruct l ; try contradiction ; cbn [ fst piece_id ] in Hcheck |- * ; apply Z.eqb_neq ; apply negb_true_iff ; exact Hcheck

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
Local Transparent entry_pieces
assert Hcheck : forallbλsource ⇒ forallbλlv ⇒ match lv.1, ptr_capspan_ptrsource with PName_, _ ⇒ true | _, Objb | _, Rob ⇒ negbZ.eqbpiece_idlv.1 b | _, _ ⇒ true end entry_pieces private_sourcesentry_world = true
{unfold entry_pieces
vm_compute
reflexivity
rewrite forallb_forall in Hcheck
apply List.Forall_forall
intros source Hin b Hcap
specialize Hchecksource Hin
rewrite forallb_forall in Hcheck
intros b′ l v [ <-| [ ] ] Hl Hmem
apply list_elem_of_In in Hl
specialize Hcheckl, v Hl
destruct Hcap as Hcap | Hcap ; rewrite Hcap in Hcheck ; destruct l ; try contradiction ; cbn [ fst piece_id ] in Hcheck |- * ; apply Z.eqb_neq ; apply negb_true_iff ; exact Hcheck

The initial names, codec and getopt observations all agree with the same physical native world.

Explore proof 14 tactics

Initial goal

split

2 open

focused goal

–intros k p t Hl

2 open

k :
Z
p :
t :
listZ
Hl :
entry_heap !! PNamek = SomeVNamep t
deferred goal

apply entry_ghost_lookup in Hl

2 open

k :
Z
p :
t :
listZ
Hl :
deferred goal

cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl

2 open

deferred goal

repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ← ← ; split ; cbn ; auto 30 | split ; reflexivity

deferred goal

–split

2 open

focused goal

+intros c Hl

2 open

deferred goal

apply entry_ghost_lookup in Hl

2 open

deferred goal

cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl

2 open

deferred goal

repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ; reflexivity

deferred goal

+intros a i Hl

apply entry_ghost_lookup in Hl

cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl

repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ← ; split ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–intros k p t Hl
apply entry_ghost_lookup in Hl
cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl
repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ← ← ; split ; cbn ; auto 30 | split ; reflexivity
–split
+intros c Hl
apply entry_ghost_lookup in Hl
cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl
repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ; reflexivity
+intros a i Hl
apply entry_ghost_lookup in Hl
cbn [ getopt_ps getopt_key codec_ps codec_key locale_categories List.app List.map ] in Hl
repeat destruct Hl as E | Hl ; try contradiction ; try discriminate E ; injection E as ← ← ; split ; reflexivity

One composite world interpretation is inhabited jointly with the actual main resource bundle and heap agreement. This is a model entry witness, not native adequacy or cross-call restoration.

Explore proof 6 tactics

Initial goal

split

2 open

focused goal

–split ; exact entry_native |

2 open

deferred goal

split ; exact entry_private |

2 open

deferred goal

split ; intros b l v ; contradiction |

2 open

deferred goal

exact entry_current

deferred goal

–split ; exact entry_agrees | exact entry_keys_unique

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–split ; exact entry_native |
split ; exact entry_private |
split ; intros b l v ; contradiction |
–split ; exact entry_agrees | exact entry_keys_unique