Fil-C on Nix

Filnix wiki

the formal campaign

rocq/theories/Chain.v

Campaign 3's reuse forms, part one: what a frame may read off the single definitions that dominate its point (formal.md, Campaign 3; rocq.md, Reading single definitions).

Single.v proves that every replayable single definition whose site dominates a frame's point replays: the name still holds what its instruction made. This file turns that into the facts the reuse forms' rules need: offset intervals, the elements of a guard chain, and the distance between two pointers. From them it proves the first reuse form, a raw access covered by the hull of two live facts, never unchecked along any run.

Decisions

DecisionWhy
"dominates the point" is the predicate Interval.v walksit is closed under single-definition operands (use_dominated), and what dominates replays (scope_holds)
Interval.v's hypothesis speaks of iv_op lets at an integer classa check's proof or a float sum does not compute by alu; no derivation walks through one
guard_chain and pointer_distance are rewritten by equations, never unfolded in a hypothesisunfolding makes the kernel compare two 64-deep unfoldings, and Qed takes minutes
a write through the hull needs some write check of the capability, not of the two bounding spanshull_covered/7 takes write rights from any span; a passed write check means the capability is not read-only
the facts' pointers dominating the point is Invariant.v's (live_dom), not a hypothesisinside a block it is use_dominated; over a block's entry it is dom_meet
HullR carries runs between two instances of MachineRPersistence.v and Single.v each instantiate it, and mstep is an inductive, new in each instance
From Stdlib Require Import String ZArith List Bool Lia Relations
From Nanofil Require Import Term Maps Syntax Cfg Values Memory Runtime Ops Semantics Machine Validate Dominance Interval Sites Identity Coverage Walk Invariant Persistence Single Evidence
Import ListNotations
Open Scope Z_scope

A replayed definition holds

A let n of an op o that intervals walk through (iv_op), at an integer class k, that steps and continues, computed its result from its operands as let_holds says, reading them in the frame where it ran (inst_result/5, op_res/7).

39Lemma step_let_holds
∀ ge fr m n k o args e1 l1 m1
iv_opo = true
class_bitsk ≠ None
inst_stepge fr m Letn k o args = SomeIContinuee1 l1 m1
let_holdsge fr_envfr e1 n k o args
Explore proof 17 tactics

Initial goal

⊢
∀ge : genv fr : frame m : Memory.mem n : name k : class o : op args : listvalue e1 : env l1 : listname × optionZ m1 : Memory.mem, iv_opo = true → class_bitsk ≠ None → inst_stepge fr m Letn k o args = SomeIContinuee1 l1 m1 → let_holdsge fr_envfr e1 n k o args

intros ge fr m n k o args e1 l1 m1 Ho Hk H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
H :
inst_stepge fr m Letn k o args = SomeIContinuee1 l1 m1
⊢
let_holdsge fr_envfr e1 n k o args

assert Hs : special_leto = false by destruct o ; try discriminate Ho ; reflexivity

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
H :
inst_stepge fr m Letn k o args = SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

rewrite inst_step_let_ _ _ _ _ _ _ Hs in H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
H :
let e ≔ fr_envfr in
let locals ≔ fr_localsfr in
let* classes ≔ op_arg_classeso k in
let* xs ≔ map2_optionvalue_xge e classes args in
match op_reso k xs m with
SomeOpResr m′
⇒
Somebind_resn r e locals m′
SomeOpUBwhy
⇒
SomeIStopUBwhy
SomeOpAllocq kont
⇒
Some
λ base : Z  ⇒
let x, m′ ≔ kontbase in
putn x e, locals, m′
None
⇒
None
=
SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

cbv zeta in H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
H :
let* classes ≔ op_arg_classeso k in
let* xs ≔ map2_optionvalue_xge fr_envfr classes args in
match op_reso k xs m with
SomeOpResr m′
⇒
Somebind_resn r fr_envfr fr_localsfr m′
SomeOpUBwhy
⇒
SomeIStopUBwhy
SomeOpAllocq kont
⇒
Some
λ base : Z  ⇒
let x, m′ ≔ kontbase in
putn x fr_envfr, fr_localsfr, m′
None
⇒
None
=
SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

destruct op_arg_classeso k as cls | eqn: Ec ; | discriminate H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
H :
let* xs ≔ map2_optionvalue_xge fr_envfr cls args in
match op_reso k xs m with
SomeOpResr m′
⇒
Somebind_resn r fr_envfr fr_localsfr m′
SomeOpUBwhy
⇒
SomeIStopUBwhy
SomeOpAllocq kont
⇒
Some
λ base : Z  ⇒
let x, m′ ≔ kontbase in
putn x fr_envfr, fr_localsfr, m′
None
⇒
None
=
SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

destruct map2_option_ cls args as xs | eqn: Ex ; | discriminate H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
H :
match op_reso k xs m with
SomeOpResr m′
⇒
Somebind_resn r fr_envfr fr_localsfr m′
SomeOpUBwhy
⇒
SomeIStopUBwhy
SomeOpAllocq kont
⇒
Some
λ base : Z  ⇒
let x, m′ ≔ kontbase in
putn x fr_envfr, fr_localsfr, m′
None
⇒
None
=
SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

destruct op_reso k xs m as r m′ | why | q kont | eqn: Er ; try discriminate H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
m′ :
Memory.mem
Er :
op_reso k xs m = SomeOpResr m′
H :
Somebind_resn r fr_envfr fr_localsfr m′ = SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

destruct r as x | why | why ; simpl in H ; try discriminate H

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
op_reso k xs m = SomeOpResRValx m′
H :
SomeIContinueputn x fr_envfr fr_localsfr m′ = SomeIContinuee1 l1 m1
Hs :
special_leto = false
⊢
let_holdsge fr_envfr e1 n k o args

injection H as ← _ _

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
op_reso k xs m = SomeOpResRValx m′
Hs :
special_leto = false
⊢
let_holdsge fr_envfr putn x fr_envfr n k o args

assert Hn : lookupn putn x fr_envfr = Somex by rewrite lookup_put , name_eqb_refl ; reflexivity

ge :
fr :
m :
Memory.mem
n :
o :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opo = true
Hk :
class_bitsk ≠ None
cls :
listclass
Ec :
op_arg_classeso k = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
op_reso k xs m = SomeOpResRValx m′
Hs :
special_leto = false
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n k o args

destruct k ; try exfalso ; apply Hk ; reflexivity ; destruct o ; try discriminate Ho ; unfold op_res , op_res_int in Er ; simpl in Er ; cases Er ; inversion Er ; subst

18 open

ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAdd = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesAdd W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx + y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Add args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opSub = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesSub W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx − y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Sub args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opMul = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesMul W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Mul args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opUrem = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntunsigned_divisionZ.modulo x y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Urem args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAnd = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesAnd W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntZ.landx y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W And args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opShl = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesShl W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × 2 ^ y mod 32 mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Shl args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opCopy = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
[ ]
⇒
None
x
⇒
Somex
x :: _ :: _
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Copy args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opExtt = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesExtt W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntextensiont x mod Z.pow_pos2 32
WIntx :: _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
special_letExtt = false
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n W Extt args
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off W = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
let_holdsge fr_envfr putn x fr_envfr n W RawLoadt off args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAdd = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesAdd L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx + y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Add args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opSub = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesSub L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx − y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Sub args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opMul = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesMul L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Mul args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opUrem = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntunsigned_divisionZ.modulo x y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Urem args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAnd = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesAnd L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntZ.landx y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L And args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opShl = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesShl L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × 2 ^ y mod 64 mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Shl args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opCopy = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
[ ]
⇒
None
x
⇒
Somex
x :: _ :: _
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Copy args
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opExtt = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesExtt L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntextensiont x mod Z.pow_pos2 64
WIntx :: _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
special_letExtt = false
Hn :
lookupn putn x fr_envfr = Somex
⊢
let_holdsge fr_envfr putn x fr_envfr n L Extt args
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off L = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
let_holdsge fr_envfr putn x fr_envfr n L RawLoadt off args

all: unfold let_holds

18 open

ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAdd = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesAdd W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx + y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesAdd W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluAdd W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opSub = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesSub W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx − y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesSub W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluSub W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opMul = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesMul W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × y mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesMul W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluMul W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opUrem = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntunsigned_divisionZ.modulo x y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesUrem W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluUrem W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAnd = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesAnd W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntZ.landx y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesAnd W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluAnd W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opShl = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesShl W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × 2 ^ y mod 32 mod Z.pow_pos2 32
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesShl W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluShl W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opCopy = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
[ ]
⇒
None
x
⇒
Somex
x :: _ :: _
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesCopy W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluCopy W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opExtt = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesExtt W = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntextensiont x mod Z.pow_pos2 32
WIntx :: _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
special_letExtt = false
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesExtt W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluExtt W xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off W = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
match t with
⇒
∃u : Z x0 : word, extendedt0 W u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
_
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classesRawLoadt off W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs ∧ aluRawLoadt off W xs = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAdd = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesAdd L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx + y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesAdd L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluAdd L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opSub = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesSub L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx − y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesSub L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluSub L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opMul = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesMul L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × y mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesMul L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluMul L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opUrem = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntunsigned_divisionZ.modulo x y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesUrem L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluUrem L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opAnd = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesAnd L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntZ.landx y
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesAnd L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluAnd L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opShl = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesShl L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntx × 2 ^ y mod 64 mod Z.pow_pos2 64
WIntx :: WInty :: _ :: _
⇒
None
WIntx | WIntx :: WPtr_ :: _ | WIntx :: WLimit_ _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesShl L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluShl L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opCopy = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
[ ]
⇒
None
x
⇒
Somex
x :: _ :: _
⇒
None
=
Somex
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesCopy L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluCopy L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opExtt = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesExtt L = Somecls
xs :
listword
Ex :
map2_optionvalue_xge fr_envfr cls args = Somexs
x :
m′ :
Memory.mem
Er :
SomeOpResRValx m′ = SomeOpResRValx m′
Heqo :
match xs with
⇒
SomeWIntextensiont x mod Z.pow_pos2 64
WIntx :: _ :: _
⇒
None
_
⇒
None
=
Somex
Hs :
special_letExtt = false
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃classes : listclass xs0 : listword x0 : word, op_arg_classesExtt L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs0 ∧ aluExtt L xs0 = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off L = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
match t with
⇒
∃u : Z x0 : word, extendedt0 L u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
_
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classesRawLoadt off L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs ∧ aluRawLoadt off L xs = Somex0 ∧ lookupn putn x fr_envfr = Somex0

all: first exists cls, xs, x ; auto | idtac

2 open

ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off W = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
match t with
⇒
∃u : Z x0 : word, extendedt0 W u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
_
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classesRawLoadt off W = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs ∧ aluRawLoadt off W xs = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
iv_opRawLoadt off = true
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
op_arg_classesRawLoadt off L = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Heqo :
Hs :
special_letRawLoadt off = false
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
match t with
⇒
∃u : Z x0 : word, extendedt0 L u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
_
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classesRawLoadt off L = Someclasses ∧ map2_optionvalue_xge fr_envfr classes args = Somexs ∧ aluRawLoadt off L xs = Somex0 ∧ lookupn putn x fr_envfr = Somex0

all: destruct t ; try discriminate Ho

2 open

ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x0 : word, extendedt W u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
Er :
SomeOpResraw_resr m′ = SomeOpResRValx m′
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x0 : word, extendedt L u = Somex0 ∧ lookupn putn x fr_envfr = Somex0

all: match goal withHl : int_load_res_ _ _ _ _ = Some_ |- _⇒unfold int_load_res in Hl ; cases Hl ; inversion Hl ; substend

6 open

ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
w :
Er :
SomeOpResraw_resRValw m′ = SomeOpResRValx m′
x0 :
unit
Heqo0 :
Heqo1 :
Heqo :
SomeRValw = SomeRValw
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x1 : word, extendedt W u = Somex1 ∧ lookupn putn x fr_envfr = Somex1
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
r1 :
Er :
SomeOpResraw_resRTrapr1 m′ = SomeOpResRValx m′
Heqo :
SomeRTrapr1 = SomeRTrapr1
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x0 : word, extendedt W u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsW ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
r1 :
Er :
SomeOpResraw_resRUncheckedr1 m′ = SomeOpResRValx m′
Heqo :
SomeRUncheckedr1 = SomeRUncheckedr1
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃u : Z x0 : word, extendedt W u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
w :
Er :
SomeOpResraw_resRValw m′ = SomeOpResRValx m′
x0 :
unit
Heqo0 :
Heqo1 :
Heqo :
SomeRValw = SomeRValw
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x1 : word, extendedt L u = Somex1 ∧ lookupn putn x fr_envfr = Somex1
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
r1 :
Er :
SomeOpResraw_resRTrapr1 m′ = SomeOpResRValx m′
Heqo :
SomeRTrapr1 = SomeRTrapr1
Hs :
Hn :
lookupn putn x fr_envfr = Somex
H0 :
⊢
∃u : Z x0 : word, extendedt L u = Somex0 ∧ lookupn putn x fr_envfr = Somex0
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
Hk :
class_bitsL ≠ None
cls :
listclass
Ec :
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
r1 :
Er :
SomeOpResraw_resRUncheckedr1 m′ = SomeOpResRValx m′
Heqo :
SomeRUncheckedr1 = SomeRUncheckedr1
Hs :
Hn :
lookupn putn x fr_envfr = Somex
⊢
∃u : Z x0 : word, extendedt L u = Somex0 ∧ lookupn putn x fr_envfr = Somex0

all: simpl in * ; try discriminate

2 open

ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
true = true
Hk :
Some32 ≠ None
cls :
listclass
Ec :
SomeA = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
w :
Er :
SomeOpResRValw m′ = SomeOpResRValx m′
x0 :
unit
Heqo0 :
Heqo1 :
Heqo :
SomeRValw = SomeRValw
Hs :
false = false
Hn :
→
Somex
else
lookupn filterλp : name × word ⇒ negbname_eqbn fstp fr_envfr
=
Somex
H0 :
RValw = RValx
⊢
∃ u : Z x1 : word  ,
extendedt W u = Somex1
∧
→
Somex
else
lookupn filterλp0 : name × word ⇒ negbname_eqbn fstp0 fr_envfr
=
Somex1
focused goal
ge :
fr :
n :
off :
Z
args :
listvalue
l1 :
listname × optionZ
m1 :
Memory.mem
Ho :
true = true
Hk :
Some64 ≠ None
cls :
listclass
Ec :
SomeA = Somecls
p :
Ex :
map2_optionvalue_xge fr_envfr cls args = SomeWPtrp
x :
m′ :
Memory.mem
w :
Er :
SomeOpResRValw m′ = SomeOpResRValx m′
x0 :
unit
Heqo0 :
Heqo1 :
Heqo :
SomeRValw = SomeRValw
Hs :
false = false
Hn :
→
Somex
else
lookupn filterλp : name × word ⇒ negbname_eqbn fstp fr_envfr
=
Somex
H0 :
RValw = RValx
⊢
∃ u : Z x1 : word  ,
extendedt L u = Somex1
∧
→
Somex
else
lookupn filterλp0 : name × word ⇒ negbname_eqbn fstp0 fr_envfr
=
Somex1

all: match goal withH0 : RVal_ = RVal_ |- _⇒injection H0 as ←end;eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge fr m n k o args e1 l1 m1 Ho Hk H
assert Hs : special_leto = false by destruct o ; try discriminate Ho ; reflexivity
rewrite inst_step_let_ _ _ _ _ _ _ Hs in H
cbv zeta in H
destruct op_arg_classeso k as cls | eqn: Ec ; | discriminate H
destruct map2_option_ cls args as xs | eqn: Ex ; | discriminate H
destruct op_reso k xs m as r m′ | why | q kont | eqn: Er ; try discriminate H
destruct r as x | why | why ; simpl in H ; try discriminate H
injection H as ← _ _
assert Hn : lookupn putn x fr_envfr = Somex by rewrite lookup_put , name_eqb_refl ; reflexivity
destruct k ; try exfalso ; apply Hk ; reflexivity ; destruct o ; try discriminate Ho ; unfold op_res , op_res_int in Er ; simpl in Er ; cases Er ; inversion Er ; subst
all: unfold let_holds
all: first exists cls, xs, x ; auto | idtac
all: destruct t ; try discriminate Ho
all: match goal withHl : int_load_res_ _ _ _ _ = Some_ |- _⇒unfold int_load_res in Hl ; cases Hl ; inversion Hl ; substend
all: simpl in * ; try discriminate
all: match goal withH0 : RVal_ = RVal_ |- _⇒injection H0 as ←end;eauto

let_holds reads the defined name n only in the later environment, so it survives a change of environment that keeps n.

65Lemma let_holds_name
∀ ge e0 e e′ n k o args
lookupn e′ = lookupn e
let_holdsge e0 e n k o args
let_holdsge e0 e′ n k o args
Explore proof 4 tactics

Initial goal

⊢
∀ge : genv e0 : env e e′ : listname × word n : name k : class o : op args : listvalue, lookupn e′ = lookupn e → let_holdsge e0 e n k o args → let_holdsge e0 e′ n k o args

intros ge e0 e e′ n k o args E H

ge :
e0 :
e, e′ :
listname × word
n :
o :
args :
listvalue
E :
lookupn e′ = lookupn e
H :
let_holdsge e0 e n k o args
⊢
let_holdsge e0 e′ n k o args

unfold let_holds in *

ge :
e0 :
e, e′ :
listname × word
n :
o :
args :
listvalue
E :
lookupn e′ = lookupn e
H :
match o with
CheckLocal_ _ _ _ _
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex0 ∧ lookupn e = Somex0
⇒
∃u : Z x : word, extendedt k u = Somex ∧ lookupn e = Somex
_
⇒
∃classes : listclass xs : listword x : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex ∧ lookupn e = Somex
⊢
match o with
CheckLocal_ _ _ _ _
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex0 ∧ lookupn e′ = Somex0
⇒
∃u : Z x : word, extendedt k u = Somex ∧ lookupn e′ = Somex
_
⇒
∃classes : listclass xs : listword x : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex ∧ lookupn e′ = Somex

rewrite E

ge :
e0 :
e, e′ :
listname × word
n :
o :
args :
listvalue
E :
lookupn e′ = lookupn e
H :
match o with
CheckLocal_ _ _ _ _
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex0 ∧ lookupn e = Somex0
⇒
∃u : Z x : word, extendedt k u = Somex ∧ lookupn e = Somex
_
⇒
∃classes : listclass xs : listword x : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex ∧ lookupn e = Somex
⊢
match o with
CheckLocal_ _ _ _ _
⇒
∃classes : listclass xs : listword x0 : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex0 ∧ lookupn e = Somex0
⇒
∃u : Z x : word, extendedt k u = Somex ∧ lookupn e = Somex
_
⇒
∃classes : listclass xs : listword x : word, op_arg_classeso k = Someclasses ∧ map2_optionvalue_xge e0 classes args = Somexs ∧ aluo k xs = Somex ∧ lookupn e = Somex

exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge e0 e e′ n k o args E H
unfold let_holds in *
rewrite E
exact H

Definitions that dominate a point

Dominance of sites composes: a site s that dominates index j of block d, where that site dominates index k of block l, dominates index k of block l.

74Lemma site_dominates_trans
∀ b0 rest doms l k d j s
block_intervalsb0 :: rest = Somedoms
site_dominatesdoms l k SAtd j = true
site_dominatesdoms d j s = true
site_dominatesdoms l k s = true
Explore proof 23 tactics

Initial goal

⊢
∀b0 : block rest : listblock doms : nmapZ × Z l : name k : Z d : name j : Z s : site, block_intervalsb0 :: rest = Somedoms → site_dominatesdoms l k SAtd j = true → site_dominatesdoms d j s = true → site_dominatesdoms l k s = true

intros b0 rest doms l k d j s Hd H1 H2

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
s :
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
site_dominatesdoms l k SAtd j = true
H2 :
site_dominatesdoms d j s = true
⊢
site_dominatesdoms l k s = true

destruct s as | d′ j′ ; reflexivity |

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
site_dominatesdoms l k SAtd j = true
H2 :
site_dominatesdoms d j SAtd′ j′ = true
⊢
site_dominatesdoms l k SAtd′ j′ = true

simpl in *

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
→
j <? k
else
dominatesdoms d l
=
true
H2 :
name_eqbd′ d
→
j′ <? j
else
dominatesdoms d′ d
=
true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

destruct name_eqbd l eqn: Edl ; destruct name_eqbd′ d eqn: Edd

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
focused goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
focused goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
focused goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

–apply name_eqb_true in Edl , Edd

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
d = l
H1 :
j <? k = true
Edd :
d′ = d
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

subst

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j <? k = true
H2 :
j′ <? j = true
⊢
→
j′ <? k
else
dominatesdoms l l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

rewrite name_eqb_refl

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j <? k = true
H2 :
j′ <? j = true
⊢
j′ <? k = true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

apply Z.ltb_lt in H1 , H2

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j < k
H2 :
j′ < j
⊢
j′ <? k = true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

apply Z.ltb_lt

4 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j < k
H2 :
j′ < j
⊢
j′ < k
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

lia

3 open

deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = true
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

–apply name_eqb_true in Edl

3 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
d = l
H1 :
j <? k = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

subst

3 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j <? k = true
H2 :
dominatesdoms d′ l = true
Edd :
name_eqbd′ l = false
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

rewrite Edd

3 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k, j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
H1 :
j <? k = true
H2 :
dominatesdoms d′ l = true
Edd :
name_eqbd′ l = false
⊢
dominatesdoms d′ l = true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

exact H2

2 open

deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = true
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

–apply name_eqb_true in Edd

2 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
d′ = d
H2 :
j′ <? j = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

subst

2 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
H2 :
j′ <? j = true
⊢
→
j′ <? k
else
dominatesdoms d l
=
true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

rewrite Edl

2 open

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
H2 :
j′ <? j = true
⊢
dominatesdoms d l = true
deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

exact H1

deferred goal
b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
⊢
name_eqbd′ l
→
j′ <? k
else
dominatesdoms d′ l
=
true

–destruct name_eqbd′ l eqn: Edl′ ; exfalso | exact dominates_trans_ _ _ Hd _ _ _ H2 H1

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
Edl′ :
name_eqbd′ l = true
⊢
False

apply name_eqb_true in Edl′

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j :
Z
d′ :
j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
Edd :
name_eqbd′ d = false
H2 :
dominatesdoms d′ d = true
Edl′ :
d′ = l
⊢
False

subst d′

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
name_eqbd l = false
H1 :
dominatesdoms d l = true
H2 :
dominatesdoms l d = true
Edd :
name_eqbl d = false
⊢
False

rewrite dom_antisym_ _ _ Hd _ _ H1 H2 , name_eqb_refl in Edl

b0 :
rest :
listblock
doms :
nmapZ × Z
l :
k :
Z
d :
j, j′ :
Z
Hd :
block_intervalsb0 :: rest = Somedoms
Edl :
true = false
H1 :
dominatesdoms d l = true
H2 :
dominatesdoms l d = true
Edd :
name_eqbl d = false
⊢
False

discriminate Edl

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros b0 rest doms l k d j s Hd H1 H2
destruct s as | d′ j′ ; reflexivity |
simpl in *
destruct name_eqbd l eqn: Edl ; destruct name_eqbd′ d eqn: Edd
–apply name_eqb_true in Edl , Edd
subst
apply Z.ltb_lt in H1 , H2
apply Z.ltb_lt
lia
–apply name_eqb_true in Edl
subst
rewrite Edd
exact H2
–apply name_eqb_true in Edd
subst
rewrite Edl
exact H1
–destruct name_eqbd′ l eqn: Edl′ ; exfalso | exact dominates_trans_ _ _ Hd _ _ _ H2 H1
apply name_eqb_true in Edl′
subst d′
rewrite dom_antisym_ _ _ Hd _ _ H1 H2 , name_eqb_refl in Edl
discriminate Edl

In a checked_module md, a single-definition operand a of the instruction i that defines n, where n dominates index k of a reachable block l, dominates it too: the validator requires an operand's definition to dominate its use.

94Lemma operand_dominating
Explore proof 19 tactics

Initial goal

⊢
∀md : module f : func l : name k : Z n : name i : inst a : name, checked_modulemd → InIFuncf md → is_reachablefn_domsf l = true → lookupn single_definitionsf = SomeDInsti → dominatingf l k n → Ina inst_usesi → once_hassingle_definitionsf a = true → dominatingf l k a

intros md f l k n i a Hmd Hin Hr Hn s & D & Hn′ & Hpos & Hsd Hu Ho

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
s :
D :
Hn′ :
Hpos :
Inn, s, D def_positionsf
Hsd :
site_dominatesfn_domsf l k s = true
Hu :
⊢
dominatingf l k a

rewrite Hn in Hn′

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
s :
D :
Hn′ :
SomeDInsti = SomeD
Hpos :
Inn, s, D def_positionsf
Hsd :
site_dominatesfn_domsf l k s = true
Hu :
⊢
dominatingf l k a

injection Hn′ as ←

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
s :
Hpos :
Hsd :
site_dominatesfn_domsf l k s = true
Hu :
⊢
dominatingf l k a

destruct func_facts_ _ Hmd Hin as b0 & rest & Hf & Hd & _ & Hdd

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
s :
Hpos :
Hsd :
site_dominatesfn_domsf l k s = true
Hu :
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
⊢
dominatingf l k a

destruct dinst_site_ _ _ _ Hpos as d & j & →

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
j :
Z
Hsd :
site_dominatesfn_domsf l k SAtd j = true
Hpos :
Hu :
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
⊢
dominatingf l k a

destruct position_inst_ _ _ _ _ Hpos as b & kk & Hb & Hl & Hk & → & _

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

unfold once_has in Ho

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Ho :
Some_
⇒
true
None
⇒
false
=
true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

destruct lookupa single_definitionsf as Da | eqn: Ea ; | discriminate Ho

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

assert Hrb : is_reachablefn_domsf b_labelb = true

2 open

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
focused goal
md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

{rewrite Hl

2 open

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
deferred goal
md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

simpl in Hsd

2 open

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
→
Z.of_natkk <? k
=
true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
deferred goal
md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

destruct name_eqbd l eqn: E ; apply name_eqb_true in E ; subst ; exact Hr |

2 open

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
E :
name_eqbd l = false
Hsd :
dominatesfn_domsf d l = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
deferred goal
md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

exact proj1dominates_reachable_ _ _ Hd _ _ Hsd

deferred goal
md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
⊢
dominatingf l k a

destruct use_dominated_ _ _ _ _ _ _ Hdd Hb Hrb Hk Hu Ea as sa & Hsa & Hsda

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
sa :
Hsa :
Ina, sa, Da def_positionsf
Hsda :
site_dominatesfn_domsf b_labelb Z.of_natkk sa = true
⊢
dominatingf l k a

exists sa, Da

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
sa :
Hsa :
Ina, sa, Da def_positionsf
Hsda :
site_dominatesfn_domsf b_labelb Z.of_natkk sa = true
⊢
lookupa single_definitionsf = SomeDa ∧ Ina, sa, Da def_positionsf ∧ site_dominatesfn_domsf l k sa = true

split ; exact Ea |

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
sa :
Hsa :
Ina, sa, Da def_positionsf
Hsda :
site_dominatesfn_domsf b_labelb Z.of_natkk sa = true
⊢
Ina, sa, Da def_positionsf ∧ site_dominatesfn_domsf l k sa = true

split ; exact Hsa |

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
sa :
Hsa :
Ina, sa, Da def_positionsf
Hsda :
site_dominatesfn_domsf b_labelb Z.of_natkk sa = true
⊢
site_dominatesfn_domsf l k sa = true

rewrite Hl in Hsda

md :
f :
l :
k :
Z
n :
i :
a :
Hin :
InIFuncf md
Hr :
d :
kk :
nat
Hpos :
Inn, SAtd Z.of_natkk, DInsti def_positionsf
Hsd :
site_dominatesfn_domsf l k SAtd Z.of_natkk = true
Hu :
Da :
Ea :
Ho :
true = true
b0 :
rest :
listblock
Hf :
fn_blocksf = b0 :: rest
Hd :
block_intervalsb0 :: rest = Somefn_domsf
Hb :
Hl :
b_labelb = d
Hk :
nth_errorb_instsb kk = Somei
sa :
Hsa :
Ina, sa, Da def_positionsf
Hsda :
site_dominatesfn_domsf d Z.of_natkk sa = true
⊢
site_dominatesfn_domsf l k sa = true

exact site_dominates_trans_ _ _ _ _ _ _ _ Hd Hsd Hsda

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros md f l k n i a Hmd Hin Hr Hn s & D & Hn′ & Hpos & Hsd Hu Ho
rewrite Hn in Hn′
injection Hn′ as ←
destruct func_facts_ _ Hmd Hin as b0 & rest & Hf & Hd & _ & Hdd
destruct dinst_site_ _ _ _ Hpos as d & j & →
destruct position_inst_ _ _ _ _ Hpos as b & kk & Hb & Hl & Hk & → & _
unfold once_has in Ho
destruct lookupa single_definitionsf as Da | eqn: Ea ; | discriminate Ho
assert Hrb : is_reachablefn_domsf b_labelb = true
{rewrite Hl
simpl in Hsd
destruct name_eqbd l eqn: E ; apply name_eqb_true in E ; subst ; exact Hr |
exact proj1dominates_reachable_ _ _ Hd _ _ Hsd
destruct use_dominated_ _ _ _ _ _ _ Hdd Hb Hrb Hk Hu Ea as sa & Hsa & Hsda
exists sa, Da
split ; exact Ea |
split ; exact Hsa |
rewrite Hl in Hsda
exact site_dominates_trans_ _ _ _ _ _ _ _ Hd Hsd Hsda

Where every replayable single definition in scope replays (scope_holds), a replayable definition i of n that dominates the frame's point replays: scope_holds read at one name.

116Lemma dominating_replays
∀ ge fr m l k n i
Explore proof 4 tactics

Initial goal

⊢
∀ge : genv fr : frame m : Memory.mem l : name k : Z n : name i : inst, scope_holdsge fr m → point_sitefr_fnfr fr_atfr = Somel, k → lookupn single_definitionsfr_fnfr = SomeDInsti → replayablei = true → dominatingfr_fnfr l k n → replaysge single_definitionsfr_fnfr fr_envfr m n i

intros ge fr m l k n i Hs Hpt Hn Hrp s & D & Hn′ & Hpos & Hsd

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
s :
D :
Hn′ :
Hpos :
Inn, s, D def_positionsfr_fnfr
Hsd :

rewrite Hn in Hn′

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
s :
D :
Hn′ :
SomeDInsti = SomeD
Hpos :
Inn, s, D def_positionsfr_fnfr
Hsd :

injection Hn′ as ←

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
s :
Hpos :
Hsd :

exact Hs_ _ _ _ _ Hpt Hn Hrp Hpos Hsd

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge fr m l k n i Hs Hpt Hn Hrp s & D & Hn′ & Hpos & Hsd
rewrite Hn in Hn′
injection Hn′ as ←
exact Hs_ _ _ _ _ Hpt Hn Hrp Hpos Hsd

dominating_replays where only definitions that are not a check_ahead need to replay (scope_plain), for a definition that is not one (ahead_free).

128Lemma plain_replays
∀ ge fr m l k n i
Explore proof 4 tactics

Initial goal

⊢
∀ge : genv fr : frame m : Memory.mem l : name k : Z n : name i : inst, scope_plainge fr m → point_sitefr_fnfr fr_atfr = Somel, k → lookupn single_definitionsfr_fnfr = SomeDInsti → replayablei = true → ahead_freei = true → dominatingfr_fnfr l k n → replaysge single_definitionsfr_fnfr fr_envfr m n i

intros ge fr m l k n i Hs Hpt Hn Hrp Ha s & D & Hn′ & Hpos & Hsd

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
Ha :
ahead_freei = true
s :
D :
Hn′ :
Hpos :
Inn, s, D def_positionsfr_fnfr
Hsd :

rewrite Hn in Hn′

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
Ha :
ahead_freei = true
s :
D :
Hn′ :
SomeDInsti = SomeD
Hpos :
Inn, s, D def_positionsfr_fnfr
Hsd :

injection Hn′ as ←

ge :
fr :
m :
Memory.mem
l :
k :
Z
n :
i :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hrp :
replayablei = true
Ha :
ahead_freei = true
s :
Hpos :
Hsd :

exact Hs_ _ _ _ _ Hpt Hn Hrp Hpos Hsd Ha

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge fr m l k n i Hs Hpt Hn Hrp Ha s & D & Hn′ & Hpos & Hsd
rewrite Hn in Hn′
injection Hn′ as ←
exact Hs_ _ _ _ _ Hpt Hn Hrp Hpos Hsd Ha

Offset intervals at a point

An offset interval from lo to hi that the validator derives for a value v at class k' (iv, offset_interval/8) holds of the value the frame reads (in_iv), where v's name dominates the frame's point and every single definition in scope but a check_ahead replays.

144Theorem interval_at
∀ ge md fr m l k v k′ lo hi
InIFuncfr_fnfr md
point_sitefr_fnfr fr_atfr = Somel, k
∀n, v = Tmpn → dominatingfr_fnfr l k n
in_ivge fr_envfr k′ v lo hi
Explore proof 15 tactics

Initial goal

⊢
∀ge : genv md : module fr : frame m : Memory.mem l : name k : Z v : value k′ : class lo hi : Z, checked_modulemd → InIFuncfr_fnfr md → is_reachablefn_domsfr_fnfr l = true → scope_plainge fr m → point_sitefr_fnfr fr_atfr = Somel, k → ivsingle_definitionsfr_fnfr v k′ lo hi → ∀n : name, v = Tmpn → dominatingfr_fnfr l k n → in_ivge fr_envfr k′ v lo hi

intros ge md fr m l k v k′ lo hi Hmd Hin Hr Hs Hpt Hiv Hv

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
⊢
in_ivge fr_envfr k′ v lo hi

refine iv_sound_ ge fr_envfr dominatingfr_fnfr l k _ _ _ _ _ Hiv Hv

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
⊢
∀n : name k0 : class o : op args : listvalue, definedsingle_definitionsfr_fnfr n k0 o args → iv_opo = true → class_bitsk0 ≠ None → dominatingfr_fnfr l k n → ∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

intros n k0 o args n′ & Hn & Ene Hop Hk Hdom

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
n′ :
Hn :
lookupn single_definitionsfr_fnfr = SomeDInstLetn′ k0 o args
Ene :
name_eqbn′ n = true
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

apply name_eqb_true in Ene

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
n′ :
Hn :
lookupn single_definitionsfr_fnfr = SomeDInstLetn′ k0 o args
Ene :
n′ = n
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

subst n′

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

assert Hrp : replayableLetn k0 o args = true by destruct o ; try discriminate Hop ; reflexivity

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

assert Haf : ahead_freeLetn k0 o args = true by destruct o ; try discriminate Hop ; reflexivity

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

destruct plain_replays_ _ _ _ _ _ _ Hs Hpt Hn Hrp Haf Hdom as fr0 & m0 & e1 & l1 & m1 & Hst & Hn1 & Ha & _

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
⊢
∃e0 : env, let_holdsge e0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa e0 = lookupa fr_envfr

exists fr_envfr0

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
⊢
let_holdsge fr_envfr0 fr_envfr n k0 o args ∧ ∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa fr_envfr0 = lookupa fr_envfr

split

2 open

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
⊢
let_holdsge fr_envfr0 fr_envfr n k0 o args
focused goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
⊢
∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa fr_envfr0 = lookupa fr_envfr

–exact let_holds_name_ _ _ _ _ _ _ _ eq_symHn1 step_let_holds_ _ _ _ _ _ _ _ _ _ Hop Hk Hst

deferred goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
⊢
∀a : name, InTmpa args → once_hassingle_definitionsfr_fnfr a = true → dominatingfr_fnfr l k a ∧ lookupa fr_envfr0 = lookupa fr_envfr

–intros a Hin′ Ho

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
a :
Hin′ :
InTmpa args
⊢
dominatingfr_fnfr l k a ∧ lookupa fr_envfr0 = lookupa fr_envfr

split

2 open

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
a :
Hin′ :
InTmpa args
⊢
focused goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
a :
Hin′ :
InTmpa args
⊢

+exact operand_dominating_ _ _ _ _ _ _ Hmd Hin Hr Hn Hdom value_temps_in_ _ Hin′ Ho

deferred goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
k′ :
lo, hi :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
Hiv :
Hv :
∀n : name, v = Tmpn → dominatingfr_fnfr l k n
n :
k0 :
o :
args :
listvalue
Hn :
Hop :
iv_opo = true
Hk :
class_bitsk0 ≠ None
Hdom :
Hrp :
replayableLetn k0 o args = true
Haf :
ahead_freeLetn k0 o args = true
fr0 :
m0 :
Memory.mem
e1 :
l1 :
listname × optionZ
m1 :
Memory.mem
Hst :
inst_stepge fr0 m0 Letn k0 o args = SomeIContinuee1 l1 m1
Hn1 :
lookupn e1 = lookupn fr_envfr
Ha :
∀a : name, Ina inst_usesLetn k0 o args → once_hassingle_definitionsfr_fnfr a = true → lookupa fr_envfr0 = lookupa fr_envfr
a :
Hin′ :
InTmpa args
⊢

+exact Ha_ value_temps_in_ _ Hin′ Ho

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge md fr m l k v k′ lo hi Hmd Hin Hr Hs Hpt Hiv Hv
refine iv_sound_ ge fr_envfr dominatingfr_fnfr l k _ _ _ _ _ Hiv Hv
intros n k0 o args n′ & Hn & Ene Hop Hk Hdom
apply name_eqb_true in Ene
subst n′
assert Hrp : replayableLetn k0 o args = true by destruct o ; try discriminate Hop ; reflexivity
assert Haf : ahead_freeLetn k0 o args = true by destruct o ; try discriminate Hop ; reflexivity
destruct plain_replays_ _ _ _ _ _ _ Hs Hpt Hn Hrp Haf Hdom as fr0 & m0 & e1 & l1 & m1 & Hst & Hn1 & Ha & _
exists fr_envfr0
split
–exact let_holds_name_ _ _ _ _ _ _ _ eq_symHn1 step_let_holds_ _ _ _ _ _ _ _ _ _ Hop Hk Hst
–intros a Hin′ Ho
split
+exact operand_dominating_ _ _ _ _ _ _ Hmd Hin Hr Hn Hdom value_temps_in_ _ Hin′ Ho
+exact Ha_ value_temps_in_ _ Hin′ Ho

The hull of two checks

An access check that passes (cap_access_res) is at an address aligned to its alignment al.

168Lemma cap_access_aligned
∀ c rs a size r al
cap_access_resc rs a size r al = Someok
a mod al = 0
Explore proof 5 tactics

Initial goal

⊢
∀c : cap rs : listregion a size : Z r : rights al : Z, cap_access_resc rs a size r al = Someok → a mod al = 0

unfold cap_access_res

⊢
∀ c : cap rs : listregion a size : Z r : rights al : Z  ,
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a && a + size ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a && a + size ≤? r_endreg
→
⇒
None
=
Someok
→
a mod al = 0

intros c rs a size r al H

c :
rs :
listregion
a, size :
Z
al :
Z
H :
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a && a + size ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a && a + size ≤? r_endreg
→
⇒
None
=
Someok
⊢
a mod al = 0

destruct c as | base | base | f | n ; try discriminate H ; destruct object_regionbase rs as reg | ; try discriminate H ; destruct base ≤? a && a + size ≤? r_endreg ; try discriminate H ; injection H as H

2 open

base :
Z
rs :
listregion
a, size :
Z
al :
Z
reg :
H :
⊢
a mod al = 0
focused goal
base :
Z
rs :
listregion
a, size :
Z
al :
Z
reg :
⊢
a mod al = 0

–exact aligned_res_mod_ _ H

deferred goal
base :
Z
rs :
listregion
a, size :
Z
al :
Z
reg :
⊢
a mod al = 0

–destruct r ; exact aligned_res_mod_ _ H | discriminate H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros c rs a size r al H
destruct c as | base | base | f | n ; try discriminate H ; destruct object_regionbase rs as reg | ; try discriminate H ; destruct base ≤? a && a + size ≤? r_endreg ; try discriminate H ; injection H as H
–exact aligned_res_mod_ _ H
–destruct r ; exact aligned_res_mod_ _ H | discriminate H

Every raw access's alignment divides 2^64, so an address modulo 2^64 is aligned as the address is.

182Lemma access_align_divides
∀ x
sndaccess_size_alignx | 2 ^ 64
Explore proof 1 tactics

Initial goal

⊢
∀x : access_type, sndaccess_size_alignx | 2 ^ 64

intros | | | | t | w | ; try destruct w ; simpl ; first exists 2 ^ 64 ; reflexivity | exists 2 ^ 61 ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros | | | | t | w | ; try destruct w ; simpl ; first exists 2 ^ 64 ; reflexivity | exists 2 ^ 61 ; reflexivity

An access between two passed checks of one capability c, at addresses of one pointer A that are near offsets apart, passes too (the arithmetic of hull_covered/7). The first check's span ends at or above -2^62 and starts at or below the access; the second's starts at or below 2^62 and ends at or above it. A read needs nothing more; a write needs some write check of the capability to have passed.

The two checks compare addresses taken modulo 2^64. They are A+l1 and A+l2 exactly, not merely congruent to them, only because the object ends at or below 2^48 (objects_fit): addresses inside it that are congruent and less than 2^63 apart are equal.

200Lemma cap_access_hull
∀ c rs A l1 s1 r1 al1 l2 s2 r2 al2 off size need aa
cap_access_resc rs raw_addressA l1 s1 r1 al1 = Someok
cap_access_resc rs raw_addressA l2 s2 r2 al2 = Someok
−2 ^ 62 ≤ l1 + s1
l2 ≤ 2 ^ 62
l1 ≤ off
off + size ≤ l2 + s2
0 < size
raw_addressA off mod aa = 0
need = Read ∨ ∃a3 s3 al3, cap_access_resc rs a3 s3 Write al3 = Someok
cap_access_resc rs raw_addressA off size need aa = Someok
Explore proof 16 tactics

Initial goal

⊢
∀c : cap rs : listregion A l1 s1 : Z r1 : rights al1 l2 s2 : Z r2 : rights al2 off size : Z need : rights aa : Z, objects_fitrs → cap_access_resc rs raw_addressA l1 s1 r1 al1 = Someok → cap_access_resc rs raw_addressA l2 s2 r2 al2 = Someok → −2 ^ 62 ≤ l1 + s1 → l2 ≤ 2 ^ 62 → l1 ≤ off → off + size ≤ l2 + s2 → 0 < size → raw_addressA off mod aa = 0 → need = Read ∨ ∃a3 s3 al3 : Z, cap_access_resc rs a3 s3 Write al3 = Someok → cap_access_resc rs raw_addressA off size need aa = Someok

intros c rs A l1 s1 r1 al1 l2 s2 r2 al2 off size need aa Hfit H1 H2 Hh1 Hl2 Hoff Hend Hs Hal Hr

c :
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
cap_access_resc rs raw_addressA l1 s1 r1 al1 = Someok
H2 :
cap_access_resc rs raw_addressA l2 s2 r2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read ∨ ∃a3 s3 al3 : Z, cap_access_resc rs a3 s3 Write al3 = Someok
⊢
cap_access_resc rs raw_addressA off size need aa = Someok

assert Hpos : ∀a, 0 ≤ raw_addressA a < 2 ^ 64 by intros a ; apply Z.mod_pos_bound ; lia

c :
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
cap_access_resc rs raw_addressA l1 s1 r1 al1 = Someok
H2 :
cap_access_resc rs raw_addressA l2 s2 r2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read ∨ ∃a3 s3 al3 : Z, cap_access_resc rs a3 s3 Write al3 = Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
⊢
cap_access_resc rs raw_addressA off size need aa = Someok

assert Hdiv : ∀a, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a by intros a ; apply Z.div_mod ; lia

c :
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
cap_access_resc rs raw_addressA l1 s1 r1 al1 = Someok
H2 :
cap_access_resc rs raw_addressA l2 s2 r2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read ∨ ∃a3 s3 al3 : Z, cap_access_resc rs a3 s3 Write al3 = Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
cap_access_resc rs raw_addressA off size need aa = Someok

unfold cap_access_res in *

c :
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
⇒
None
=
Someok
H2 :
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
⇒
None
=
Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
⇒
None
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
match c with
Objbase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
Robase
⇒
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
⇒
None
=
Someok

destruct c as | base | base | f | n ; try discriminate H1

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
=
Someok
H2 :
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
=
Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
let* reg ≔ object_regionbase rs in
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok
focused goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
H1 :
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
=
Someok
H2 :
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
=
Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
let* reg ≔ object_regionbase rs in
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
let* reg ≔ object_regionbase rs in
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok

all: destruct object_regionbase rs as reg | eqn: E ; try discriminate H1

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
H1 :
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
=
Someok
H2 :
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
=
Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok
focused goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
H1 :
Some
base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg
→
=
Someok
H2 :
Some
base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg
→
=
Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok

all: pose proof Hfit_ _ E as Hend′ ; destruct base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg eqn: B1 ; | discriminate H1 ; destruct base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg eqn: B2 ; | discriminate H2 ; apply andb_true_iff in B1 as B1 B1′ ; apply andb_true_iff in B2 as B2 B2′ ; apply Z.leb_le in B1 , B1′ , B2 , B2′

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somealigned_resraw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somealigned_resraw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok
focused goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok

all: pose proof Hposl1 ; pose proof Hposl2 ; pose proof Hposoff ; pose proof Hdivl1 ; pose proof Hdivl2 ; pose proof Hdivoff

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somealigned_resraw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somealigned_resraw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok
focused goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Some
base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg
→
=
Someok

all: replace base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg with true by symmetry ; apply andb_true_iff ; split ; apply Z.leb_le ; lia

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somealigned_resraw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somealigned_resraw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Somealigned_resraw_addressA off aa = Someok
focused goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Somereadonly_access_resneed raw_addressA off aa = Someok

–f_equal

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somealigned_resraw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somealigned_resraw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
deferred goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Somereadonly_access_resneed raw_addressA off aa = Someok

apply aligned_res_ok

2 open

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somealigned_resraw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somealigned_resraw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
raw_addressA off mod aa = 0
deferred goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Somereadonly_access_resneed raw_addressA off aa = Someok

exact Hal

deferred goal
base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size :
Z
need :
aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
need = Read
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
Somereadonly_access_resneed raw_addressA off aa = Someok

–destruct need ; simpl ; f_equal ; apply aligned_res_ok ; exact Hal |

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size, aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
SomeRTrapReadonly = Someok

exfalso

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size, aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
Hr :
∨
∃ a3 s3 al3 : Z  ,
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
False

destruct Hr as Hr | a3 & s3 & al3 & Hw ; discriminate Hr |

base :
Z
rs :
listregion
A, l1, s1 :
Z
r1 :
al1, l2, s2 :
Z
r2 :
al2, off, size, aa :
Z
Hfit :
reg :
E :
object_regionbase rs = Somereg
B1 :
base ≤ raw_addressA l1
B1′ :
raw_addressA l1 + s1 ≤ r_endreg
H1 :
Somereadonly_access_resr1 raw_addressA l1 al1 = Someok
B2 :
base ≤ raw_addressA l2
B2′ :
raw_addressA l2 + s2 ≤ r_endreg
H2 :
Somereadonly_access_resr2 raw_addressA l2 al2 = Someok
Hh1 :
−2 ^ 62 ≤ l1 + s1
Hl2 :
l2 ≤ 2 ^ 62
Hoff :
l1 ≤ off
Hend :
off + size ≤ l2 + s2
Hs :
0 < size
Hal :
raw_addressA off mod aa = 0
a3, s3, al3 :
Z
Hw :
Some
base ≤? a3 && a3 + s3 ≤? r_endreg
→
=
Someok
Hpos :
∀a : Z, 0 ≤ raw_addressA a < 2 ^ 64
Hdiv :
∀a : Z, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a
Hend′ :
0 ≤ base ∧ r_endreg ≤ 2 ^ 48
H :
0 ≤ raw_addressA l1 < 2 ^ 64
H0 :
0 ≤ raw_addressA l2 < 2 ^ 64
H3 :
0 ≤ raw_addressA off < 2 ^ 64
H4 :
A + l1 = 2 ^ 64 × A + l1 / 2 ^ 64 + raw_addressA l1
H5 :
A + l2 = 2 ^ 64 × A + l2 / 2 ^ 64 + raw_addressA l2
H6 :
A + off = 2 ^ 64 × A + off / 2 ^ 64 + raw_addressA off
⊢
False

destruct _ && _ ; discriminate Hw

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros c rs A l1 s1 r1 al1 l2 s2 r2 al2 off size need aa Hfit H1 H2 Hh1 Hl2 Hoff Hend Hs Hal Hr
assert Hpos : ∀a, 0 ≤ raw_addressA a < 2 ^ 64 by intros a ; apply Z.mod_pos_bound ; lia
assert Hdiv : ∀a, A + a = 2 ^ 64 × A + a / 2 ^ 64 + raw_addressA a by intros a ; apply Z.div_mod ; lia
unfold cap_access_res in *
destruct c as | base | base | f | n ; try discriminate H1
all: destruct object_regionbase rs as reg | eqn: E ; try discriminate H1
all: pose proof Hfit_ _ E as Hend′ ; destruct base ≤? raw_addressA l1 && raw_addressA l1 + s1 ≤? r_endreg eqn: B1 ; | discriminate H1 ; destruct base ≤? raw_addressA l2 && raw_addressA l2 + s2 ≤? r_endreg eqn: B2 ; | discriminate H2 ; apply andb_true_iff in B1 as B1 B1′ ; apply andb_true_iff in B2 as B2 B2′ ; apply Z.leb_le in B1 , B1′ , B2 , B2′
all: pose proof Hposl1 ; pose proof Hposl2 ; pose proof Hposoff ; pose proof Hdivl1 ; pose proof Hdivl2 ; pose proof Hdivoff
all: replace base ≤? raw_addressA off && raw_addressA off + size ≤? r_endreg with true by symmetry ; apply andb_true_iff ; split ; apply Z.leb_le ; lia
–f_equal
exact Hal
–destruct need ; simpl ; f_equal ; apply aligned_res_ok ; exact Hal |
exfalso
destruct Hr as Hr | a3 & s3 & al3 & Hw ; discriminate Hr |
destruct _ && _ ; discriminate Hw

Guard chains

What first_some finds is f of some element of the list.

235Lemma first_some_in
∀ X Y : Type f : X → optionY xs y
first_somef xs = Somey
∃x, Inx xs ∧ fx = Somey
Explore proof 3 tactics

Initial goal

⊢
∀X Y : Type f : X → optionY xs : listX y : Y, first_somef xs = Somey → ∃x : X, Inx xs ∧ fx = Somey

intros X Y f xs y

X :
Type
Y :
Type
f :
X → optionY
xs :
listX
y :
Y
⊢
first_somef xs = Somey → ∃x : X, Inx xs ∧ fx = Somey

induction xs as | x xs IH ; simpl ; intros H ; discriminate H |

X :
Type
Y :
Type
f :
X → optionY
x :
X
xs :
listX
y :
Y
IH :
first_somef xs = Somey → ∃x : X, Inx xs ∧ fx = Somey
H :
match fx with
Somey
⇒
Somey
None
⇒
=
Somey
⊢
∃x0 : X, x = x0 ∨ Inx0 xs ∧ fx0 = Somey

destruct fx eqn: E ; injection H as ← ; eauto | destruct IHH as x′ & Hin & Hx ; eauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros X Y f xs y
induction xs as | x xs IH ; simpl ; intros H ; discriminate H |
destruct fx eqn: E ; injection H as ← ; eauto | destruct IHH as x′ & Hin & Hx ; eauto

A flight that is the single definition of y defines y.

243Lemma flight_def_name
∀ f y d o args lw
d = y
Explore proof 7 tactics

Initial goal

⊢
∀f : func y d : name o : op args : listflight_arg lw : flight_lower, lookupy single_definitionsf = SomeDInstFlightd o args lw → d = y

intros f y d o args lw H

f :
y, d :
o :
args :
H :
⊢
d = y

destruct once_position_ _ _ H as s & Hpos & _

f :
y, d :
o :
args :
H :
s :
Hpos :
Iny, s, DInstFlightd o args lw def_positionsf
⊢
d = y

destruct dinst_site_ _ _ _ Hpos as dd & j & →

f :
y, d :
o :
args :
H :
dd :
j :
Z
Hpos :
Iny, SAtdd j, DInstFlightd o args lw def_positionsf
⊢
d = y

destruct position_inst_ _ _ _ _ Hpos as _ & _ & _ & _ & _ & _ & Hy

f :
y, d :
o :
args :
H :
dd :
j :
Z
Hpos :
Iny, SAtdd j, DInstFlightd o args lw def_positionsf
Hy :
Iny mapfst inst_temp_defsFlightd o args lw
⊢
d = y

simpl in Hy

f :
y, d :
o :
args :
H :
dd :
j :
Z
Hpos :
Iny, SAtdd j, DInstFlightd o args lw def_positionsf
Hy :
d = y ∨ False
⊢
d = y

destruct Hy as → |

f :
y :
o :
args :
H :
dd :
j :
Z
Hpos :
Iny, SAtdd j, DInstFlighty o args lw def_positionsf
⊢
y = y

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros f y d o args lw H
destruct once_position_ _ _ H as s & Hpos & _
destruct dinst_site_ _ _ _ Hpos as dd & j & →
destruct position_inst_ _ _ _ _ Hpos as _ & _ & _ & _ & _ & _ & Hy
simpl in Hy
destruct Hy as → |
reflexivity

A value v reads alike (value_x) in two environments e0 and e that agree on its name.

254Lemma value_x_agree
∀ ge e0 e k v
∀y, v = Tmpy → lookupy e0 = lookupy e
value_xge e0 k v = value_xge e k v
Explore proof 2 tactics

Initial goal

⊢
∀ge : genv e0 e : listname × word k : class v : value, ∀y : name, v = Tmpy → lookupy e0 = lookupy e → value_xge e0 k v = value_xge e k v

intros ge e0 e k v H

ge :
e0, e :
listname × word
H :
∀y : name, v = Tmpy → lookupy e0 = lookupy e
⊢
value_xge e0 k v = value_xge e k v

destruct v as y | c | g ; simpl ; rewrite Hy eq_refl | | ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge e0 e k v H
destruct v as y | c | g ; simpl ; rewrite Hy eq_refl | | ; reflexivity

What a guard chain element (b, lo, hi) says of a pointer pp0: the value b reads in the environment e as a pointer with pp0's capability, and pp0's address is b's plus some x between lo and hi, modulo 2^64.

262Definition offset_relge : genv e : env pp0 : ptr b : value lo hi : Z : Prop ≔
∃pb x, value_xge e P b = SomeWPtrpb ∧ ptr_cappb = ptr_cappp0 ∧ lo ≤ x ≤ hi ∧ ptr_addrpp0 mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64

A value v is not a name defined more than once: a constant, a global, or a single-definition name in once.

268Definition stableonce : listname × def v : value : Prop ≔
∀y, v = Tmpy → once_hasonce y = true

The address arithmetic of an add flight: shifting by z and then by xo is shifting by xo + z, modulo 2^64.

272Lemma mod_shift_add
∀ a z xo
a mod 2 ^ 64 + z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64
Explore proof 4 tactics

Initial goal

⊢
∀a z xo : Z, a mod 2 ^ 64 + z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

intros a z xo

a, z, xo :
Z
⊢
a mod 2 ^ 64 + z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

rewrite <- Z.add_mod , Z.add_mod_idemp_l by lia

a, z, xo :
Z
⊢
a + z + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

f_equal

a, z, xo :
Z
⊢
a + z + xo = a + xo + z

lia

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a z xo
rewrite <- Z.add_mod , Z.add_mod_idemp_l by lia
f_equal
lia

The same for a sub flight: shifting by -z and then xo.

277Lemma mod_shift_sub
∀ a z xo
a mod 2 ^ 64 − z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo − z mod 2 ^ 64
Explore proof 4 tactics

Initial goal

⊢
∀a z xo : Z, a mod 2 ^ 64 − z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo − z mod 2 ^ 64

intros a z xo

a, z, xo :
Z
⊢
a mod 2 ^ 64 − z mod 2 ^ 64 mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo − z mod 2 ^ 64

rewrite <- Zminus_mod , Z.add_mod_idemp_l by lia

a, z, xo :
Z
⊢
a − z + xo mod 2 ^ 64 = a + xo − z mod 2 ^ 64

f_equal

a, z, xo :
Z
⊢
a − z + xo = a + xo − z

lia

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a z xo
rewrite <- Zminus_mod , Z.add_mod_idemp_l by lia
f_equal
lia

The same for a copy flight, whose shift z is 0 modulo 2^64.

282Lemma mod_shift_zero
∀ a z xo
z mod 2 ^ 64 = 0
a mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64
Explore proof 4 tactics

Initial goal

⊢
∀a z xo : Z, z mod 2 ^ 64 = 0 → a mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

intros a z xo Hz

a, z, xo :
Z
Hz :
z mod 2 ^ 64 = 0
⊢
a mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

replace a + xo + z with a + xo + z by lia

a, z, xo :
Z
Hz :
z mod 2 ^ 64 = 0
⊢
a mod 2 ^ 64 + xo mod 2 ^ 64 = a + xo + z mod 2 ^ 64

rewrite Z.add_moda + xo z , Hz , Z.add_0_r , Z.mod_mod , Z.add_mod_idemp_l by lia

a, z, xo :
Z
Hz :
z mod 2 ^ 64 = 0
⊢
a + xo mod 2 ^ 64 = a + xo mod 2 ^ 64

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros a z xo Hz
replace a + xo + z with a + xo + z by lia
rewrite Z.add_moda + xo z , Hz , Z.add_0_r , Z.mod_mod , Z.add_mod_idemp_l by lia
reflexivity

Lemmas for a frame fr of a checked_module md, in memory m, at index k of a reachable block l, where every single definition in scope but a check_ahead replays (scope_plain).

293Section Chain
295Variables ge : genv
295Variables md : module
295Variables fr : frame
295Variables m : Memory.mem
295Variables l : name
295Variables k : Z
296Hypothesis Hmd
297Hypothesis Hin
298Hypothesis Hr
299Hypothesis Hs
300Hypothesis Hpt

Every stable element of a guard chain walked from p with fuel steps (guard_chain/3) holds of the pointer pp0 (offset_rel), where p's single definition dominates the point and p's own element holds. The induction behind guard_chain_sound.

306Lemma chain_go_sound
∀ fuel p lo hi pp0 b blo bhi
offset_relge fr_envfr pp0 b blo bhi
Proof 76 steps Qed
induction fuel as | fuel IH ; intros p lo hi pp0 Hdom Hrel b blo bhi Hb Hst ; simpl in Hb
–destruct Hb as E |
injection E as → → →
exact HrelHst
–destruct Hb as E | Hb ; injection E as → → → ; exact HrelHst |
destruct p as x | c | g ; try contradiction
destruct lookupx single_definitionsfr_fnfr as | ph | i | eqn: Ex ; try contradiction
destruct i as | d o args lw | | | | | | ; try contradiction
destruct lw as | b′ ; try contradiction
destruct flight_termo args b' as ov sign | eqn: Ef ; | contradiction
destruct offset_interval_ ov L as olo ohi | eqn: Eo ; | contradiction
pose proof flight_def_name_ _ _ _ _ _ Ex as →
assert Hox : once_hassingle_definitionsfr_fnfr x = true by unfold once_has ; rewrite Ex ; reflexivity
pose proof Hdomx eq_refl Hox as Hdx
destruct Hrelltac:intros y E ; injection E as ← ; exact Hox as pp & xo & Hpp & Hcap & Hxo & Haddr
destruct plain_replays_ _ _ _ _ _ _ Hs Hpt Ex eq_refl eq_refl Hdx as fr0 & m0 & e1 & l1 & m1 & Hst′ & Hx1 & Hops & _
assert Hop : ∀y, InTmpy mapflight_arg_value args ++ b' → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y ∧ lookupy fr_envfr0 = lookupy fr_envfr
{intros y Hy Ho
split
–exact operand_dominating_ _ _ _ _ _ _ Hmd Hin Hr Ex Hdx value_temps_in_ _ Hy Ho
–exact Hops_ value_temps_in_ _ Hy Ho
assert Hov : ∀y, ov = Tmpy → InTmpy mapflight_arg_value args ++ b' → ∃z, olo ≤ z ≤ ohi ∧ value_xge fr_envfr0 L ov = SomeWIntz mod 2 ^ 64
{intros Hin′
pose proof offset_interval_iv_ _ _ _ _ Eo as Hiv
assert Hdv : ∀y, ov = Tmpy → dominatingfr_fnfr l k y ∧ lookupy fr_envfr0 = lookupy fr_envfr by intros y E ; exact Hopy Hin'y E iv_once_ _ _ _ _ Hiv _ E
destruct interval_at_ _ _ _ _ _ _ _ _ _ Hmd Hin Hr Hs Hpt Hiv λy E ⇒ proj1Hdvy E as bits & u′ & z & Hbits & Hu & Hz & →
injection Hbits as ←
exists z
split ; exact Hz |
rewrite <- Hu
intros y E
exact proj2Hdvy E
assert Hdb : ∀y, b' = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y ∧ lookupy fr_envfr0 = lookupy fr_envfr by intros y E Ho ; subst b' ; apply Hop ; apply in_or_app ; right ; left ; reflexivity | exact Ho
simpl in Hst'
unfold flight_cap in Hst'
unfold flight_term in Ef
cases Ef ; injection Ef as ← ←;match goal withE : value_eqb_ _ = true |- _⇒apply value_eqb_eq in E ; substend
all: simpl in Hst'
all: destruct value_xge fr_envfr0 P b' as u0 | pb0 | c0 s0 | eqn: Eb ; simpl in Hst' ; try discriminate Hst'
all: try (match type of Hst' withcontext [value_x_ _ L ?w]⇒destruct value_xge fr_envfr0 L w as u | | | eqn: Evend;simpl in Hst';try discriminate Hst')
all: injection Hst' as ← _ _
all: rewrite lookup_put , name_eqb_refl in Hx1
all: simpl in Hpp ; rewrite <- Hx1 in Hpp ; simpl in Hpp ; injection Hpp as ← ; simpl in Hcap
all: change Z.pow_pos2 64 with 2 ^ 64 in *
all: assert Hb′ : stablesingle_definitionsfr_fnfr b' → value_xge fr_envfr P b' = SomeWPtrpb0 by intros Hsb ; rewrite <- Eb ; symmetry ; apply value_x_agree ; intros y E ; exact proj2Hdby E Hsby E
all: simpl in Hb
all: refine IHb' _ _ pp0 λy E Ho ⇒ proj1Hdby E Ho _ b blo bhi Hb Hst ; intros Hsb
all: destruct Hovltac:intros y E ; first discriminate E | subst ; simpl ; auto 10 as z & Hz & Ez ; injection Ez as Ez
+exists pb0, xo + z
split ; exact Hb'Hsb |
split ; exact Hcap |
split ; lia |
rewrite Haddr
simpl
change Z.pow_pos2 64 with 2 ^ 64 in *
rewrite Ez
+exists pb0, xo − z
split ; exact Hb'Hsb |
split ; exact Hcap |
split ; lia |
rewrite Haddr
simpl
rewrite Ez
+exists pb0, xo + z
split ; exact Hb'Hsb |
split ; exact Hcap |
split ; lia |
rewrite Haddr
simpl
change Z.pow_pos2 64 with 2 ^ 64 in *
rewrite <- Ez
reflexivity

guard_chain as an equation. Unfolding it in a hypothesis instead makes the kernel compare two unfoldings of guard_chain_go, which recurses twice per level, 64 levels deep.

373Lemma guard_chain_eq
∀ once p
guard_chainonce p = guard_chain_goonce 64 p 0 0
Explore proof 2 tactics

Initial goal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
⊢
∀once : listname × def p : value, guard_chainonce p = guard_chain_goonce 64 p 0 0

intros once p

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
once :
listname × def
⊢
guard_chainonce p = guard_chain_goonce 64 p 0 0

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros once p
reflexivity

Each stable element of the guard chain of a value p (guard_chain/3) holds of the pointer pp that p reads (offset_rel), where p's single definition dominates the point.

379Lemma guard_chain_sound
Explore proof 10 tactics

Initial goal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
⊢
∀p : value pp : ptr b : value blo bhi : Z, value_xge fr_envfr P p = SomeWPtrpp → ∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y → Inb, blo, bhi guard_chainsingle_definitionsfr_fnfr p → stablesingle_definitionsfr_fnfr b → offset_relge fr_envfr pp b blo bhi

intros p pp b blo bhi Hp Hdom Hb Hst

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
⊢
offset_relge fr_envfr pp b blo bhi

rewrite guard_chain_eq in Hb

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
offset_relge fr_envfr pp b blo bhi

refine chain_go_sound64 p 0 0 pp Hdom _ b blo bhi Hb Hst

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0

intros _

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
offset_relge fr_envfr pp p 0 0

exists pp, 0

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
value_xge fr_envfr P p = SomeWPtrpp ∧ ptr_cappp = ptr_cappp ∧ 0 ≤ 0 ≤ 0 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp + 0 mod 2 ^ 64

split ; exact Hp |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
ptr_cappp = ptr_cappp ∧ 0 ≤ 0 ≤ 0 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp + 0 mod 2 ^ 64

split ; reflexivity |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
0 ≤ 0 ≤ 0 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp + 0 mod 2 ^ 64

split ; lia |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
ptr_addrpp mod 2 ^ 64 = ptr_addrpp + 0 mod 2 ^ 64

rewrite Z.add_0_r

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
pp :
blo, bhi :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdom :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hb :
Inb, blo, bhi guard_chain_gosingle_definitionsfr_fnfr 64 p 0 0
⊢
ptr_addrpp mod 2 ^ 64 = ptr_addrpp mod 2 ^ 64

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros p pp b blo bhi Hp Hdom Hb Hst
rewrite guard_chain_eq in Hb
refine chain_go_sound64 p 0 0 pp Hdom _ b blo bhi Hb Hst
intros _
exists pp, 0
split ; exact Hp |
split ; reflexivity |
split ; lia |
rewrite Z.add_0_r
reflexivity

pointer_distance as an equation, for the same reason as guard_chain_eq.

393Lemma pointer_distance_eq
∀ once p p1
=
λ e  ⇒
match exact_baseonce e with
Somen, k
⇒
λ e1  ⇒
match e1 with
Tmpn1, k1, k1′
⇒
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
Explore proof 2 tactics

Initial goal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
⊢
∀ once : listname × def p p1 : value  ,
=
λ e : value × Z × Z  ⇒
match exact_baseonce e with
Somen, k0
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
None
⇒
None

intros once p p1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
once :
listname × def
p, p1 :
⊢
=
λ e : value × Z × Z  ⇒
match exact_baseonce e with
Somen, k0
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
None
⇒
None

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros once p p1
reflexivity

Two values p and p1 that read as pointers pp and pp1, whose guard chains share an exact base d apart (pointer_distance/4), have one capability, and addresses d apart, modulo 2^64, where their single definitions dominate the point. The reuse forms use it to give a renewed pointer its source's capability.

413Theorem pointer_distance_sound
∀ p p1 pp pp1 d
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64
Explore proof 28 tactics

Initial goal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
⊢
∀p p1 : value pp pp1 : ptr d : Z, value_xge fr_envfr P p = SomeWPtrpp → value_xge fr_envfr P p1 = SomeWPtrpp1 → ∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y → ∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y → pointer_distancesingle_definitionsfr_fnfr p p1 = Somed → ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

intros p p1 pp pp1 d Hp Hp1 Hd Hd1 H

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

rewrite pointer_distance_eq in H

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct first_some_in_ _ _ _ _ H as el & Hel & Hf

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
el :
value × Z × Z
Hf :
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct el as n0 | c0 | g0 k0 k0′ ; unfold exact_base in Hf ; try discriminate Hf

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0, k0′ :
Z
Hel :
Hf :
match if k0 =? k0′ && once_hassingle_definitionsfr_fnfr n0 then Somen0, k0 else None with
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct k0 =? k0′ && once_hassingle_definitionsfr_fnfr n0 eqn: E0 ; | discriminate Hf

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0, k0′ :
Z
Hel :
E0 :
k0 =? k0′ && once_hassingle_definitionsfr_fnfr n0 = true
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

apply andb_true_iff in E0 as Ek0 Ho

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0, k0′ :
Z
Hel :
Ek0 :
k0 =? k0′ = true
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

apply Z.eqb_eq in Ek0

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0, k0′ :
Z
Hel :
Ek0 :
k0 = k0′
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

subst k0′

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0 :
Z
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct first_some_in_ _ _ _ _ Hf as el1 & Hel1 & Hf1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0 :
Z
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
el1 :
value × Z × Z
Hf1 :
let y, y0 ≔ el1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct el1 as n1 | c1 | g1 k1 k1′ ; try discriminate Hf1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0 :
Z
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
n1 :
k1, k1′ :
Z
Hel1 :
Hf1 :
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
=
Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

destruct name_eqbn1 n0 && k1 =? k1′ eqn: E1 ; | discriminate Hf1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
d :
Z
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somed
n0 :
k0 :
Z
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somed
n1 :
k1, k1′ :
Z
Hel1 :
E1 :
name_eqbn1 n0 && k1 =? k1′ = true
Hf1 :
Somek0 − k1 = Somed
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + d mod 2 ^ 64

injection Hf1 as ←

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
n1 :
k1′ :
Z
Hel1 :
E1 :
name_eqbn1 n0 && k1 =? k1′ = true
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

apply andb_true_iff in E1 as En Ek

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
n1 :
k1′ :
Z
Hel1 :
En :
name_eqbn1 n0 = true
Ek :
k1 =? k1′ = true
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

apply name_eqb_true in En

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
n1 :
k1′ :
Z
Hel1 :
En :
n1 = n0
Ek :
k1 =? k1′ = true
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

apply Z.eqb_eq in Ek

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
n1 :
k1′ :
Z
Hel1 :
En :
n1 = n0
Ek :
k1 = k1′
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

subst n1 k1′

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

assert Hst : stablesingle_definitionsfr_fnfr Tmpn0 by intros y E ; injection E as ← ; exact Ho

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

destruct guard_chain_sound_ _ _ _ _ Hp Hd Hel Hst as pb & x & Hpb & Hc & Hx & Ha

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

destruct guard_chain_sound_ _ _ _ _ Hp1 Hd1 Hel1 Hst as pb′ & x1 & Hpb′ & Hc1 & Hx1 & Ha1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
pb′ :
x1 :
Z
Hpb′ :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb′
Hc1 :
ptr_cappb′ = ptr_cappp1
Hx1 :
k1 ≤ x1 ≤ k1
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb′ + x1 mod 2 ^ 64
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

rewrite Hpb in Hpb′

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
pb′ :
x1 :
Z
Hpb′ :
SomeWPtrpb = SomeWPtrpb′
Hc1 :
ptr_cappb′ = ptr_cappp1
Hx1 :
k1 ≤ x1 ≤ k1
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb′ + x1 mod 2 ^ 64
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

injection Hpb′ as ←

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
x1 :
Z
Hc1 :
Hx1 :
k1 ≤ x1 ≤ k1
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + x1 mod 2 ^ 64
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

assert x = k0 by lia

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
x1 :
Z
Hc1 :
Hx1 :
k1 ≤ x1 ≤ k1
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + x1 mod 2 ^ 64
H0 :
x = k0
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

assert x1 = k1 by lia

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
x :
Z
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Hx :
k0 ≤ x ≤ k0
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + x mod 2 ^ 64
x1 :
Z
Hc1 :
Hx1 :
k1 ≤ x1 ≤ k1
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + x1 mod 2 ^ 64
H0 :
x = k0
H1 :
x1 = k1
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

subst x x1

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + k0 mod 2 ^ 64
Hx :
k0 ≤ k0 ≤ k0
Hc1 :
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + k1 mod 2 ^ 64
Hx1 :
k1 ≤ k1 ≤ k1
⊢
ptr_cappp = ptr_cappp1 ∧ ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

split ; congruence |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + k0 mod 2 ^ 64
Hx :
k0 ≤ k0 ≤ k0
Hc1 :
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + k1 mod 2 ^ 64
Hx1 :
k1 ≤ k1 ≤ k1
⊢
ptr_addrpp mod 2 ^ 64 = ptr_addrpp1 + k0 − k1 mod 2 ^ 64

rewrite Ha , <- Z.add_mod_idemp_lptr_addrpp1 , Ha1 , Z.add_mod_idemp_l by lia

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + k0 mod 2 ^ 64
Hx :
k0 ≤ k0 ≤ k0
Hc1 :
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + k1 mod 2 ^ 64
Hx1 :
k1 ≤ k1 ≤ k1
⊢
ptr_addrpb + k0 mod 2 ^ 64 = ptr_addrpb + k1 + k0 − k1 mod 2 ^ 64

f_equal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
p, p1 :
pp, pp1 :
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hp1 :
value_xge fr_envfr P p1 = SomeWPtrpp1
Hd :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hd1 :
∀y : name, p1 = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
k0, k1 :
Z
H :
λ e : value × Z × Z  ⇒
Somen, k
⇒
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n && k1 =? k1′
→
Somek − k1
else
None
_
⇒
None
None
⇒
None
=
Somek0 − k1
n0 :
Hf :
λ e1 : value × Z × Z  ⇒
let y, y0 ≔ e1 in
match y with
Tmpn1
⇒
let k1, k1′ ≔ y0 in
name_eqbn1 n0 && k1 =? k1′
→
Somek0 − k1
else
None
_
⇒
None
=
Somek0 − k1
pb :
Hpb :
value_xge fr_envfr P Tmpn0 = SomeWPtrpb
Hc :
Ha :
ptr_addrpp mod 2 ^ 64 = ptr_addrpb + k0 mod 2 ^ 64
Hx :
k0 ≤ k0 ≤ k0
Hc1 :
Ha1 :
ptr_addrpp1 mod 2 ^ 64 = ptr_addrpb + k1 mod 2 ^ 64
Hx1 :
k1 ≤ k1 ≤ k1
⊢
ptr_addrpb + k0 = ptr_addrpb + k1 + k0 − k1

lia

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros p p1 pp pp1 d Hp Hp1 Hd Hd1 H
rewrite pointer_distance_eq in H
destruct first_some_in_ _ _ _ _ H as el & Hel & Hf
destruct el as n0 | c0 | g0 k0 k0′ ; unfold exact_base in Hf ; try discriminate Hf
destruct k0 =? k0′ && once_hassingle_definitionsfr_fnfr n0 eqn: E0 ; | discriminate Hf
apply andb_true_iff in E0 as Ek0 Ho
apply Z.eqb_eq in Ek0
subst k0′
destruct first_some_in_ _ _ _ _ Hf as el1 & Hel1 & Hf1
destruct el1 as n1 | c1 | g1 k1 k1′ ; try discriminate Hf1
destruct name_eqbn1 n0 && k1 =? k1′ eqn: E1 ; | discriminate Hf1
injection Hf1 as ←
apply andb_true_iff in E1 as En Ek
apply name_eqb_true in En
apply Z.eqb_eq in Ek
subst n1 k1′
assert Hst : stablesingle_definitionsfr_fnfr Tmpn0 by intros y E ; injection E as ← ; exact Ho
destruct guard_chain_sound_ _ _ _ _ Hp Hd Hel Hst as pb & x & Hpb & Hc & Hx & Ha
destruct guard_chain_sound_ _ _ _ _ Hp1 Hd1 Hel1 Hst as pb′ & x1 & Hpb′ & Hc1 & Hx1 & Ha1
rewrite Hpb in Hpb′
injection Hpb′ as ←
assert x = k0 by lia
assert x1 = k1 by lia
subst x x1
split ; congruence |
rewrite Ha , <- Z.add_mod_idemp_lptr_addrpp1 , Ha1 , Z.add_mod_idemp_l by lia
f_equal
lia

The hull of a pointer's live facts

Each span from l1 to h1 that hull_covered/7 reads off a live fact is a check that passed, of the capability of the access pointer pp, at its address plus the span's bounds, where the live facts hold (facts_hold) and their pointers dominate the point. The fact's pointer and the access's are a known distance apart (pointer_distance_sound).

446Lemma hull_span_passes
∀ live p pp l1 h1 r1
∀fb y, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
∀y, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Inl1, h1, r1
flat_map
λ f  ⇒
Somed
⇒
let l1 ≔ f_lof + d in
let h1 ≔ f_hif + d in
→
l1, h1, f_rf
else
[ ]
None
⇒
[ ]
live
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok
Explore proof 23 tactics

Initial goal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
⊢
∀ live : listfact p : value pp : ptr l1 h1 : Z r1 : rights  ,
facts_holdge m fr_envfr live
→
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
→
value_xge fr_envfr P p = SomeWPtrpp
→
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
→
Inl1, h1, r1
flat_map
λ f : fact  ⇒
Somed
⇒
let l2 ≔ f_lof + d in
let h2 ≔ f_hif + d in
→
l2, h2, f_rf
else
[ ]
None
⇒
[ ]
live
→
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

intros live p pp l1 h1 r1 Hl Hdom Hp Hdp Hsp

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hsp :
Inl1, h1, r1
flat_map
λ f : fact  ⇒
Somed
⇒
let l1 ≔ f_lof + d in
let h1 ≔ f_hif + d in
→
l1, h1, f_rf
else
[ ]
None
⇒
[ ]
live
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

apply in_flat_map in Hsp as f & Hf & Hsp

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
Hsp :
Inl1, h1, r1
Somed
⇒
let l1 ≔ f_lof + d in
let h1 ≔ f_hif + d in
→
l1, h1, f_rf
else
[ ]
None
⇒
[ ]
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

destruct pointer_distancesingle_definitionsfr_fnfr f_pf p as d | eqn: Ed ; | contradiction

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
Hsp :
Inl1, h1, r1
let l1 ≔ f_lof + d in
let h1 ≔ f_hif + d in
→
l1, h1, f_rf
else
[ ]
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

cbv zeta in Hsp

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
Hsp :
Inl1, h1, r1
→
f_lof + d, f_hif + d, f_rf
else
[ ]
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

destruct near_offsetd && near_offsetf_lof + d && near_offsetf_hif + d eqn: En ; | contradiction

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
En :
near_offsetd && near_offsetf_lof + d && near_offsetf_hif + d = true
Hsp :
Inl1, h1, r1 f_lof + d, f_hif + d, f_rf
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

destruct Hsp as E |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
l1, h1 :
Z
r1 :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
En :
near_offsetd && near_offsetf_lof + d && near_offsetf_hif + d = true
E :
f_lof + d, f_hif + d, f_rf = l1, h1, r1
⊢
near_offsetl1 = true ∧ near_offseth1 = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp l1 ptr_cappp h1 − l1 r1 al1 = Someok

injection E as ← ← ←

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
En :
near_offsetd && near_offsetf_lof + d && near_offsetf_hif + d = true
⊢
near_offsetf_lof + d = true ∧ near_offsetf_hif + d = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

apply andb_true_iff in En as En Eh

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
En :
near_offsetd && near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
⊢
near_offsetf_lof + d = true ∧ near_offsetf_hif + d = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

apply andb_true_iff in En as _ El

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
⊢
near_offsetf_lof + d = true ∧ near_offsetf_hif + d = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

split ; exact El |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
⊢
near_offsetf_hif + d = true ∧ ∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

split ; exact Eh |

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
⊢
∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

destruct Hlf Hf as pf & _ & Hpf & Hc

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
⊢
∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

destruct pointer_distance_sound_ _ _ _ _ Hpf Hp λy ⇒ Hdomf y Hf Hdp Ed as Hcap Haddr

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
∃al1 : Z, access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf al1 = Someok

exists f_alf

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf f_alf = Someok

unfold check_passes in Hc

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
access_resm raw_addressptr_addrpp f_lof + d ptr_cappp f_hif + d − f_lof + d f_rf f_alf = Someok

replace f_hif + d − f_lof + d with f_hif − f_lof by lia

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢

replace raw_addressptr_addrpp f_lof + d with raw_addressptr_addrpf f_lof

2 open

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
focused goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64

–rewrite <- Hcap

2 open

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
deferred goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64

exact Hc

deferred goal
ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64

–unfold raw_address

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
ptr_addrpf + f_lof mod 2 ^ 64 = ptr_addrpp + f_lof + d mod 2 ^ 64

rewrite <- Z.add_mod_idemp_l , Haddr , Z.add_mod_idemp_l by lia

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
ptr_addrpp + d + f_lof mod 2 ^ 64 = ptr_addrpp + f_lof + d mod 2 ^ 64

f_equal

ge :
md :
fr :
m :
Memory.mem
l :
k :
Z
Hin :
InIFuncfr_fnfr md
Hr :
Hs :
Hpt :
point_sitefr_fnfr fr_atfr = Somel, k
live :
listfact
pp :
Hl :
facts_holdge m fr_envfr live
Hdom :
∀fb : fact y : name, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
Hp :
value_xge fr_envfr P p = SomeWPtrpp
Hdp :
∀y : name, p = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
f :
Hf :
Inf live
d :
Z
El :
near_offsetf_lof + d = true
Eh :
near_offsetf_hif + d = true
pf :
Hpf :
value_xge fr_envfr P f_pf = SomeWPtrpf
Hcap :
Haddr :
ptr_addrpf mod 2 ^ 64 = ptr_addrpp + d mod 2 ^ 64
⊢
ptr_addrpp + d + f_lof = ptr_addrpp + f_lof + d

lia

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros live p pp l1 h1 r1 Hl Hdom Hp Hdp Hsp
apply in_flat_map in Hsp as f & Hf & Hsp
destruct pointer_distancesingle_definitionsfr_fnfr f_pf p as d | eqn: Ed ; | contradiction
cbv zeta in Hsp
destruct near_offsetd && near_offsetf_lof + d && near_offsetf_hif + d eqn: En ; | contradiction
destruct Hsp as E |
injection E as ← ← ←
apply andb_true_iff in En as En Eh
apply andb_true_iff in En as _ El
split ; exact El |
split ; exact Eh |
destruct Hlf Hf as pf & _ & Hpf & Hc
destruct pointer_distance_sound_ _ _ _ _ Hpf Hp λy ⇒ Hdomf y Hf Hdp Ed as Hcap Haddr
exists f_alf
unfold check_passes in Hc
replace f_hif + d − f_lof + d with f_hif − f_lof by lia
–rewrite <- Hcap
exact Hc
–unfold raw_address
rewrite <- Z.add_mod_idemp_l , Haddr , Z.add_mod_idemp_l by lia
f_equal
lia

A raw access i through the proof q that the pass accepts by hull_covered/7 does not step to unchecked, where memory lies in the address space, the live facts hold and their pointers' single definitions dominate the point. The span starting at or below the access and the span ending at or above it are checks of one capability that passed (hull_span_passes), so the access's own check passes (cap_access_hull).

488Theorem hull_access_not_unchecked
∀ i q fa live why
∀fb y, Infb live → f_pfb = Tmpy → once_hassingle_definitionsfr_fnfr y = true → dominatingfr_fnfr l k y
fact_ofq live = Somefa
Proof 45 steps Qed
intros i q fa live why Hfit Hl Hdom Hf H
destruct fact_of_in_ _ _ Hf as Hfa Hq
destruct Hlfa Hfa as pp & Eq & Hp & Hc
rewrite Hq in Eq
pose proof λy ⇒ Hdomfa y Hfa as Hdp
unfold hull_covered in H
destruct raw_accessi as q′ x off need | eqn: Ei ; | discriminate H
pose proof access_size_align_posx as Hsz Haa
pose proof access_align_dividesx as Hdv
destruct access_size_alignx as size aa eqn: Ex
simpl in Hsz , Haa , Hdv
cbv zeta in H
repeat rewrite andb_true_iff in H
destruct H as Hq′ & Hal & Hoa & _ & _ & H1 & H2 & Hneed
apply name_eqb_true in Hq'
subst q'
apply Z.eqb_eq in Hal
apply Z.eqb_eq in Hoa
apply existsb_exists in H1 as l1 h1 r1 & Hs1 & Hl1
apply Z.leb_le in Hl1
apply existsb_exists in H2 as l2 h2 r2 & Hs2 & Hh2
apply Z.leb_le in Hh2
destruct hull_span_passes_ _ _ _ _ _ Hl Hdom Hp Hdp Hs1 as _ & Hn1 & al1 & Hc1
destruct hull_span_passes_ _ _ _ _ _ Hl Hdom Hp Hdp Hs2 as Hn2 & _ & al2 & Hc2
unfold near_offset in Hn1 , Hn2
apply andb_true_iff in Hn1 as Hn1 _ , Hn2 as _ Hn2
apply Z.leb_le in Hn1 , Hn2
apply access_ok_not_uncheckedge fr m i q x off need pp why Ei Eq
rewrite Ex
simpl
unfold access_res in *
refine cap_access_hull_ _ _ l1 h1 − l1 r1 al1 l2 h2 − l2 r2 al2 _ _ _ _ Hfit Hc1 Hc2 _ Hn2 Hl1 _ Hsz _ _ ; lia | lia | |

The access is aligned: the fact's check was, at an alignment aa divides.

–unfold check_passes , access_res in Hc
apply cap_access_aligned in Hc
unfold raw_address in *
rewrite <- Znumtheory.Zmod_div_modaa 2 ^ 64 by auto ; lia
replace ptr_addrpp + off with ptr_addrpp + f_lofa + off − f_lofa by lia
apply aligned_add ; exact Haa | | exact Hoa
rewrite Znumtheory.Zmod_div_modaa 2 ^ 64 by auto ; lia
exact aligned_divisor_ _ _ Haa Hc Hal

The rights: a read, or a write some span's write check allows.

–destruct need ; left ; reflexivity | right
apply existsb_exists in Hneed as l3 h3 r3 & Hs3 & Hr3
destruct r3 ; discriminate Hr3 |
destruct hull_span_passes_ _ _ _ _ _ Hl Hdom Hp Hdp Hs3 as _ & _ & al3 & Hc3
eauto

No unchecked access through the hull, along every run

The frame lemmas carried along every run of the machine of a runtime R. It joins Persistence.v's invariant, which says the hull's facts hold and dominate the point, with Single.v's, which says the single definitions there replay. Each instantiates MachineR on its own, and an instance's mstep is an inductive of its own, so a run of one is carried over to the other (mreachable_same).

547Module Hull R : Runtime
549Module P ≔ Persistence R
550Module S ≔ Single R

A step of Persistence.v's machine instance is a step of Single.v's.

553Lemma mstep_same
∀ ge st st′
P.I.RM.mstepge st st′
S.ID.RM.mstepge st st′
Explore proof 2 tactics

Initial goal

⊢
∀ge : genv st st′ : P.I.RM.mstate, P.I.RM.mstepge st st′ → S.ID.RM.mstepge st st′

intros ge st st′ H

ge :
st, st′ :
H :
P.I.RM.mstepge st st′
⊢
S.ID.RM.mstepge st st′

destruct H ; econstructor ; eassumption

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge st st′ H
destruct H ; econstructor ; eassumption

A run of Persistence.v's machine instance is a run of Single.v's, so both invariants hold of every state it reaches.

558Lemma mreachable_same
∀ ge st st′
Explore proof 6 tactics

Initial goal

⊢
∀ge : genv st st′ : P.I.RM.mstate, P.I.RM.mreachablege st st′ → S.ID.RM.mreachablege st st′

intros ge st st′ H

ge :
st, st′ :
H :
⊢

induction H as st st′ H | st | st1 st2 st3 _ IH1 _ IH2

3 open

ge :
st, st′ :
H :
P.I.RM.mstepge st st′
⊢
focused goal
focused goal
ge :
st1, st2, st3 :
IH1 :
IH2 :
⊢

–apply rt_step

3 open

ge :
st, st′ :
H :
P.I.RM.mstepge st st′
⊢
S.ID.RM.mstepge st st′
deferred goal
deferred goal
ge :
st1, st2, st3 :
IH1 :
IH2 :
⊢

exact mstep_same_ _ _ H

2 open

deferred goal
deferred goal
ge :
st1, st2, st3 :
IH1 :
IH2 :
⊢

–apply rt_refl

deferred goal
ge :
st1, st2, st3 :
IH1 :
IH2 :
⊢

–exact rt_trans_ _ _ _ _ IH1 IH2

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge st st′ H
induction H as st st′ H | st | st1 st2 st3 _ IH1 _ IH2
–apply rt_step
exact mstep_same_ _ _ H
–apply rt_refl
–exact rt_trans_ _ _ _ _ IH1 IH2

In every state c a run reaches from a call of a function f of a checked_module md, started in a memory where the runtime is ready, a frame that is not doomed runs no raw access, and no raw call, to an unchecked outcome, hull_covered/7 included. Every runtime spares the pass's facts at safepoints (spares_any; see The evidence invariant over runs).

573Theorem run_access_checked
∀ ge md f xs fr m fuel s0 c s l i rest j why
ge_modulege = md
ge_freege = R.free
InIFuncf md
call_framef xs = Somefr
R.readys0 m
P.I.RM.mreachablege mkConfigfr [ ] m fuel, s0 c, s
fr_atc_framec = Execl i :: rest j
raw_accessi ≠ None ∨ ∃r cl args, i = RawCallr cl args
Explore proof 13 tactics

Initial goal

⊢
∀ge : genv md : module f : func xs : listword fr : frame m : Memory.mem fuel : Z s0 : R.state c : config s : R.state l : name i : inst rest : listinst j : jump why : reason, checked_modulemd → ge_modulege = md → ge_freege = R.free → InIFuncf md → call_framef xs = Somefr → R.readys0 m → P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s → fr_doomedc_framec = None → fr_atc_framec = Execl i :: rest j → raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args → inst_stepge c_framec c_memc i ≠ SomeIStopUncheckedwhy

intros ge md f xs fr m fuel s0 c s l i rest j why Hmd Hge Hfree Hin Hcf H0 Hreach Hd Ha Hi

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
⊢

destruct P.run_access_not_unchecked_ _ _ _ _ _ _ _ _ _ _ _ _ _ why Hmd Hge Hfree Hin Hcf H0 Hreach Hd Ha Hi as Hn | b & k & live & fa & q & Hb & Hk & Hl & Hdom & Hfa & Hh ; exact Hn |

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
⊢

pose proof S.run_sinv_ _ _ _ _ _ _ _ _ Hmd Hge Hfree Hin Hcf H0 mreachable_same_ _ _ Hreach as Hsh Hsc _

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hsh :
shapedmd c_framefstc, s
Hsc :
fr_doomedc_framefstc, s ≠ None ∨ scope_holdsge c_framefstc, s c_memfstc, s
⊢

simpl in Hsh , Hsc

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hsh :
Hsc :
⊢

destruct Hsc as Hsc | Hsc ; congruence |

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hsh :
⊢

destruct Hsh as Hinf Hsh

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hsh :
match fr_atc_framec with
Enterl from
⇒
is_reachablefn_domsfr_fnc_framec l = true ∧ from = None → entry_labelfr_fnc_framec = Somel
Execl is j
⇒
is_reachablefn_domsfr_fnc_framec l = true ∧ ∃b : block k : nat, find_blockl fn_blocksfr_fnc_framec = Someb ∧ k ≤ Datatypes.lengthb_instsb%nat ∧ is = skipnk b_instsb ∧ j = b_jumpb
⊢

rewrite Ha in Hsh

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hsh :
is_reachablefn_domsfr_fnc_framec l = true ∧ ∃b : block k : nat, find_blockl fn_blocksfr_fnc_framec = Someb ∧ k ≤ Datatypes.lengthb_instsb%nat ∧ i :: rest = skipnk b_instsb ∧ j = b_jumpb
⊢

destruct Hsh as Hr _

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
⊢

pose proof P.I.RM.mreachable_ready_ _ _ Hfree Hreach H0 as Hready

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hready :
⊢

pose proof R.address_space_ _ Hready as Hfit

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hready :
⊢

destruct skipn_cons_ _ _ _ _ eq_symHk as _ & _ & Hlen

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hready :
Hlen :
Sk ≤ Datatypes.lengthb_instsb%nat
⊢

assert Hpt : point_sitefr_fnc_framec fr_atc_framec = Somel, Z.of_natk by rewrite Ha , Hk ; apply point_site_exec ; exact Hb | lia

ge :
md :
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
s0 :
R.state
s :
R.state
l :
i :
rest :
listinst
j :
why :
Hge :
ge_modulege = md
Hfree :
ge_freege = R.free
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
H0 :
R.readys0 m
Hreach :
P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
k :
nat
live :
listfact
fa :
q :
Hk :
i :: rest = skipnk b_instsb
Hdom :
Hfa :
fact_ofq live = Somefa
Hh :
Hinf :
Hready :
Hlen :
Sk ≤ Datatypes.lengthb_instsb%nat
Hpt :
point_sitefr_fnc_framec fr_atc_framec = Somel, Z.of_natk
⊢

exact hull_access_not_uncheckedge md c_framec c_memc l Z.of_natk Hmd Hinf Hr scope_plain_of_ _ _ Hsc Hpt i q fa live why Hfit Hl HdomHr Hfa Hh

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros ge md f xs fr m fuel s0 c s l i rest j why Hmd Hge Hfree Hin Hcf H0 Hreach Hd Ha Hi
destruct P.run_access_not_unchecked_ _ _ _ _ _ _ _ _ _ _ _ _ _ why Hmd Hge Hfree Hin Hcf H0 Hreach Hd Ha Hi as Hn | b & k & live & fa & q & Hb & Hk & Hl & Hdom & Hfa & Hh ; exact Hn |
pose proof S.run_sinv_ _ _ _ _ _ _ _ _ Hmd Hge Hfree Hin Hcf H0 mreachable_same_ _ _ Hreach as Hsh Hsc _
simpl in Hsh , Hsc
destruct Hsc as Hsc | Hsc ; congruence |
destruct Hsh as Hinf Hsh
rewrite Ha in Hsh
destruct Hsh as Hr _
pose proof P.I.RM.mreachable_ready_ _ _ Hfree Hreach H0 as Hready
pose proof R.address_space_ _ Hready as Hfit
destruct skipn_cons_ _ _ _ _ eq_symHk as _ & _ & Hlen
assert Hpt : point_sitefr_fnc_framec fr_atc_framec = Somel, Z.of_natk by rewrite Ha , Hk ; apply point_site_exec ; exact Hb | lia
exact hull_access_not_uncheckedge md c_framec c_memc l Z.of_natk Hmd Hinf Hr scope_plain_of_ _ _ Hsc Hpt i q fa live why Hfit Hl HdomHr Hfa Hh

The interpreter's runtime

601Module InterpHull ≔ Hull InterpRuntime

run_access_checked for the interpreter's runtime: in every state of a run of a checked module's function that starts ready, a frame that is not doomed runs no raw access or raw call to unchecked. No hypothesis remains but the ready start.

607Corollary interp_access_checked
∀ md globals f xs fr m fuel s0 c s l i rest j why
let ge ≔ mkGenvmd globals InterpRuntime.free in
checked_modulemd → InIFuncf md → call_framef xs = Somefr → InterpRuntime.readys0 m → InterpHull.P.I.RM.mreachablege mkConfigfr [ ] m fuel, s0 c, s → fr_doomedc_framec = None → fr_atc_framec = Execl i :: rest j → raw_accessi ≠ None ∨ ∃r cl args, i = RawCallr cl args → inst_stepge c_framec c_memc i ≠ SomeIStopUncheckedwhy
Explore proof 2 tactics

Initial goal

⊢
∀ md : module globals : listname × ptr f : func xs : listword fr : frame m : Memory.mem fuel : Z s0 : InterpRuntime.state c : config s : InterpRuntime.state l : name i : inst rest : listinst j : jump why : reason  ,
let ge ≔ ge_module ≔ md; ge_globals ≔ globals; ge_free ≔ InterpRuntime.free in
checked_modulemd → InIFuncf md → call_framef xs = Somefr → InterpRuntime.readys0 m → InterpHull.P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s → fr_doomedc_framec = None → fr_atc_framec = Execl i :: rest j → raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args → inst_stepge c_framec c_memc i ≠ SomeIStopUncheckedwhy

intros md globals f xs fr m fuel s0 c s l i rest j why ge Hmd Hin Hcf H0 Hreach Hd Ha Hi

md :
globals :
listname × ptr
f :
xs :
listword
fr :
m :
Memory.mem
fuel :
Z
l :
i :
rest :
listinst
j :
why :
ge :=
ge_module ≔ md; ge_globals ≔ globals; ge_free ≔ InterpRuntime.free : genv
Hin :
InIFuncf md
Hcf :
call_framef xs = Somefr
Hreach :
InterpHull.P.I.RM.mreachablege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s0 c, s
Hd :
Ha :
fr_atc_framec = Execl i :: rest j
Hi :
raw_accessi ≠ None ∨ ∃r : call_result cl : value args : listarg, i = RawCallr cl args
⊢

exact InterpHull.run_access_checkedge md f xs fr m fuel s0 c s l i rest j why Hmd eq_refl eq_refl Hin Hcf H0 Hreach Hd Ha Hi

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros md globals f xs fr m fuel s0 c s l i rest j why ge Hmd Hin Hcf H0 Hreach Hd Ha Hi
exact InterpHull.run_access_checkedge md f xs fr m fuel s0 c s l i rest j why Hmd eq_refl eq_refl Hin Hcf H0 Hreach Hd Ha Hi