Fil-C on Nix

Filnix wiki

the formal campaign

rocq/theories/Language.v

Nanofil's machine, with the external calls of a contract registry, as an Iris language whose evaluation context is the stack of callers, and Iris adequacy as a proof of never_panics and of the labelled machine's safety.

The first logic spike's IrisLang.v made the whole configuration one expression, so a call was just another step and a function could have no specification of its own. Here the callers are Iris's evaluation context, so a call is wp_bind and a function's specification is an ordinary Hoare triple that hands resources back to its caller:

  • an expression is a running frame (ERun), the outcome an invocation returned (EEnd, the value), an expression running as the callee of a suspended caller frame (EWait), or the bad return of an external call (EBad); the one context item KWait is that caller;
  • the Iris state is the memory, the runtime's state, the fuel and the world of libc state the contracts speak of: the machine has one fuel counter for the whole stack, so it belongs to the state, not to a frame;
  • a head step of ERunfr is the step of fr with no caller. step_callers shows that the callers are passive: they change only what a return does, which becomes hs_return (the value) and then hs_resume (the caller reads it);
  • an ending that is neither a failure nor a return (running out of fuel, a refusal trap) and an allocation the runtime refuses are stalls: ERunfr steps to itself. The machine has stopped without failing, and to Iris that is a run that never ends, which is safe. A failing frame has no head step at all, not even a safepoint.

The language is over a world type and a contract registry, the labelled machine's (ExternalMachine.v). A call at an external_site is stuck to the core step; here it is:

  • admissible (a contract, arguments that evaluate, its ABI and its precondition): it may return (hs_call_return, the frame resumed with the call's memory, runtime state and world), and it may also stall (hs_call_wait). The stall stands for everything the call does that is not a return: it may block, it may exit the process or end for lack of resources (the labelled machine stops there without failing), and the labelled machine makes no step where an admissible call has no completed invocation. None of these is a failure, and to Iris each is a run that never ends, so a stall is safe; and it makes an admissible call always reducible, whether or not the contract allows any return;
  • returning words the call site cannot take (hs_call_bad): the expression becomes EBad, which is no value and has no step, so adequacy rules it out;
  • rejected: no head step, so adequacy rules it out too.

With the empty registry (no_contracts) no call is admissible and the language is the core machine's.

run_reducible, admissible_reducible and head_step_run_inv say a frame that does not fail, or whose external call is admissible, is always head-reducible, and how. wp_never_panics proves Panics.v's never_panics from a NotStuck weakest precondition of the entry's ERun in the language with no contracts, for every fuel; adequate_labelled and wp_labelled_safe prove that no labelled run stops with a failure_ending, and that a returned value satisfies the postcondition.

From iris.proofmode Require Import proofmode
From iris.program_logic Require Import language ectx_language ectxi_language weakestpre adequacy
From Stdlib Require Import ZArith Relations
From Nanofil Require Import Term Syntax Values Memory Runtime Ops Semantics Run Machine Panics Steps ExternalCalls ExternalMachine

Nanofil's machine over the runtime R, with external calls, as an Iris language with evaluation contexts.

69Module Language R : Runtime
70Module P ≔ Panics R
71Module RM ≔ P.RM
72Module M ≔ ExternalMachine R

The outcome o returns to a caller: a return of one word, of several, or of none.

76Definition returningo : outcome : Prop ≔
match o with
⇒
True
_
⇒
False

Whether an outcome returns is decided by its constructor.

80Lemma returning_dec
∀ o
Explore proof 1 tactics

Initial goal

destruct o ; cbn ; tauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
destruct o ; cbn ; tauto

The configuration c' run as the callee of the callers cs: c''s own callers, then cs below them.

85Definition lift_confcs : listframe × pending c′ : config : config ≔
mkConfigc_framec′ c_callersc′ ++ cs c_memc′ c_fuelc′

An instruction never stops with a returning outcome: only a jump returns, through return_step.

90Lemma inst_step_stop
∀ ge fr m i o
inst_stepge fr m i = SomeIStopo
Explore proof 4 tactics

Initial goal

ge :
fr :
m :
i :
⊢
inst_stepge fr m i = SomeIStopo → ¬returningo

intros H

ge :
fr :
m :
i :
H :
inst_stepge fr m i = SomeIStopo
⊢

destruct i

9 open

ge :
fr :
m :
d :
o0 :
args :
listvalue
H :
inst_stepge fr m Letd k o0 args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
d :
o0 :
args :
H :
inst_stepge fr m Flightd o0 args lower = SomeIStopo
⊢
focused goal
ge :
fr :
m :
off :
Z
v, a :
H :
inst_stepge fr m RawStorew off v a = SomeIStopo
⊢
focused goal
ge :
fr :
m :
off :
Z
v, a :
es :
listeffect
H :
inst_stepge fr m RawStorePointeroff v a es = SomeIStopo
⊢
focused goal
ge :
fr :
m :
callee :
args :
listarg
H :
inst_stepge fr m Callr callee args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
callee :
args :
listarg
H :
inst_stepge fr m RawCallr callee args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
x :
size :
Z
H :
inst_stepge fr m LocalAllocx size = SomeIStopo
⊢
focused goal
ge :
fr :
m :
file :
line :
Z
H :
inst_stepge fr m Locfile line = SomeIStopo
⊢
focused goal
ge :
fr :
m :
q :
H :
inst_stepge fr m Touchq = SomeIStopo
⊢

1: destruct special_leto0 eqn: Es ; destruct o0 ; try discriminate Es | rewrite inst_step_let_ _ _ _ _ _ _ Es in H

12 open

ge :
fr :
m :
d :
x :
off, bytes :
Z
align :
Z
args :
listvalue
H :
inst_stepge fr m Letd k CheckLocalx off bytes r align args = SomeIStopo
Es :
special_letCheckLocalx off bytes r align = true
⊢
focused goal
ge :
fr :
m :
d :
args :
listvalue
H :
inst_stepge fr m Letd k CheckFunction args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
d :
args :
listvalue
H :
inst_stepge fr m Letd k VaArgs args = SomeIStopo
Es :
⊢
focused goal
ge :
fr :
m :
d :
o0 :
args :
listvalue
Es :
special_leto0 = false
H :
let e ≔ fr_envfr in
let locals ≔ fr_localsfr in
let* classes ≔ op_arg_classeso0 k in
let* xs ≔ map2_optionvalue_xge e classes args in
match op_reso0 k xs m with
SomeOpResr m′
⇒
Somebind_resd r e locals m′
SomeOpUBwhy
⇒
SomeIStopUBwhy
SomeOpAllocq kont
⇒
Some
λ base : Z  ⇒
let x, m′ ≔ kontbase in
putd x e, locals, m′
None
⇒
None
=
SomeIStopo
⊢
focused goal
ge :
fr :
m :
d :
o0 :
args :
H :
inst_stepge fr m Flightd o0 args lower = SomeIStopo
⊢
focused goal
ge :
fr :
m :
off :
Z
v, a :
H :
inst_stepge fr m RawStorew off v a = SomeIStopo
⊢
focused goal
ge :
fr :
m :
off :
Z
v, a :
es :
listeffect
H :
inst_stepge fr m RawStorePointeroff v a es = SomeIStopo
⊢
focused goal
ge :
fr :
m :
callee :
args :
listarg
H :
inst_stepge fr m Callr callee args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
callee :
args :
listarg
H :
inst_stepge fr m RawCallr callee args = SomeIStopo
⊢
focused goal
ge :
fr :
m :
x :
size :
Z
H :
inst_stepge fr m LocalAllocx size = SomeIStopo
⊢
focused goal
ge :
fr :
m :
file :
line :
Z
H :
inst_stepge fr m Locfile line = SomeIStopo
⊢
focused goal
ge :
fr :
m :
q :
H :
inst_stepge fr m Touchq = SomeIStopo
⊢

all: unfold inst_step , external_call , bind_res , store_out in H ; cases H ; inversion H ; subst ; cbn ; tauto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
destruct i
1: destruct special_leto0 eqn: Es ; destruct o0 ; try discriminate Es | rewrite inst_step_let_ _ _ _ _ _ _ Es in H
all: unfold inst_step , external_call , bind_res , store_out in H ; cases H ; inversion H ; subst ; cbn ; tauto

doomed_result/5 makes no returning stop of its own: a returning stop after it is the instruction's.

102Lemma doomed_result_stop
∀ ge fr m i out od o
doomed_resultge fr m i out = Someod
fstod = IStopo
out = IStopo
Explore proof 10 tactics

Initial goal

ge :
fr :
m :
i :
od :
inst_out × optionreason
⊢
doomed_resultge fr m i out = Someod → od.1 = IStopo → returningo → out = IStopo

intros H Hf Hr

ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
⊢
out = IStopo

destruct ahead_insti eqn: Ea

2 open

ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = true
⊢
out = IStopo
focused goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

–destruct i as d k op args | | | | | | | | ; try discriminate Ea

2 open

ge :
fr :
m :
d :
op :
op
args :
listvalue
od :
inst_out × optionreason
H :
doomed_resultge fr m Letd k op args out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_instLetd k op args = true
⊢
out = IStopo
deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

destruct k ; try discriminate Ea

2 open

ge :
fr :
m :
d :
op :
op
args :
listvalue
od :
inst_out × optionreason
H :
doomed_resultge fr m Letd A op args out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_instLetd A op args = true
⊢
out = IStopo
deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

destruct op ; try discriminate Ea

2 open

ge :
fr :
m :
d :
lo, hi :
Z
align, ahi :
Z
args :
listvalue
od :
inst_out × optionreason
H :
doomed_resultge fr m Letd A CheckAheadlo hi r align ahi args out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_instLetd A CheckAheadlo hi r align ahi args = true
⊢
out = IStopo
deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

destruct args as | v | v′ args ; try discriminate Ea

2 open

ge :
fr :
m :
d :
lo, hi :
Z
align, ahi :
Z
od :
inst_out × optionreason
H :
doomed_resultge fr m Letd A CheckAheadlo hi r align ahi v out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_instLetd A CheckAheadlo hi r align ahi v = true
⊢
out = IStopo
deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

unfold doomed_result in H

2 open

ge :
fr :
m :
d :
lo, hi :
Z
align, ahi :
Z
od :
inst_out × optionreason
H :
match out with
⇒
let* p ≔ value_xge fr_envfr P v in
Some
match fr_doomedfr with
Somew
⇒
Somew
None
⇒
Somewhy
⇒
match fr_doomedfr with
Somewhy
⇒
match w with
⇒
Someout, fr_doomedfr
None
⇒
Someout, None
_
⇒
Someout, fr_doomedfr
=
Someod
Hf :
od.1 = IStopo
Ea :
ahead_instLetd A CheckAheadlo hi r align ahi v = true
⊢
out = IStopo
deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

cases H ; inversion H ; subst ; cbn in Hf ; try discriminate Hf ; try injection Hf as ← ; cbn in Hr ; tauto ; auto

deferred goal
ge :
fr :
m :
i :
od :
inst_out × optionreason
H :
doomed_resultge fr m i out = Someod
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
⊢
out = IStopo

–rewrite doomed_result_other_ _ _ _ _ Ea in H

ge :
fr :
m :
i :
od :
inst_out × optionreason
Hf :
od.1 = IStopo
Ea :
ahead_insti = false
H :
match out with
⇒
match fr_doomedfr with
Somewhy
⇒
match w with
⇒
Someout, fr_doomedfr
None
⇒
Someout, None
_
⇒
Someout, fr_doomedfr
=
Someod
⊢
out = IStopo

cases H ; inversion H ; subst ; cbn in Hf ; try discriminate Hf ; try injection Hf as ← ; cbn in Hr ; tauto ; auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H Hf Hr
destruct ahead_insti eqn: Ea
–destruct i as d k op args | | | | | | | | ; try discriminate Ea
destruct k ; try discriminate Ea
destruct op ; try discriminate Ea
destruct args as | v | v′ args ; try discriminate Ea
unfold doomed_result in H
cases H ; inversion H ; subst ; cbn in Hf ; try discriminate Hf ; try injection Hf as ← ; cbn in Hr ; tauto ; auto
–rewrite doomed_result_other_ _ _ _ _ Ea in H
cases H ; inversion H ; subst ; cbn in Hf ; try discriminate Hf ; try injection Hf as ← ; cbn in Hr ; tauto ; auto

A step that stops at an instruction, after doomed_result, stops with an outcome that does not return.

117Lemma stop_not_returning
∀ ge fr m i out od o
inst_stepge fr m i = Someout
doomed_resultge fr m i out = Someod
fstod = IStopo
Explore proof 3 tactics

Initial goal

ge :
fr :
m :
i :
od :
inst_out × optionreason
⊢
inst_stepge fr m i = Someout → doomed_resultge fr m i out = Someod → od.1 = IStopo → ¬returningo

intros H1 H2 H3 Hr

ge :
fr :
m :
i :
od :
inst_out × optionreason
H1 :
inst_stepge fr m i = Someout
H2 :
doomed_resultge fr m i out = Someod
H3 :
od.1 = IStopo
⊢
False

pose proof doomed_result_stop_ _ _ _ _ _ _ H2 H3 Hr as →

ge :
fr :
m :
i :
od :
inst_out × optionreason
H2 :
doomed_resultge fr m i IStopo = Someod
H1 :
inst_stepge fr m i = SomeIStopo
H3 :
od.1 = IStopo
⊢
False

exact inst_step_stop_ _ _ _ _ H1 Hr

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H1 H2 H3 Hr
pose proof doomed_result_stop_ _ _ _ _ _ _ H2 H3 Hr as →
exact inst_step_stop_ _ _ _ _ H1 Hr

A return with no caller ends the run with o once the locals end, and is stuck where they cannot.

127Lemma return_nil
∀ fr m fuel o
return_stepmkConfigfr [ ] m fuel o
=
Some_
⇒
None
⇒
Stuck"return"
Explore proof 3 tactics

Initial goal

fr :
m :
fuel :
Z
⊢
return_stepc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel o
=
Some_
⇒
None
⇒
Stuck"return"

unfold return_step

fr :
m :
fuel :
Z
⊢
or_stuck"return"
let* m0 ≔ invalidate_localsfr_localsc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel in
match c_callersc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel with
[ ]
⇒
SomeDoneo
caller, pd :: callers
⇒
let* o′ ≔
match pd_convpd with
Somecw, kw
⇒
None
⇒
Someo
in
let* e ≔ returned_envpd_respd o′ fr_envcaller in
SomeNextc_frame ≔ fr_fn ≔ fr_fncaller; fr_env ≔ e; fr_locals ≔ fr_localscaller; fr_doomed ≔ fr_doomedcaller; fr_at ≔ fr_atcaller; c_callers ≔ callers; c_mem ≔ m0; c_fuel ≔ c_fuelc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel
=
Some_
⇒
None
⇒
Stuck"return"

cbn

fr :
m :
fuel :
Z
⊢
or_stuck"return"
let* _ ≔ invalidate_localsfr_localsfr m in
SomeDoneo
=
Some_
⇒
None
⇒
Stuck"return"

destruct invalidate_locals_ _ ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
cbn
destruct invalidate_locals_ _ ; reflexivity

How the step r of a frame with the callers cs (the configuration c) follows from the step r0 of the same frame with none: the same next configuration or allocation with cs below its callers, the same ending where it does not return, the same return_step (now to a caller) where it returns and the locals can end, and stuck where r0 is stuck.

138Definition liftedcs : listframe × pending c : config r0 r : step_result : Prop ≔
match r0 with
Nextc′
⇒
r = Nextlift_confcs c′
⇒
∃k′, r = Freshq k′ ∧ ∀base, k′base = lift_confcs kbase
⇒
¬returningo ∧ r = Doneo ∨ returningo ∧ r = return_stepc o ∧ ∃m′, invalidate_localsfr_localsc_framec c_memc = Somem′
⇒
∃w, r = Stuckw

A tactic: succeed only if the term x contains no match.

150Ltac no_match x ≔
lazymatch x withcontext [match _ with _ ⇒ _ end]⇒fail_⇒idtacend

The callers are passive: a step of the frame fr with the callers cs is the step of fr alone, related as lifted says. Only return_step reads the callers; every other part of step reads the frame, memory and fuel and passes the callers along.

156Lemma step_callers
∀ ge fr cs m fuel
liftedcs mkConfigfr cs m fuel Semantics.stepge mkConfigfr [ ] m fuel Semantics.stepge mkConfigfr cs m fuel
Proof 5 steps Qed
unfold Semantics.step , jump_step , edge_step , inst_next , or_stuck , continue_at , with_point
repeat match goal with|- context [return_stepmkConfig?f [ ] ?mm ?fu ?o]⇒rewrite return_nilf mm fu o|- lifted_ _ ?r0 _⇒match r0 withcontext [match ?x with _ ⇒ _ end]⇒no_match x ; destruct x eqn :? ; cbn [ fst snd c_frame c_callers c_mem c_fuel ]endend
all: unfold lifted ; cbn [ lift_conf c_frame c_callers c_mem c_fuel app ]
all: first|reflexivity|eexists ; reflexivity|eexists ; split ; reflexivity | intros ? ; reflexivity|left ; split ; cbn ; tauto | reflexivity|right ; split ; exact I | split ; reflexivity | eexists ; eassumption|eexists ; unfold return_step ; cbn;match goal withE : invalidate_locals_ _ = None |- _⇒rewrite Eend;reflexivity|eexists ; split;|reflexivity|intros base ; cbv beta;match goal withkk : Z → env × _ × mem%type |- _⇒destruct kkbase as ? ? ?end;reflexivity|left ; split ; eapply stop_not_returning ; eassumption | reflexivity

A next configuration of fr alone, with cs below its callers, is the next configuration of fr with the callers cs.

187Lemma step_callers_next
∀ ge fr cs m fuel c′
Semantics.stepge mkConfigfr [ ] m fuel = Nextc′
Semantics.stepge mkConfigfr cs m fuel = NextmkConfigc_framec′ c_callersc′ ++ cs c_memc′ c_fuelc′
Explore proof 4 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
c′ :
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′ → stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Nextc_frame ≔ c_framec′; c_callers ≔ c_callersc′ ++ cs; c_mem ≔ c_memc′; c_fuel ≔ c_fuelc′

intros E

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Nextc_frame ≔ c_framec′; c_callers ≔ c_callersc′ ++ cs; c_mem ≔ c_memc′; c_fuel ≔ c_fuelc′

pose proof step_callersge fr cs m fuel as H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Nextc_frame ≔ c_framec′; c_callers ≔ c_callersc′ ++ cs; c_mem ≔ c_memc′; c_fuel ≔ c_fuelc′

rewrite E in H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel Nextc′ stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Nextc_frame ≔ c_framec′; c_callers ≔ c_callersc′ ++ cs; c_mem ≔ c_memc′; c_fuel ≔ c_fuelc′

exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E
pose proof step_callersge fr cs m fuel as H
rewrite E in H
exact H

An allocation of fr alone is the same request with the callers cs, each base's configuration with cs below its callers.

195Lemma step_callers_fresh
∀ ge fr cs m fuel q k
Semantics.stepge mkConfigfr [ ] m fuel = Freshq k
∃k′, Semantics.stepge mkConfigfr cs m fuel = Freshq k′ ∧ ∀base, k′base = mkConfigc_framekbase c_callerskbase ++ cs c_memkbase c_fuelkbase
Explore proof 4 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
k :
Z → config
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k → ∃k′ : Z → config, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Freshq k′ ∧ ∀base : Z, k′base = c_frame ≔ c_framekbase; c_callers ≔ c_callerskbase ++ cs; c_mem ≔ c_memkbase; c_fuel ≔ c_fuelkbase

intros E

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
⊢
∃k′ : Z → config, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Freshq k′ ∧ ∀base : Z, k′base = c_frame ≔ c_framekbase; c_callers ≔ c_callerskbase ++ cs; c_mem ≔ c_memkbase; c_fuel ≔ c_fuelkbase

pose proof step_callersge fr cs m fuel as H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
∃k′ : Z → config, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Freshq k′ ∧ ∀base : Z, k′base = c_frame ≔ c_framekbase; c_callers ≔ c_callerskbase ++ cs; c_mem ≔ c_memkbase; c_fuel ≔ c_fuelkbase

rewrite E in H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel Freshq k stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
∃k′ : Z → config, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Freshq k′ ∧ ∀base : Z, k′base = c_frame ≔ c_framekbase; c_callers ≔ c_callerskbase ++ cs; c_mem ≔ c_memkbase; c_fuel ≔ c_fuelkbase

exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E
pose proof step_callersge fr cs m fuel as H
rewrite E in H
exact H

An ending of fr alone that does not return is the same ending with any callers.

204Lemma step_callers_stop
∀ ge fr cs m fuel o
Semantics.stepge mkConfigfr [ ] m fuel = Doneo
Semantics.stepge mkConfigfr cs m fuel = Doneo
Explore proof 4 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo → ¬returningo → stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Doneo

intros E Hr

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hr :
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Doneo

pose proof step_callersge fr cs m fuel as H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hr :
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Doneo

rewrite E in H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hr :
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel Doneo stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Doneo

destruct H as _ H | H _ ; exact H | contradiction

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E Hr
pose proof step_callersge fr cs m fuel as H
rewrite E in H
destruct H as _ H | H _ ; exact H | contradiction

A returning ending of fr alone is, with the callers cs, the return to them, and the locals of fr can end.

214Lemma step_callers_return
∀ ge fr cs m fuel o
Semantics.stepge mkConfigfr [ ] m fuel = Doneo
Semantics.stepge mkConfigfr cs m fuel = return_stepmkConfigfr cs m fuel o ∧ ∃m′, invalidate_localsfr_localsfr m = Somem′
Explore proof 4 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo → returningo → stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = return_stepc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel o ∧ ∃m′ : mem, invalidate_localsfr_localsfr m = Somem′

intros E Hr

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = return_stepc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel o ∧ ∃m′ : mem, invalidate_localsfr_localsfr m = Somem′

pose proof step_callersge fr cs m fuel as H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = return_stepc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel o ∧ ∃m′ : mem, invalidate_localsfr_localsfr m = Somem′

rewrite E in H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel Doneo stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = return_stepc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel o ∧ ∃m′ : mem, invalidate_localsfr_localsfr m = Somem′

destruct H as H _ | _ H ; contradiction | exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E Hr
pose proof step_callersge fr cs m fuel as H
rewrite E in H
destruct H as H _ | _ H ; contradiction | exact H

A stuck step of fr alone is stuck with any callers.

224Lemma step_callers_stuck
∀ ge fr cs m fuel w
Semantics.stepge mkConfigfr [ ] m fuel = Stuckw
∃w′, Semantics.stepge mkConfigfr cs m fuel = Stuckw′
Explore proof 4 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw → ∃w′ : string, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′

intros E

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw
⊢
∃w′ : string, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′

pose proof step_callersge fr cs m fuel as H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
∃w′ : string, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′

rewrite E in H

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw
H :
liftedcs c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel Stuckw stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel
⊢
∃w′ : string, stepge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′

exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E
pose proof step_callersge fr cs m fuel as H
rewrite E in H
exact H

Whether a safepoint is due reads only the running frame.

230Lemma safepoint_due_callers
∀ ge fr cs m fuel
RM.safepoint_duege mkConfigfr cs m fuel = RM.safepoint_duege mkConfigfr [ ] m fuel
Explore proof 1 tactics

Initial goal

ge :
fr :
cs :
listframe × pending
m :
fuel :
Z
⊢
RM.safepoint_duege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = RM.safepoint_duege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity

The suspended caller frame cf, which reads its callee's result as pd says, resumed with the callee's returning outcome o: the tail of return_step (call_outcome_result/5), converting o by pd's convention and binding it in cf's environment. None where the result cannot be read so.

239Definition resumecf : frame pd : pending o : outcome : optionframe ≔
let* o′ ≔
match pd_convpd with
None
⇒
Someo
Somecw, kw
⇒
in
let* e ≔ returned_envpd_respd o′ fr_envcf in

A return to the caller cf, where the locals of fr end in m', is the caller resumed, with the callers below it, or stuck where it cannot resume.

250Lemma return_cons
∀ fr cf pd cs m m′ fuel o
return_stepmkConfigfr cf, pd :: cs m fuel o
=
match resumecf pd o with
Somecf′
⇒
NextmkConfigcf′ cs m′ fuel
None
⇒
Stuck"return"
Explore proof 6 tactics

Initial goal

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
⊢
→
return_stepc_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel o
=
match resumecf pd o with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

intros E

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
E :
⊢
return_stepc_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel o
=
match resumecf pd o with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

unfold return_step , resume

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
E :
⊢
or_stuck"return"
let* m0 ≔ invalidate_localsfr_localsc_framec_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel c_memc_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel in
match c_callersc_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel with
[ ]
⇒
SomeDoneo
caller, pd0 :: callers
⇒
let* o′ ≔
match pd_convpd0 with
Somecw, kw
⇒
None
⇒
Someo
in
let* e ≔ returned_envpd_respd0 o′ fr_envcaller in
SomeNextc_frame ≔ fr_fn ≔ fr_fncaller; fr_env ≔ e; fr_locals ≔ fr_localscaller; fr_doomed ≔ fr_doomedcaller; fr_at ≔ fr_atcaller; c_callers ≔ callers; c_mem ≔ m0; c_fuel ≔ c_fuelc_frame ≔ fr; c_callers ≔ cf, pd :: cs; c_mem ≔ m; c_fuel ≔ fuel
=
match let* o′ ≔ match pd_convpd with Somecw, kw ⇒ converted_outcomecw kw o | None ⇒ Someo end in let* e ≔ returned_envpd_respd o′ fr_envcf in Somefr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

cbn

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
E :
⊢
or_stuck"return"
let* m0 ≔ invalidate_localsfr_localsfr m in
let* o′ ≔
match pd_convpd with
Somecw, kw
⇒
None
⇒
Someo
in
let* e ≔ returned_envpd_respd o′ fr_envcf in
SomeNextc_frame ≔ fr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf; c_callers ≔ cs; c_mem ≔ m0; c_fuel ≔ fuel
=
match let* o′ ≔ match pd_convpd with Somecw, kw ⇒ converted_outcomecw kw o | None ⇒ Someo end in let* e ≔ returned_envpd_respd o′ fr_envcf in Somefr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

rewrite E

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
E :
⊢
or_stuck"return"
let* o′ ≔
match pd_convpd with
Somecw, kw
⇒
None
⇒
Someo
in
let* e ≔ returned_envpd_respd o′ fr_envcf in
SomeNextc_frame ≔ fr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
=
match let* o′ ≔ match pd_convpd with Somecw, kw ⇒ converted_outcomecw kw o | None ⇒ Someo end in let* e ≔ returned_envpd_respd o′ fr_envcf in Somefr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

destruct match pd_convpd with None ⇒ Someo | Somecw, kw ⇒ converted_outcomecw kw o end ; | reflexivity

fr, cf :
cs :
listframe × pending
m, m′ :
fuel :
Z
E :
⊢
or_stuck"return"
let* e ≔ returned_envpd_respd o0 fr_envcf in
SomeNextc_frame ≔ fr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
=
match let* e ≔ returned_envpd_respd o0 fr_envcf in Somefr_fn ≔ fr_fncf; fr_env ≔ e; fr_locals ≔ fr_localscf; fr_doomed ≔ fr_doomedcf; fr_at ≔ fr_atcf with
Somecf′
⇒
Nextc_frame ≔ cf′; c_callers ≔ cs; c_mem ≔ m′; c_fuel ≔ fuel
None
⇒
Stuck"return"

destruct returned_env_ _ _ ; reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E
cbn
rewrite E
destruct match pd_convpd with None ⇒ Someo | Somecw, kw ⇒ converted_outcomecw kw o end ; | reflexivity
destruct returned_env_ _ _ ; reflexivity

A return with no caller, where the locals end, ends the run.

265Lemma return_nil_done
∀ fr m m′ fuel o
return_stepmkConfigfr [ ] m fuel o = Doneo
Explore proof 3 tactics

Initial goal

fr :
m, m′ :
fuel :
Z
⊢
invalidate_localsfr_localsfr m = Somem′ → return_stepc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel o = Doneo

intros E

fr :
m, m′ :
fuel :
Z
E :
⊢
return_stepc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel o = Doneo

rewrite return_nil E

fr :
m, m′ :
fuel :
Z
E :
⊢
Doneo = Doneo

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros E
rewrite return_nil E
reflexivity

External calls

Whether a configuration is at an external_site reads only its running frame: the frame alone is at the same site, in any memory and fuel.

275Lemma external_site_frame
∀ ge c m fuel site
external_sitege c site
external_sitege mkConfigc_framec [ ] m fuel site
Explore proof 2 tactics

Initial goal

ge :
m :
fuel :
Z
site :
⊢
external_sitege c site → external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel site

intros H

ge :
m :
fuel :
Z
site :
H :
external_sitege c site
⊢
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel site

exact H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
exact H

A frame is at most at one external_site: its next instruction fixes every part of the site.

281Lemma external_site_unique
∀ ge c c′ site site′
external_sitege c site
external_sitege c′ site′
site = site′
Explore proof 10 tactics

Initial goal

ge :
c, c′ :
site, site′ :
⊢
c_framec = c_framec′ → external_sitege c site → external_sitege c′ site′ → site = site′

unfold external_site

ge :
c, c′ :
site, site′ :
⊢
c_framec = c_framec′ → fr_doomedc_framec = None ∧ fr_atc_framec = Execsite_labelsite Callsite_resultsite Globalsite_namesite site_argssite :: site_restsite site_jumpsite ∧ find_fnge site_namesite = None ∧ lookupsite_namesite ge_globalsge = None ∧ name_eqbsite_namesite free_name = false → fr_doomedc_framec′ = None ∧ fr_atc_framec′ = Execsite_labelsite′ Callsite_resultsite′ Globalsite_namesite′ site_argssite′ :: site_restsite′ site_jumpsite′ ∧ find_fnge site_namesite′ = None ∧ lookupsite_namesite′ ge_globalsge = None ∧ name_eqbsite_namesite′ free_name = false → site = site′

cbv zeta

ge :
c, c′ :
site, site′ :
⊢
c_framec = c_framec′ → fr_doomedc_framec = None ∧ fr_atc_framec = Execsite_labelsite Callsite_resultsite Globalsite_namesite site_argssite :: site_restsite site_jumpsite ∧ find_fnge site_namesite = None ∧ lookupsite_namesite ge_globalsge = None ∧ name_eqbsite_namesite free_name = false → fr_doomedc_framec′ = None ∧ fr_atc_framec′ = Execsite_labelsite′ Callsite_resultsite′ Globalsite_namesite′ site_argssite′ :: site_restsite′ site_jumpsite′ ∧ find_fnge site_namesite′ = None ∧ lookupsite_namesite′ ge_globalsge = None ∧ name_eqbsite_namesite′ free_name = false → site = site′

intros Hf _ & Ha & _ _ & Ha′ & _

ge :
c, c′ :
site, site′ :
Hf :
Ha′ :
fr_atc_framec′ = Execsite_labelsite′ Callsite_resultsite′ Globalsite_namesite′ site_argssite′ :: site_restsite′ site_jumpsite′
⊢
site = site′

destruct site , site′

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
site_label0 :
site_result0 :
site_name0 :
site_args0 :
listarg
site_rest0 :
listinst
site_jump0 :
Hf :
Ha :
fr_atc_framec = ExecExternalMachine.site_labelsite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump CallExternalMachine.site_resultsite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump GlobalExternalMachine.site_namesite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump ExternalMachine.site_argssite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump :: ExternalMachine.site_restsite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump ExternalMachine.site_jumpsite_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump
Ha′ :
fr_atc_framec′ = ExecExternalMachine.site_labelsite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0 CallExternalMachine.site_resultsite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0 GlobalExternalMachine.site_namesite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0 ExternalMachine.site_argssite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0 :: ExternalMachine.site_restsite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0 ExternalMachine.site_jumpsite_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0
⊢
site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0

cbn in *

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
site_label0 :
site_result0 :
site_name0 :
site_args0 :
listarg
site_rest0 :
listinst
site_jump0 :
Hf :
Ha :
fr_atc_framec = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
Ha′ :
fr_atc_framec′ = Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0
⊢
site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0

rewrite Hf Ha′ in Ha

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
site_label0 :
site_result0 :
site_name0 :
site_args0 :
listarg
site_rest0 :
listinst
site_jump0 :
Hf :
Ha′ :
fr_atc_framec′ = Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0
Ha :
Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0 = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
⊢
site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0

injection Ha

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
site_label0 :
site_result0 :
site_name0 :
site_args0 :
listarg
site_rest0 :
listinst
site_jump0 :
Hf :
Ha′ :
fr_atc_framec′ = Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0
Ha :
Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0 = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
⊢
site_jump0 = site_jump → site_rest0 = site_rest → site_args0 = site_args → site_name0 = site_name → site_result0 = site_result → site_label0 = site_label → site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0

intros

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
site_label0 :
site_result0 :
site_name0 :
site_args0 :
listarg
site_rest0 :
listinst
site_jump0 :
Hf :
Ha′ :
fr_atc_framec′ = Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0
Ha :
Execsite_label0 Callsite_result0 Globalsite_name0 site_args0 :: site_rest0 site_jump0 = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
H :
site_jump0 = site_jump
H0 :
site_rest0 = site_rest
H1 :
site_args0 = site_args
H2 :
site_name0 = site_name
H3 :
site_result0 = site_result
H4 :
site_label0 = site_label
⊢
site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label0; site_result ≔ site_result0; site_name ≔ site_name0; site_args ≔ site_args0; site_rest ≔ site_rest0; site_jump ≔ site_jump0

subst

ge :
c, c′ :
site_label :
site_result :
site_name :
site_args :
listarg
site_rest :
listinst
site_jump :
Hf :
Ha′ :
fr_atc_framec′ = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
Ha :
Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump = Execsite_label Callsite_result Globalsite_name site_args :: site_rest site_jump
⊢
site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump = site_label ≔ site_label; site_result ≔ site_result; site_name ≔ site_name; site_args ≔ site_args; site_rest ≔ site_rest; site_jump ≔ site_jump

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
cbv zeta
intros Hf _ & Ha & _ _ & Ha′ & _
destruct site , site′
cbn in *
rewrite Hf Ha′ in Ha
injection Ha
intros
subst
reflexivity

A completed call was admissible: its ABI and its precondition hold, whatever its ending.

291Lemma invoke_admissible
∀ world : Type spec : contractworld r args xs s m w trace ending s′ m′ w′
M.E.invokespec r args xs s m w trace ending s′ m′ w′
contract_abispec r args ∧ contract_prespec xs m w
Explore proof 2 tactics

Initial goal

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
ending :
s′ :
R.state
m′ :
w′ :
world
⊢
M.E.invokespec r args xs s m w trace ending s′ m′ w′ → contract_abispec r args ∧ contract_prespec xs m w

intros H

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
ending :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace ending s′ m′ w′
⊢
contract_abispec r args ∧ contract_prespec xs m w

destruct H ; auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
destruct H ; auto

A call's resource ending is no failure: resource_failure is out of memory or too big, both refusals.

298Lemma invoke_resource_refusal
∀ world : Type spec : contractworld r args xs s m w trace why s′ m′ w′
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
Explore proof 5 tactics

Initial goal

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
⊢
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′ → ¬failureTrapwhy

intros H

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
⊢

inversion H ; subst

2 open

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
born :
listZ
H0 :
contract_abispec r args
H1 :
contract_prespec xs m w
H2 :
M.E.prefixspec xs s m w born trace s′ m′ w′
H3 :
contract_postspec xs m w born trace CallResourcewhy m′ w′
H4 :
∀why0 : reason, CallResourcewhy ≠ CallResourcewhy0
H5 :
∀values : listword, CallResourcewhy = CallReturnvalues → return_shapecontract_returnsspec values ∧ Forallword_authoritycontract_sourcesspec xs m w born m′ values
H6 :
∀status : Z, CallResourcewhy = CallExitstatus → ∃before : listevent, trace = before ++ ProcessExitstatus
⊢
focused goal
world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
born :
listZ
H1 :
contract_abispec r args
H2 :
contract_prespec xs m w
H3 :
M.E.prefixspec xs s m w born trace s′ m′ w′
H6 :
⊢

–match goal withHn : ∀why′, CallResource?x ≠ CallResourcewhy′ |- _⇒exfalso ; exact Hn_ eq_reflend

deferred goal
world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
born :
listZ
H1 :
contract_abispec r args
H2 :
contract_prespec xs m w
H3 :
M.E.prefixspec xs s m w born trace s′ m′ w′
H6 :
⊢

–apply resource_not_failure

world :
Type
spec :
args :
listarg
xs :
listword
s :
R.state
m :
w :
world
trace :
listevent
why :
s′ :
R.state
m′ :
w′ :
world
H :
M.E.invokespec r args xs s m w trace CallResourcewhy s′ m′ w′
born :
listZ
H1 :
contract_abispec r args
H2 :
contract_prespec xs m w
H3 :
M.E.prefixspec xs s m w born trace s′ m′ w′
H6 :

match goal withHf : M.E.resource_failure_ _ _ |- _⇒destruct Hfend;unfold resource_reason;auto

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
inversion H ; subst
–match goal withHn : ∀why′, CallResource?x ≠ CallResourcewhy′ |- _⇒exfalso ; exact Hn_ eq_reflend
match goal withHf : M.E.resource_failure_ _ _ |- _⇒destruct Hfend;unfold resource_reason;auto

A core machine step of the labelled machine's copy of Machine.v is a step of this file's: the two functor instances share their definitions, and only the inductive relation is generative.

312Lemma labelled_core_step
∀ ge ms ms′
M.P.I.RM.mstepge ms ms′
RM.mstepge ms ms′
Explore proof 2 tactics

Initial goal

ge :
ms, ms′ :
⊢
M.P.I.RM.mstepge ms ms′ → RM.mstepge ms ms′

intros H

ge :
ms, ms′ :
H :
M.P.I.RM.mstepge ms ms′
⊢
RM.mstepge ms ms′

destruct H ; eapply RM.mstep_next | eapply RM.mstep_alloc | eapply RM.mstep_safepoint ; eassumption

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
destruct H ; eapply RM.mstep_next | eapply RM.mstep_alloc | eapply RM.mstep_safepoint ; eassumption

The language

An expression: a running invocation ERunfr; the outcome EEndo an invocation returned, which is the value; EWaite cf pd, the expression e running as the callee of the suspended caller frame cf, which reads its result as pd says; or EBad, an external call that returned words its call site cannot take, which is no value and takes no step.

326Inductive expr: Type ≔
|ERun
fr : frame
|EEnd
o : outcome
|EWait
e : expr cf : frame pd : pending
|EBad

An evaluation context item: one suspended caller and how it reads its callee's result.

334Inductive ectx_item: Type ≔
|KWait
cf : frame pd : pending

The expression e as the callee of the context item Ki.

337Definition fill_itemKi : ectx_item e : expr : expr ≔
match Ki with
KWaitcf pd
⇒
EWaite cf pd

A value is an outcome, written as the ended expression.

341Definition of_valo : outcome : expr ≔

The outcome of an ended expression; None otherwise.

344Definition to_vale : expr : optionoutcome ≔
match e with
⇒
Someo
_
⇒
None

The Iris state over the world type world: the memory, the runtime's state, the fuel left, one counter for the whole stack, and the world of libc state the contracts speak of.

350Record lstateworld : Type : Type ≔ mkLstate
ls_mem
 : mem
ls_rt
 : R.state
ls_fuel
 : Z
ls_world
 : world
Arguments mkLstate { world }
Arguments ls_mem { world }
Arguments ls_rt { world }
Arguments ls_fuel { world }
Arguments ls_world { world }

The expression e under the callers cs, innermost first.

359Fixpoint stack_expre : expr cs : listframe × pending : expr ≔
match cs with
[ ]
⇒
e
cf, pd :: cs′
⇒
stack_exprEWaite cf pd cs′

The callers cs as an Iris evaluation context, innermost first.

366Definition ctx_ofcs : listframe × pending : listectx_item ≔
mapλ'cf, pd ⇒ KWaitcf pd cs

The expression of the configuration c: its running frame under its callers.

371Definition conf_exprc : config : expr ≔

The Iris state of the configuration c with the runtime state s and the world w.

375Definition conf_stateworld : Type c : config s : R.state w : world : lstateworld ≔

The frame fr after its external call at site returned, with the environment e: at the instruction after the call.

380Definition resumed_framefr : frame site : call_site e : env : frame ≔

resume_external resumes the running frame as resumed_frame.

384Lemma resume_external_frame
∀ c site e m
Explore proof 1 tactics

Initial goal

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
reflexivity

What ERunfr becomes when its external call at site, of the contract spec, returns the words values: the resumed_frame where the site's result takes them (external_env), EBad where it cannot.

392Definition returned_exprworld : Type fr : frame spec : contractworld site : call_site values : listword : expr ≔
match external_envspec site values fr_envfr with
Somee
⇒
None
⇒

The empty registry, over the world unit: no external function has a contract, so no external call is admissible.

401Definition no_contracts: name → optioncontractunit ≔
λ_ ⇒ None

The language over the registry, whose contracts share the world type world, in the genv ge.

405Section language
406Context world : Type registry : name → optioncontractworld ge : genv

The frame fr, alone in the memory, fuel and world of σ, is at an external_site whose call is M.admissible: a contract is registered, the arguments evaluate, the ABI and the precondition hold.

412Definition call_admissiblefr : frame σ : lstateworld : Prop ≔
∃site, external_sitege mkConfigfr [ ] ls_memσ ls_fuelσ site ∧ M.admissibleregistry ge mkConfigfr [ ] ls_memσ ls_fuelσ ls_worldσ site

The frame fr can go on in σ: alone it does not fails, or it is at an external call that is admissible. ERunfr is head-reducible in σ exactly then (run_proceeds, proceeds_reducible).

419Definition proceedsfr : frame σ : lstateworld : Prop ≔

A head step, with no observations and no forks. The running frame fr steps as fr alone would (mkConfigfr [ ] m fuel):

  • hs_next: a step that allocates nothing; a call yields the callee with fr suspended as its one caller, an EWait;
  • hs_alloc: an allocation R grants;
  • hs_refused: an allocation R refuses stalls: the run has stopped with a refusal, which is not a failure;
  • hs_return: a returning ending, once the locals end, is the value;
  • hs_stop: any other ending that is not a failure (running out of fuel, a refusal trap) stalls;
  • hs_safepoint: R's action at a due safepoint, only where fr proceeds, so that a failing frame or a rejected call is never reducible;
  • hs_resume: a returned outcome resumes the caller waiting on it;
  • hs_call_return: an external call whose contract's invocation returns words the call site takes resumes after the call, with the invocation's memory, runtime state and world;
  • hs_call_bad: one that returns words the site cannot take is EBad;
  • hs_call_wait: an admissible call stalls: it may block, exit, end for lack of resources, or have no completed invocation.
443Inductive head_step: expr → lstateworld → listunit → expr → lstateworld → listexpr → Prop ≔
∀ fr m s fuel w c′
Semantics.stepge mkConfigfr [ ] m fuel = Nextc′
hs_next
head_stepERunfr mkLstatem s fuel w [ ] conf_exprc′ conf_statec′ s w [ ]
∀ fr m s fuel w q k base s′
Semantics.stepge mkConfigfr [ ] m fuel = Freshq k
0 ≤ req_extentq%Z
R.allocs q = Somebase, s′
hs_alloc
head_stepERunfr mkLstatem s fuel w [ ] conf_exprkbase conf_statekbase s′ w [ ]
∀ fr m s fuel w q k
Semantics.stepge mkConfigfr [ ] m fuel = Freshq k
0 ≤ req_extentq%Z
R.allocs q = None
hs_refused
head_stepERunfr mkLstatem s fuel w [ ] ERunfr mkLstatem s fuel w [ ]
∀ fr m s fuel w o m′
Semantics.stepge mkConfigfr [ ] m fuel = Doneo
hs_return
head_stepERunfr mkLstatem s fuel w [ ] EEndo mkLstatem′ s fuel w [ ]
∀ fr m s fuel w o
Semantics.stepge mkConfigfr [ ] m fuel = Doneo
hs_stop
head_stepERunfr mkLstatem s fuel w [ ] ERunfr mkLstatem s fuel w [ ]
∀ fr m s fuel w s′ m′
proceedsfr mkLstatem s fuel w
RM.safepoint_duege mkConfigfr [ ] m fuel = true
R.safepoints m s′ m′
hs_safepoint
head_stepERunfr mkLstatem s fuel w [ ] ERunfr mkLstatem′ s′ fuel w [ ]
∀ o cf pd cf′ σ
resumecf pd o = Somecf′
hs_resume
head_stepEWaitEEndo cf pd σ [ ] ERuncf′ σ [ ]
∀ fr m s fuel w site spec xs trace values s′ m′ w′ e
external_sitege mkConfigfr [ ] m fuel site
registrysite_namesite = Somespec
M.E.invokespec site_resultsite site_argssite xs s m w trace CallReturnvalues s′ m′ w′
external_envspec site values fr_envfr = Somee
hs_call_return
head_stepERunfr mkLstatem s fuel w [ ] ERunc_frameresume_externalmkConfigfr [ ] m fuel site e m′ mkLstatem′ s′ fuel w′ [ ]
∀ fr m s fuel w site spec xs trace values s′ m′ w′
external_sitege mkConfigfr [ ] m fuel site
registrysite_namesite = Somespec
M.E.invokespec site_resultsite site_argssite xs s m w trace CallReturnvalues s′ m′ w′
external_envspec site values fr_envfr = None
hs_call_bad
head_stepERunfr mkLstatem s fuel w [ ] EBad mkLstatem′ s′ fuel w′ [ ]
∀ fr m s fuel w site spec xs
external_sitege mkConfigfr [ ] m fuel site
registrysite_namesite = Somespec
contract_prespec xs m w
hs_call_wait
head_stepERunfr mkLstatem s fuel w [ ] ERunfr mkLstatem s fuel w [ ]

The context-item language laws: values round-trip, a value takes no step, filling is injective and never makes a value, and a head step of a filled context is hs_resume, whose callee is a value.

501Lemma nanofil_mixin
EctxiLanguageMixinof_val to_val fill_item head_step
Explore proof 18 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
⊢
EctxiLanguageMixinof_val to_val fill_item head_step

split

7 open

world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀v : outcome, to_valof_valv = Somev
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e : expr v : outcome, to_vale = Somev → of_valv = e
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e1 : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepe1 σ1 κ e2 σ2 efs → to_vale1 = None
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–reflexivity

6 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e : expr v : outcome, to_vale = Somev → of_valv = e
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e1 : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepe1 σ1 κ e2 σ2 efs → to_vale1 = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros e o H

6 open

world :
Type
registry :
name → optioncontractworld
ge :
e :
H :
to_vale = Someo
⊢
of_valo = e
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e1 : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepe1 σ1 κ e2 σ2 efs → to_vale1 = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

destruct e ; inversion H ; reflexivity

5 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀e1 : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepe1 σ1 κ e2 σ2 efs → to_vale1 = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros e1 σ1 κ e2 σ2 efs H

5 open

world :
Type
registry :
name → optioncontractworld
ge :
e1 :
σ1 :
lstateworld
κ :
list()
e2 :
σ2 :
lstateworld
efs :
listexpr
H :
head_stepe1 σ1 κ e2 σ2 efs
⊢
to_vale1 = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

destruct H ; reflexivity

4 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr, is_Someto_valfill_itemKi e → is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros cf pd e o H

4 open

world :
Type
registry :
name → optioncontractworld
ge :
cf :
e :
H :
to_valfill_itemKWaitcf pd e = Someo
⊢
is_Someto_vale
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

discriminate H

3 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item, Injeq eq fill_itemKi
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros cf pd e1 e2 H

3 open

world :
Type
registry :
name → optioncontractworld
ge :
cf :
e1, e2 :
H :
fill_itemKWaitcf pd e1 = fill_itemKWaitcf pd e2
⊢
e1 = e2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

injection H as H

3 open

world :
Type
registry :
name → optioncontractworld
ge :
cf :
e1, e2 :
H :
e1 = e2
⊢
e1 = e2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

exact H

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki1 Ki2 : ectx_item e1 e2 : expr, to_vale1 = None → to_vale2 = None → fill_itemKi1 e1 = fill_itemKi2 e2 → Ki1 = Ki2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros cf1 pd1 cf2 pd2 e1 e2 _ _ H

2 open

world :
Type
registry :
name → optioncontractworld
ge :
cf1 :
pd1 :
cf2 :
pd2 :
e1, e2 :
H :
fill_itemKWaitcf1 pd1 e1 = fill_itemKWaitcf2 pd2 e2
⊢
KWaitcf1 pd1 = KWaitcf2 pd2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

injection H as _ → →

2 open

world :
Type
registry :
name → optioncontractworld
ge :
cf2 :
pd2 :
e1, e2 :
⊢
KWaitcf2 pd2 = KWaitcf2 pd2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
⊢
∀Ki : ectx_item e : expr σ1 : lstateworld κ : list() e2 : expr σ2 : lstateworld efs : listexpr, head_stepfill_itemKi e σ1 κ e2 σ2 efs → is_Someto_vale

–intros cf pd e σ1 κ e2 σ2 efs H

world :
Type
registry :
name → optioncontractworld
ge :
cf :
e :
σ1 :
lstateworld
κ :
list()
e2 :
σ2 :
lstateworld
efs :
listexpr
H :
head_stepfill_itemKWaitcf pd e σ1 κ e2 σ2 efs
⊢
is_Someto_vale

inversion H ; subst

world :
Type
registry :
name → optioncontractworld
ge :
cf :
σ2 :
lstateworld
cf′ :
H :
head_stepfill_itemKWaitcf pd EEndo σ2 [ ] ERuncf′ σ2 [ ]
H8 :
resumecf pd o = Somecf′
⊢
is_Someto_valEEndo

eexists

2 open

world :
Type
registry :
name → optioncontractworld
ge :
cf :
σ2 :
lstateworld
cf′ :
H :
head_stepfill_itemKWaitcf pd EEndo σ2 [ ] ERuncf′ σ2 [ ]
H8 :
resumecf pd o = Somecf′
⊢
to_valEEndo = Some?x
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cf :
σ2 :
lstateworld
cf′ :
H :
head_stepfill_itemKWaitcf pd EEndo σ2 [ ] ERuncf′ σ2 [ ]
H8 :
resumecf pd o = Somecf′

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
split
–reflexivity
–intros e o H
destruct e ; inversion H ; reflexivity
–intros e1 σ1 κ e2 σ2 efs H
destruct H ; reflexivity
–intros cf pd e o H
discriminate H
–intros cf pd e1 e2 H
injection H as H
exact H
–intros cf1 pd1 cf2 pd2 e1 e2 _ _ H
injection H as _ → →
reflexivity
–intros cf pd e σ1 κ e2 σ2 efs H
inversion H ; subst
eexists
reflexivity

Nanofil's machine with the contracts of registry, in the genv ge, as an Iris language with context items, contexts, and as a plain language.

518Canonical Structure nanofil_ectxi_langworld : Type registry : name → optioncontractworld ge : genv : ectxiLanguage ≔
EctxiLanguagenanofil_mixinregistry ge

The same language with evaluation contexts.

522Canonical Structure nanofil_ectx_langworld : Type registry : name → optioncontractworld ge : genv : ectxLanguage ≔
EctxLanguageOfEctxinanofil_ectxi_langregistry ge

The same language, plain.

526Canonical Structure nanofil_langworld : Type registry : name → optioncontractworld ge : genv : language ≔
LanguageOfEctxnanofil_ectx_langregistry ge

The expression under the callers cs1 then cs2 is under cs1, and that under cs2.

532Lemma stack_expr_app
∀ e cs1 cs2
stack_expre cs1 ++ cs2 = stack_exprstack_expre cs1 cs2
Explore proof 4 tactics

Initial goal

e :
cs1, cs2 :
listframe × pending
⊢
stack_expre cs1 ++ cs2 = stack_exprstack_expre cs1 cs2

revert e

cs1, cs2 :
listframe × pending
⊢
∀e : expr, stack_expre cs1 ++ cs2 = stack_exprstack_expre cs1 cs2

induction cs1 as | cf pd cs1 IH ; intros e ; reflexivity |

cf :
cs1, cs2 :
listframe × pending
IH :
∀e : expr, stack_expre cs1 ++ cs2 = stack_exprstack_expre cs1 cs2
e :
⊢
stack_expre cf, pd :: cs1 ++ cs2 = stack_exprstack_expre cf, pd :: cs1 cs2

cbn

cf :
cs1, cs2 :
listframe × pending
IH :
∀e : expr, stack_expre cs1 ++ cs2 = stack_exprstack_expre cs1 cs2
e :
⊢
stack_exprEWaite cf pd cs1 ++ cs2 = stack_exprstack_exprEWaite cf pd cs1 cs2

apply IH

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
revert e
induction cs1 as | cf pd cs1 IH ; intros e ; reflexivity |
cbn
apply IH

An expression that is not a value is not one under any callers.

539Lemma to_val_stack
∀ e cs
to_vale = None
to_valstack_expre cs = None
Explore proof 5 tactics

Initial goal

e :
cs :
listframe × pending
⊢
to_vale = None → to_valstack_expre cs = None

revert e

cs :
listframe × pending
⊢
∀e : expr, to_vale = None → to_valstack_expre cs = None

induction cs as | cf pd cs IH ; intros e H ; exact H |

cf :
cs :
listframe × pending
IH :
∀e : expr, to_vale = None → to_valstack_expre cs = None
e :
H :
to_vale = None
⊢
to_valstack_expre cf, pd :: cs = None

cbn

cf :
cs :
listframe × pending
IH :
∀e : expr, to_vale = None → to_valstack_expre cs = None
e :
H :
to_vale = None
⊢
to_valstack_exprEWaite cf pd cs = None

apply IH

cf :
cs :
listframe × pending
IH :
∀e : expr, to_vale = None → to_valstack_expre cs = None
e :
H :
to_vale = None
⊢
to_valEWaite cf pd = None

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
revert e
induction cs as | cf pd cs IH ; intros e H ; exact H |
cbn
apply IH
reflexivity

Facts of the language with the contracts of registry, in the genv ge.

546Section facts
547Context world : Type registry : name → optioncontractworld ge : genv

The expression e under the callers cs is Iris's fill of their context, foldlflipfill_item, innermost first.

551Lemma stack_expr_fill
∀ e cs
stack_expre cs = @ectx_language.fillnanofil_ectx_langregistry ge ctx_ofcs e
Explore proof 5 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
e :
cs :
listframe × pending
⊢
stack_expre cs = ectx_language.fillctx_ofcs e

revert e

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
⊢
∀e : expr, stack_expre cs = ectx_language.fillctx_ofcs e

induction cs as | cf pd cs IH ; intros e ; reflexivity |

world :
Type
registry :
name → optioncontractworld
ge :
cf :
cs :
listframe × pending
IH :
∀e : expr, stack_expre cs = ectx_language.fillctx_ofcs e
e :
⊢
stack_expre cf, pd :: cs = ectx_language.fillctx_ofcf, pd :: cs e

cbn [ stack_expr ]

world :
Type
registry :
name → optioncontractworld
ge :
cf :
cs :
listframe × pending
IH :
∀e : expr, stack_expre cs = ectx_language.fillctx_ofcs e
e :
⊢
stack_exprEWaite cf pd cs = ectx_language.fillctx_ofcf, pd :: cs e

rewrite IH

world :
Type
registry :
name → optioncontractworld
ge :
cf :
cs :
listframe × pending
IH :
∀e : expr, stack_expre cs = ectx_language.fillctx_ofcs e
e :
⊢
ectx_language.fillctx_ofcs EWaite cf pd = ectx_language.fillctx_ofcf, pd :: cs e

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
revert e
induction cs as | cf pd cs IH ; intros e ; reflexivity |
cbn [ stack_expr ]
rewrite IH
reflexivity

A head step under the callers cs is an Iris step of the thread pool of that one expression.

560Lemma head_erased
∀ cs e1 σ1 e2 σ2
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ]
@erased_stepnanofil_langregistry ge stack_expre1 cs, σ1 stack_expre2 cs, σ2
Explore proof 5 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e1 :
σ1 :
lstateworld
e2 :
σ2 :
lstateworld
⊢
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ] → erased_stepstack_expre1 cs, σ1 stack_expre2 cs, σ2

intros H

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e1 :
σ1 :
lstateworld
e2 :
σ2 :
lstateworld
H :
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ]
⊢
erased_stepstack_expre1 cs, σ1 stack_expre2 cs, σ2

exists [ ]

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e1 :
σ1 :
lstateworld
e2 :
σ2 :
lstateworld
H :
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ]
⊢
language.stepstack_expre1 cs, σ1 [ ] stack_expre2 cs, σ2

apply step_atomicstack_expre1 cs σ1 stack_expre2 cs σ2 [ ] [ ] [ ] ; reflexivity | reflexivity |

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e1 :
σ1 :
lstateworld
e2 :
σ2 :
lstateworld
H :
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ]
⊢
prim_stepstack_expre1 cs σ1 [ ] stack_expre2 cs σ2 [ ]

rewrite ! stack_expr_fill

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e1 :
σ1 :
lstateworld
e2 :
σ2 :
lstateworld
H :
head_stepregistry ge e1 σ1 [ ] e2 σ2 [ ]
⊢
prim_stepectx_language.fillctx_ofcs e1 σ1 [ ] ectx_language.fillctx_ofcs e2 σ2 [ ]

exact Ectx_step'Λ ≔ nanofil_ectx_langregistry ge _ _ _ _ _ _ _ H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
exists [ ]
apply step_atomicstack_expre1 cs σ1 stack_expre2 cs σ2 [ ] [ ] [ ] ; reflexivity | reflexivity |
rewrite ! stack_expr_fill
exact Ectx_step'Λ ≔ nanofil_ectx_langregistry ge _ _ _ _ _ _ _ H

Where e is not a value and has only values as sub-redexes, e under any callers is reducible only if e is head-reducible.

572Lemma ctx_base_reducible
∀ cs e σ
to_vale = None
∀Ki e′, e = fill_itemKi e′ → is_Someto_vale′
@reduciblenanofil_langregistry ge stack_expre cs σ
@base_reduciblenanofil_ectx_langregistry ge e σ
Explore proof 13 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
⊢
to_vale = None → ∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′ → reduciblestack_expre cs σ → base_reduciblee σ

intros Hv Hsub κ & e2 & σ2 & efs & Hs

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
Hs :
prim_stepstack_expre cs σ κ e2 σ2 efs
⊢
base_reduciblee σ

rewrite stack_expr_fill in Hs

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
Hs :
prim_stepectx_language.fillctx_ofcs e σ κ e2 σ2 efs
⊢
base_reduciblee σ

destruct Hs as K e1′ e2′ HK _ Hb

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
K :
ectxectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
HK :
ectx_language.fillctx_ofcs e = ectx_language.fillK e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
⊢
base_reduciblee σ

destruct step_by_valΛ ≔ nanofil_ectx_langregistry ge ctx_ofcs K e e1′ _ _ _ _ _ HK Hv Hb as K′′ →

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
ectx_language.fillctx_ofcs e = ectx_language.fillcomp_ectxctx_ofcs K′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
⊢
base_reduciblee σ

rewrite <- fill_comp in HK

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
ectx_language.fillctx_ofcs e = ectx_language.fillctx_ofcs ectx_language.fillK′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
⊢
base_reduciblee σ

apply inj_ in HK

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
e = ectx_language.fillK′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
⊢
base_reduciblee σ

assert Hs : @sub_redexes_are_valuesnanofil_ectx_langregistry ge e

2 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
e = ectx_language.fillK′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
⊢
sub_redexes_are_valuese
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
e = ectx_language.fillK′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
base_reduciblee σ

{exact ectxi_language_sub_redexes_are_valuesΛ ≔ nanofil_ectxi_langregistry ge e Hsub

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
K′′ :
ectxnanofil_ectx_langregistry ge
HK :
e = ectx_language.fillK′′ e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
base_reduciblee σ

pose proof HsK′′ e1′ HK val_base_stuck_ _ _ _ _ _ Hb as →

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
HK :
e = ectx_language.fillempty_ectx e1′
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
base_reduciblee σ

rewrite fill_empty in HK

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e1′, e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe1′ σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
HK :
e = e1′
⊢
base_reduciblee σ

subst e1′

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
base_reduciblee σ

do 4 eexists

5 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
ectx_language.base_stepe σ ?κ ?e′ ?σ′ ?efs
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
e :
σ :
statenanofil_langregistry ge
Hv :
to_vale = None
Hsub :
∀Ki : ectx_item e′ : expr, e = fill_itemKi e′ → is_Someto_vale′
κ :
listobservationnanofil_langregistry ge
σ2 :
statenanofil_langregistry ge
efs :
e2′ :
ectx_language.exprectx_language.expr ≔ expr; ectx_language.val ≔ outcome; ectx ≔ listectx_item; ectx_language.state ≔ lstateworld; ectx_language.observation ≔ (); ectx_language.of_val ≔ of_val; ectx_language.to_val ≔ to_val; empty_ectx ≔ [ ]; comp_ectx ≔ flipapp; ectx_language.fill ≔ fill; ectx_language.base_step ≔ base_step; ectx_language_mixin ≔ ectxi_lang_ectx_mixin
Hb :
ectx_language.base_stepe σ κ e2′ σ2 efs
Hs :
sub_redexes_are_valuese

exact Hb

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Hv Hsub κ & e2 & σ2 & efs & Hs
rewrite stack_expr_fill in Hs
destruct Hs as K e1′ e2′ HK _ Hb
destruct step_by_valΛ ≔ nanofil_ectx_langregistry ge ctx_ofcs K e e1′ _ _ _ _ _ HK Hv Hb as K′′ →
rewrite <- fill_comp in HK
apply inj_ in HK
assert Hs : @sub_redexes_are_valuesnanofil_ectx_langregistry ge e
{exact ectxi_language_sub_redexes_are_valuesΛ ≔ nanofil_ectxi_langregistry ge e Hsub
pose proof HsK′′ e1′ HK val_base_stuck_ _ _ _ _ _ Hb as →
rewrite fill_empty in HK
subst e1′
do 4 eexists
exact Hb

The inversion of a head step from ERunfr in the state σ: no observations or forks, and one of the cases of head_step, each stated of fr alone; an external call's return is one case, the frame resumed or EBad (returned_expr). Weakest-precondition rules are stated per case.

595Lemma head_step_run_inv
∀ fr σ κ e′ σ′ efs
head_stepregistry ge ERunfr σ κ e′ σ′ efs
let c0 ≔ mkConfigfr [ ] ls_memσ ls_fuelσ in
κ = [ ] ∧ efs = [ ] ∧ ∃c′, Semantics.stepge c0 = Nextc′ ∧ e′ = conf_exprc′ ∧ σ′ = conf_statec′ ls_rtσ ls_worldσ ∨ ∃q k base s′, Semantics.stepge c0 = Freshq k ∧ 0 ≤ req_extentq%Z ∧ R.allocls_rtσ q = Somebase, s′ ∧ e′ = conf_exprkbase ∧ σ′ = conf_statekbase s′ ls_worldσ ∨ ∃q k, Semantics.stepge c0 = Freshq k ∧ 0 ≤ req_extentq%Z ∧ R.allocls_rtσ q = None ∧ e′ = ERunfr ∧ σ′ = σ ∨ ∃o m′, Semantics.stepge c0 = Doneo ∧ returningo ∧ invalidate_localsfr_localsfr ls_memσ = Somem′ ∧ e′ = EEndo ∧ σ′ = mkLstatem′ ls_rtσ ls_fuelσ ls_worldσ ∨ ∃o, Semantics.stepge c0 = Doneo ∧ ¬failureo ∧ ¬returningo ∧ e′ = ERunfr ∧ σ′ = σ ∨ ∃s′ m′, proceedsregistry ge fr σ ∧ RM.safepoint_duege c0 = true ∧ R.safepointls_rtσ ls_memσ s′ m′ ∧ e′ = ERunfr ∧ σ′ = mkLstatem′ s′ ls_fuelσ ls_worldσ ∨ ∃site spec xs trace values s′ m′ w′, external_sitege c0 site ∧ registrysite_namesite = Somespec ∧ map_optionarg_xge fr_envfr site_argssite = Somexs ∧ M.E.invokespec site_resultsite site_argssite xs ls_rtσ ls_memσ ls_worldσ trace CallReturnvalues s′ m′ w′ ∧ e′ = returned_exprfr spec site values ∧ σ′ = mkLstatem′ s′ ls_fuelσ w′ ∨ call_admissibleregistry ge fr σ ∧ e′ = ERunfr ∧ σ′ = σ
Proof 34 steps Qed
intros H
inversion H ; subst ; cbn [ ls_mem ls_rt ls_fuel ls_world ] ; split ; reflexivity | split ; reflexivity |
–left
eauto
–right ; left
eauto 10
–do 2 right ; left
eauto 10
–do 3 right ; left
eauto 10
–do 4 right ; left
eauto 10
–do 5 right ; left
eauto 10
–do 6 right ; left
do 8 eexists
repeat split ; eassumption |
split ; | reflexivity
match goal withHe : external_env_ _ _ _ = Some_ |- _⇒rewrite Heend
reflexivity
–do 6 right ; left
do 8 eexists
repeat split ; eassumption |
split ; | reflexivity
match goal withHe : external_env_ _ _ _ = None |- _⇒rewrite Heend
reflexivity
–do 7 right
split ; | split ; reflexivity
eexists
split ; eassumption |
do 2 eexists
eauto

A frame that takes a head step proceeds: it does not fails alone, or its external call is admissible.

641Lemma run_proceeds
∀ fr σ κ e′ σ′ efs
head_stepregistry ge ERunfr σ κ e′ σ′ efs
proceedsregistry ge fr σ
Proof 31 steps Qed
intros H
destruct head_step_run_inv_ _ _ _ _ _ H as _ & _ & c′ & E & _ | q & k & b & s′ & E & He & _ | q & k & E & He & _ | o & m′ & E & Hr & _ | o & E & Hf & _ | s′ & m′ & Hp & _ | site & spec & xs & tr & vs & s′ & m′ & w′ & Hs & Hreg & Hx & Hi & _ | Ha & _
–left
unfold fails
rewrite E
auto
–left
unfold fails
rewrite E
lia
–left
unfold fails
rewrite E
lia
–left
unfold fails
rewrite E
destruct o ; cbn in * ; tauto
–left
unfold fails
rewrite E
exact Hf
–exact Hp
–right
destruct invoke_admissible_ _ _ _ _ _ _ _ _ _ _ _ Hi as Habi Hpre
exists site
split ; exact Hs |
exists spec, xs
auto
–right
exact Ha

The language never blocks a frame that does not fail: if fr alone does not fails in σ's memory and fuel, ERunfr is head-reducible in σ.

662Lemma run_reducible
∀ fr σ
@base_reduciblenanofil_ectx_langregistry ge ERunfr σ
Explore proof 20 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr :
σ :
lstateworld
⊢
¬failsge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memσ; c_fuel ≔ ls_fuelσ → base_reducibleERunfr σ

destruct σ as m s fuel w

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
⊢
¬failsge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w → base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

cbn

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
⊢
¬failsge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel → base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

intros Hf

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
Hf :
¬failsge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

unfold fails in Hf

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
Hf :
¬match stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel with Next_ ⇒ False | Doneo ⇒ failureo | Freshq _ ⇒ req_extentq < 0 | Stuck_ ⇒ True end
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

destruct Semantics.stepge mkConfigfr [ ] m fuel as c′ | o | q k | w′ eqn: E

4 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

–do 4 eexists

8 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False

eapply hs_next

5 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False
⊢
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Next?c′
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
c′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Nextc′
Hf :
¬False

exact E

3 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

–destruct returning_deco as Hr | Hr

4 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

+destruct step_callers_returnge fr [ ] m fuel o E Hr as _ m′ Hi

4 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

do 4 eexists

8 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
m′ :
Hi :

eapply hs_return ; eassumption

3 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

+do 4 eexists

7 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Doneo
Hf :
Hr :

eapply hs_stop ; eassumption

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

–destruct R.allocs q as base s′ | eqn: Ea

3 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

+do 4 eexists

7 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
base :
Z
s′ :
R.state
Ea :
R.allocs q = Somebase, s′

eapply hs_alloc ; exact E | lia | exact Ea

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

+do 4 eexists

6 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
k :
Z → config
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Freshq k
Hf :
¬req_extentq < 0
Ea :
R.allocs q = None

eapply hs_refused ; exact E | lia | exact Ea

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
w′ :
E :
stepge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel = Stuckw′
Hf :
¬True
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

–contradiction

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
destruct σ as m s fuel w
cbn
intros Hf
unfold fails in Hf
destruct Semantics.stepge mkConfigfr [ ] m fuel as c′ | o | q k | w′ eqn: E
–do 4 eexists
eapply hs_next
exact E
–destruct returning_deco as Hr | Hr
+destruct step_callers_returnge fr [ ] m fuel o E Hr as _ m′ Hi
do 4 eexists
eapply hs_return ; eassumption
+do 4 eexists
eapply hs_stop ; eassumption
–destruct R.allocs q as base s′ | eqn: Ea
+do 4 eexists
eapply hs_alloc ; exact E | lia | exact Ea
+do 4 eexists
eapply hs_refused ; exact E | lia | exact Ea
–contradiction

Nor an admissible external call: ERunfr at one is head-reducible, by hs_call_wait, whether or not the contract allows a return.

682Lemma admissible_reducible
∀ fr σ
call_admissibleregistry ge fr σ
@base_reduciblenanofil_ectx_langregistry ge ERunfr σ
Explore proof 4 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr :
σ :
lstateworld
⊢
call_admissibleregistry ge fr σ → base_reducibleERunfr σ

destruct σ as m s fuel w

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
⊢
call_admissibleregistry ge fr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w → base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

intros site & Hs & spec & xs & Hr & Hx & Ha & Hp

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
⊢
base_reducibleERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

do 4 eexists

5 open

world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
⊢
ectx_language.base_stepERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ?κ ?e′ ?σ′ ?efs
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
⊢
listectx_language.observationnanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
⊢
ectx_language.statenanofil_ectx_langregistry ge
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
fuel :
Z
w :
world
site :
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site
spec :
xs :
listword
Hr :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w site_argssite = Somexs
Hp :
contract_prespec xs c_memc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w; c_fuel ≔ ls_fuells_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ls_worldls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w

eapply hs_call_wait ; eassumption

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
destruct σ as m s fuel w
intros site & Hs & spec & xs & Hr & Hx & Ha & Hp
do 4 eexists
eapply hs_call_wait ; eassumption

A frame that proceeds is head-reducible.

690Lemma proceeds_reducible
∀ fr σ
proceedsregistry ge fr σ
@base_reduciblenanofil_ectx_langregistry ge ERunfr σ
Explore proof 1 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr :
σ :
lstateworld
⊢
proceedsregistry ge fr σ → base_reducibleERunfr σ

intros H | H ; exact run_reducible_ _ H | exact admissible_reducible_ _ H

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H | H ; exact run_reducible_ _ H | exact admissible_reducible_ _ H

A returned outcome waiting on a caller is reducible, under any callers, only where the caller resumes.

696Lemma wait_resumes
∀ cs o cf pd σ
@reduciblenanofil_langregistry ge stack_exprEWaitEEndo cf pd cs σ
∃cf′, resumecf pd o = Somecf′
Explore proof 10 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
⊢
reduciblestack_exprEWaitEEndo cf pd cs σ → ∃cf′ : frame, resumecf pd o = Somecf′

intros H

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
∃cf′ : frame, resumecf pd o = Somecf′

apply ctx_base_reducible in H as κ & e′ & σ′ & efs & Hs

3 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
κ :
listectx_language.observationnanofil_ectx_langregistry ge
σ′ :
ectx_language.statenanofil_ectx_langregistry ge
Hs :
ectx_language.base_stepEWaitEEndo cf pd σ κ e′ σ′ efs
⊢
∃cf′ : frame, resumecf pd o = Somecf′
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
to_valEWaitEEndo cf pd = None
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
∀Ki : ectx_item e′ : expr, EWaitEEndo cf pd = fill_itemKi e′ → is_Someto_vale′

–inversion Hs ; subst

3 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ′ :
ectx_language.statenanofil_ectx_langregistry ge
cf′ :
Hs :
ectx_language.base_stepEWaitEEndo cf pd σ′ [ ] ERuncf′ σ′ [ ]
H7 :
resumecf pd o = Somecf′
⊢
∃cf'0 : frame, resumecf pd o = Somecf'0
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
to_valEWaitEEndo cf pd = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
∀Ki : ectx_item e′ : expr, EWaitEEndo cf pd = fill_itemKi e′ → is_Someto_vale′

eauto

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
to_valEWaitEEndo cf pd = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
∀Ki : ectx_item e′ : expr, EWaitEEndo cf pd = fill_itemKi e′ → is_Someto_vale′

–reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
⊢
∀Ki : ectx_item e′ : expr, EWaitEEndo cf pd = fill_itemKi e′ → is_Someto_vale′

–intros cf′ pd′ e′ Heq

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
cf′ :
pd′ :
e′ :
Heq :
EWaitEEndo cf pd = fill_itemKWaitcf′ pd′ e′
⊢
is_Someto_vale′

cbn in Heq

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
cf′ :
pd′ :
e′ :
Heq :
EWaitEEndo cf pd = EWaite′ cf′ pd′
⊢
is_Someto_vale′

injection Heq as ← _ _

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
cf′ :
pd′ :
⊢
is_Someto_valEEndo

eexists

2 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
cf′ :
pd′ :
⊢
to_valEEndo = Some?x
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
cf :
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEWaitEEndo cf pd cs σ
cf′ :
pd′ :

reflexivity

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
apply ctx_base_reducible in H as κ & e′ & σ′ & efs & Hs
–inversion Hs ; subst
eauto
–reflexivity
–intros cf′ pd′ e′ Heq
cbn in Heq
injection Heq as ← _ _
eexists
reflexivity

A bad return is stuck under any callers.

707Lemma bad_stuck
∀ cs σ
¬@reduciblenanofil_langregistry ge stack_exprEBad cs σ
Explore proof 6 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
⊢
¬reduciblestack_exprEBad cs σ

intros H

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
False

apply ctx_base_reducible in H as κ & e′ & σ′ & efs & Hs

3 open

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
κ :
listectx_language.observationnanofil_ectx_langregistry ge
σ′ :
ectx_language.statenanofil_ectx_langregistry ge
Hs :
ectx_language.base_stepEBad σ κ e′ σ′ efs
⊢
False
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
to_valEBad = None
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
∀Ki : ectx_item e′ : expr, EBad = fill_itemKi e′ → is_Someto_vale′

–inversion Hs

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
to_valEBad = None
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
∀Ki : ectx_item e′ : expr, EBad = fill_itemKi e′ → is_Someto_vale′

–reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
⊢
∀Ki : ectx_item e′ : expr, EBad = fill_itemKi e′ → is_Someto_vale′

–intros cf pd e′ Heq

world :
Type
registry :
name → optioncontractworld
ge :
cs :
listframe × pending
σ :
statenanofil_langregistry ge
H :
reduciblestack_exprEBad cs σ
cf :
e′ :
Heq :
EBad = fill_itemKWaitcf pd e′
⊢
is_Someto_vale′

discriminate Heq

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H
apply ctx_base_reducible in H as κ & e′ & σ′ & efs & Hs
–inversion Hs
–reflexivity
–intros cf pd e′ Heq
discriminate Heq

Where the expression of the configuration c is not stuck, its running frame proceeds.

717Lemma conf_reducible
∀ c s w
@not_stucknanofil_langregistry ge conf_exprc conf_statec s w
Explore proof 9 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
⊢
not_stuckconf_exprc conf_statec s w → proceedsregistry ge c_framec conf_statec s w

intros v Hv | Hred

2 open

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
v :
valnanofil_langregistry ge
⊢
proceedsregistry ge c_framec conf_statec s w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
proceedsregistry ge c_framec conf_statec s w

–change to_valconf_exprc = Somev in Hv

2 open

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
v :
valnanofil_langregistry ge
Hv :
to_valconf_exprc = Somev
⊢
proceedsregistry ge c_framec conf_statec s w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
proceedsregistry ge c_framec conf_statec s w

unfold conf_expr in Hv

2 open

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
v :
valnanofil_langregistry ge
⊢
proceedsregistry ge c_framec conf_statec s w
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
proceedsregistry ge c_framec conf_statec s w

rewrite to_val_stack in Hv ; discriminate Hv | reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
proceedsregistry ge c_framec conf_statec s w

–apply ctx_base_reducible in Hred as κ & e′ & σ′ & efs & Hs

3 open

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
κ :
listectx_language.observationnanofil_ectx_langregistry ge
σ′ :
ectx_language.statenanofil_ectx_langregistry ge
Hs :
ectx_language.base_stepERunc_framec conf_statec s w κ e′ σ′ efs
⊢
proceedsregistry ge c_framec conf_statec s w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
∀Ki : ectx_item e′ : expr, ERunc_framec = fill_itemKi e′ → is_Someto_vale′

+exact run_proceeds_ _ _ _ _ _ Hs

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
∀Ki : ectx_item e′ : expr, ERunc_framec = fill_itemKi e′ → is_Someto_vale′

+reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
⊢
∀Ki : ectx_item e′ : expr, ERunc_framec = fill_itemKi e′ → is_Someto_vale′

+intros cf pd e′ Heq

world :
Type
registry :
name → optioncontractworld
ge :
s :
R.state
w :
world
Hred :
reducibleconf_exprc conf_statec s w
cf :
e′ :
Heq :
⊢
is_Someto_vale′

discriminate Heq

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros v Hv | Hred
–change to_valconf_exprc = Somev in Hv
unfold conf_expr in Hv
rewrite to_val_stack in Hv ; discriminate Hv | reflexivity
–apply ctx_base_reducible in Hred as κ & e′ & σ′ & efs & Hs
+exact run_proceeds_ _ _ _ _ _ Hs
+reflexivity
+intros cf pd e′ Heq
discriminate Heq

Adequacy

Adequacy for the run of the frame fr0, with the contracts of registry in the genv ge, from the memory m0, the runtime state s0, the fuel fuel0 and the world w0.

737Section adequacy
738Context world : Type registry : name → optioncontractworld ge : genv fr0 : frame m0 : mem s0 : R.state fuel0 : Z w0 : world

The configuration c with the runtime state s and the world w is Iris-reachable: its expression and state follow the initial ones by Iris steps.

744Definition iris_reachc : config s : R.state w : world : Prop ≔
rtc@erased_stepnanofil_langregistry ge ERunfr0, mkLstatem0 s0 fuel0 w0 conf_exprc, conf_statec s w

Where Iris adequacy holds, the running frame of every Iris-reachable configuration proceeds.

750Lemma reach_proceeds
∀ φ c s w
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
Explore proof 4 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → iris_reachc s w → proceedsregistry ge c_framec conf_statec s w

intros Had Hr

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
⊢
proceedsregistry ge c_framec conf_statec s w

apply conf_reducibleregistry ge c s w

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
⊢
not_stuckconf_exprc conf_statec s w

apply adequate_not_stuck_ _ _ _ Had _ _ conf_exprc eq_refl Hr

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :

left

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had Hr
apply conf_reducibleregistry ge c s w
apply adequate_not_stuck_ _ _ _ Had _ _ conf_exprc eq_refl Hr
left

Every core machine step from an Iris-reachable state reaches an Iris-reachable state, in the same world: a step that allocates nothing, an allocation and a safepoint are one head step under the callers; a return to a caller is two, hs_return and then hs_resume.

763Lemma reach_step
∀ φ c s w c′ s′
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
RM.mstepge c, s c′, s′
iris_reachc′ s′ w
Proof 43 steps Qed
intros Had Hr Hs
pose proof reach_proceedsφ c s w Had Hr as Hp
destruct c as fr cs m fuel
pose proof step_callersge fr cs m fuel as Hl
inversion Hs as c1 c1′ s1 E | c1 q k s1 base s1′ E He Hal | c1 s1 s1′ m′ Hdue Hsp ; subst
–destruct Semantics.stepge mkConfigfr [ ] m fuel as c0′ | o | q k | w′ eqn: E0 ; cbn [ lifted ] in Hl ; rewrite E in Hl
+injection Hl as →
eapply rtc_r ; exact Hr |
unfold conf_expr at 2
exact head_erasedregistry ge cs _ _ _ _ hs_nextregistry ge fr m s' fuel w c0' E0
+destruct Hl as _ Hl | Hrt & Hl & m′ & Hi ; discriminate Hl |
destruct cs as | cf pd cs
{rewrite return_nil_done_ _ _ _ _ Hi in Hl
discriminate Hl
rewrite return_cons_ _ _ _ _ _ _ _ Hi in Hl
destruct resumecf pd o as cf′ | eqn: Er ; | discriminate Hl
injection Hl as →
eapply rtc_r ; eapply rtc_r ; exact Hr | |
∗exact head_erasedregistry ge cf, pd :: cs _ _ _ _ hs_returnregistry ge fr m s' fuel w o m' E0 Hrt Hi
∗exact head_erasedregistry ge cs _ _ _ _ hs_resumeregistry ge o cf pd cf' _ Er
+destruct Hl as k′ & Hl & _
discriminate Hl
+destruct Hl as w′′ & Hl
discriminate Hl
–destruct Semantics.stepge mkConfigfr [ ] m fuel as c0′ | o | q0 k0 | w′ eqn: E0 ; cbn [ lifted ] in Hl ; rewrite E in Hl
+discriminate Hl
+destruct Hl as _ Hl | Hrt & Hl & m′ & Hi ; discriminate Hl |
exfalso
exact return_step_not_fresh_ _ _ _ eq_symHl
+destruct Hl as k′ & Hl & Hk
injection Hl as → →
rewrite Hk
eapply rtc_r ; exact Hr |
unfold conf_expr at 2
exact head_erasedregistry ge cs _ _ _ _ hs_allocregistry ge fr m s fuel w q0 k0 base s' E0 He Hal
+destruct Hl as w′′ & Hl
discriminate Hl
–eapply rtc_r ; exact Hr |
exact head_erasedregistry ge cs _ _ _ _ hs_safepointregistry ge fr m s fuel w s' m' Hp Hdue Hsp

An Iris-reachable configuration whose frame alone does not fails does not fail: where its return to a caller is stuck, the returned outcome waiting on that caller is Iris-reachable and stuck.

806Lemma reach_not_fails
∀ φ c s w
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
Proof 27 steps Qed
intros Had Hr Hnf
destruct c as fr cs m fuel
cbn in Hnf
pose proof step_callersge fr cs m fuel as Hl
unfold fails in Hnf |- *
destruct Semantics.stepge mkConfigfr [ ] m fuel as c0′ | o | q k | w′ eqn: E0 ; cbn [ lifted ] in Hl
–rewrite Hl
auto
–destruct Hl as Hrt Hl | Hrt & Hl & m′ & Hi ; rewrite Hl ; exact Hnf |
destruct cs as | cf pd cs
{rewrite return_nil_done_ _ _ _ _ Hi
destruct o ; cbn in * ; tauto
rewrite return_cons_ _ _ _ _ _ _ _ Hi
destruct resumecf pd o as cf′ | eqn: Er ; auto |
intros _
assert Hr′ : rtc@erased_stepnanofil_langregistry ge ERunfr0, mkLstatem0 s0 fuel0 w0 stack_exprEWaitEEndo cf pd cs, mkLstatem' s fuel w
{eapply rtc_r ; exact Hr |
exact head_erasedregistry ge cf, pd :: cs _ _ _ _ hs_returnregistry ge fr m s fuel w o m' E0 Hrt Hi
destruct adequate_not_stuck_ _ _ _ Had _ _ _ eq_refl Hr' ltac:left as v Hv | Hred
+change to_valstack_exprEWaitEEndo cf pd cs = Somev in Hv
rewrite to_val_stack in Hv ; discriminate Hv | reflexivity
+destruct wait_resumesregistry ge cs o cf pd _ Hred as cf′ Hcf′
congruence
–destruct Hl as k′ & → & _
exact Hnf
–exfalso
exact HnfI

An Iris-reachable configuration at no external site does not fails.

837Lemma reach_core
∀ φ c s w
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
∀site, ¬external_sitege c site
Explore proof 5 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → iris_reachc s w → ∀site : call_site, ¬external_sitege c site → ¬failsge c

intros Had Hr Hns

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
⊢
¬failsge c

apply reach_not_failsφ c s w Had Hr

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
⊢
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ c_memc; c_fuel ≔ c_fuelc

destruct reach_proceedsφ c s w Had Hr as Hnf | site & Hs & _ ; exact Hnf |

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
site :
Hs :
⊢
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ c_memc; c_fuel ≔ c_fuelc

exfalso

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
site :
Hs :
⊢
False

exact Hnssite Hs

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had Hr Hns
apply reach_not_failsφ c s w Had Hr
destruct reach_proceedsφ c s w Had Hr as Hnf | site & Hs & _ ; exact Hnf |
exfalso
exact Hnssite Hs

A core ending of an Iris-reachable configuration at no external site is no failure; a returning one is a top-level return, whose value satisfies φ in some Iris-reachable state.

849Lemma reach_end
∀ φ c s w o
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
∀site, ¬external_sitege c site
Semantics.stepge c = Doneo
¬failureo ∧ returningo → ∃σ, φo σ
Proof 27 steps Qed
intros Had Hr Hns E
pose proof reach_coreφ c s w Had Hr Hns as Hnf
unfold fails in Hnf
rewrite E in Hnf
split ; exact Hnf |
intros Hret
destruct c as fr cs m fuel
pose proof step_callersge fr cs m fuel as Hl
rewrite E in Hl
destruct Semantics.stepge mkConfigfr [ ] m fuel as c0′ | o0 | q k | w′ eqn: E0 ; cbn [ lifted ] in Hl
–discriminate Hl
–destruct Hl as Hr0 Hl | Hr0 & Hl & m′ & Hi
+injection Hl as ←
contradiction
+destruct cs as | cf pd cs
∗rewrite return_nil_done_ _ _ _ _ Hi in Hl
injection Hl as ←
exists mkLstatem' s fuel w
apply adequate_result_ _ _ _ Had [ ]
eapply rtc_r ; exact Hr |
exact head_erasedregistry ge [ ] _ _ _ _ hs_returnregistry ge fr m s fuel w o m' E0 Hr0 Hi
∗rewrite return_cons_ _ _ _ _ _ _ _ Hi in Hl
destruct resumecf pd o0 ; discriminate Hl
–destruct Hl as k′ & Hl & _
discriminate Hl
–destruct Hl as w′′ & Hl
discriminate Hl

An Iris-reachable configuration at no external site is not stuck.

874Lemma reach_stuck
∀ φ c s w why
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
∀site, ¬external_sitege c site
Semantics.stepge c ≠ Stuckwhy
Explore proof 5 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
why :
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → iris_reachc s w → ∀site : call_site, ¬external_sitege c site → stepge c ≠ Stuckwhy

intros Had Hr Hns E

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
why :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
E :
stepge c = Stuckwhy
⊢
False

apply reach_coreφ c s w Had Hr Hns

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
why :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
E :
stepge c = Stuckwhy
⊢
failsge c

unfold fails

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
why :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
E :
stepge c = Stuckwhy
⊢
match stepge c with
⇒
False
⇒
⇒
True

rewrite E

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
why :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hns :
∀site : call_site, ¬external_sitege c site
E :
stepge c = Stuckwhy
⊢
True

exact I

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had Hr Hns E
apply reach_coreφ c s w Had Hr Hns
unfold fails
rewrite E
exact I

An external call's return to an Iris-reachable configuration reaches an Iris-reachable one: hs_call_return under the callers.

884Lemma reach_return
∀ c s w site spec xs trace values s′ m′ w′ e
registrysite_namesite = Somespec
M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′
external_envspec site values fr_envc_framec = Somee
iris_reachresume_externalc site e m′ s′ w′
Explore proof 4 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
e :
⊢
iris_reachc s w → external_sitege c site → registrysite_namesite = Somespec → map_optionarg_xge fr_envc_framec site_argssite = Somexs → M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′ → external_envspec site values fr_envc_framec = Somee → iris_reachresume_externalc site e m′ s′ w′

intros Hr Hs Hreg Hx Hi He

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
e :
Hr :
Hs :
external_sitege c site
Hreg :
registrysite_namesite = Somespec
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec = Somee
⊢
iris_reachresume_externalc site e m′ s′ w′

destruct c as fr cs m fuel

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
e :
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Somee
⊢
iris_reachresume_externalc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site e m′ s′ w′

eapply rtc_r ; exact Hr |

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
e :
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = Somee
⊢
erased_stepconf_exprc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel, conf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w conf_exprresume_externalc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site e m′, conf_stateresume_externalc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site e m′ s′ w′

exact head_erasedregistry ge cs _ _ _ _ hs_call_returnregistry ge fr m s fuel w site spec xs trace values s′ m′ w′ e Hs Hreg Hx Hi He

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Hr Hs Hreg Hx Hi He
destruct c as fr cs m fuel
eapply rtc_r ; exact Hr |
exact head_erasedregistry ge cs _ _ _ _ hs_call_returnregistry ge fr m s fuel w site spec xs trace values s′ m′ w′ e Hs Hreg Hx Hi He

An Iris-reachable configuration's external call never returns words its call site cannot take: that would reach EBad.

898Lemma reach_bad
∀ φ c s w site spec xs trace values s′ m′ w′
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
registrysite_namesite = Somespec
M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′
external_envspec site values fr_envc_framec = None
False
Explore proof 9 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → iris_reachc s w → external_sitege c site → registrysite_namesite = Somespec → map_optionarg_xge fr_envc_framec site_argssite = Somexs → M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′ → external_envspec site values fr_envc_framec = None → False

intros Had Hr Hs Hreg Hx Hi He

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hreg :
registrysite_namesite = Somespec
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec = None
⊢
False

destruct c as fr cs m fuel

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
⊢
False

assert Hr′ : rtc@erased_stepnanofil_langregistry ge ERunfr0, mkLstatem0 s0 fuel0 w0 stack_exprEBad cs, mkLstatem′ s′ fuel w′

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
⊢
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

{eapply rtc_r ; exact Hr |

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
⊢
erased_stepconf_exprc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel, conf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

exact head_erasedregistry ge cs _ _ _ _ hs_call_badregistry ge fr m s fuel w site spec xs trace values s′ m′ w′ Hs Hreg Hx Hi He

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

destruct adequate_not_stuck_ _ _ _ Had _ _ _ eq_refl Hr′ ltac:left as v Hv | Hred

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
v :
valnanofil_langregistry ge
⊢
False
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
Hred :
reduciblestack_exprEBad cs ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

–change to_valstack_exprEBad cs = Somev in Hv

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
v :
valnanofil_langregistry ge
Hv :
⊢
False
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
Hred :
reduciblestack_exprEBad cs ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

rewrite to_val_stack in Hv ; discriminate Hv | reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
spec :
xs :
listword
trace :
listevent
values :
listword
s′ :
R.state
m′ :
w′ :
world
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hreg :
registrysite_namesite = Somespec
Hx :
map_optionarg_xge fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site_argssite = Somexs
Hi :
M.E.invokespec site_resultsite site_argssite xs s c_memc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w trace CallReturnvalues s′ m′ w′
He :
external_envspec site values fr_envc_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel = None
Hr′ :
rtcerased_step ERunfr0, ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 stack_exprEBad cs, ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
Hred :
reduciblestack_exprEBad cs ls_mem ≔ m′; ls_rt ≔ s′; ls_fuel ≔ fuel; ls_world ≔ w′
⊢
False

–exact bad_stuckregistry ge cs _ Hred

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had Hr Hs Hreg Hx Hi He
destruct c as fr cs m fuel
assert Hr′ : rtc@erased_stepnanofil_langregistry ge ERunfr0, mkLstatem0 s0 fuel0 w0 stack_exprEBad cs, mkLstatem′ s′ fuel w′
{eapply rtc_r ; exact Hr |
exact head_erasedregistry ge cs _ _ _ _ hs_call_badregistry ge fr m s fuel w site spec xs trace values s′ m′ w′ Hs Hreg Hx Hi He
destruct adequate_not_stuck_ _ _ _ Had _ _ _ eq_refl Hr′ ltac:left as v Hv | Hred
–change to_valstack_exprEBad cs = Somev in Hv
rewrite to_val_stack in Hv ; discriminate Hv | reflexivity
–exact bad_stuckregistry ge cs _ Hred

No external call of an Iris-reachable configuration is M.rejected: its frame proceeds, and it is at a failing step, so its call is admissible.

920Lemma reach_rejected
∀ φ c s w site why
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
M.rejectedworld registry ge c w site why
False
Explore proof 12 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → iris_reachc s w → external_sitege c site → M.rejectedworld registry ge c w site why → False

intros Had Hr Hs Hrej

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
⊢
False

destruct reach_proceedsφ c s w Had Hr as Hnf | site′ & Hs′ & Hadm

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hnf :
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w
⊢
False
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

–apply Hnf

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hnf :
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

unfold fails

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hnf :
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w
⊢
match stepge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w with
⇒
False
⇒
⇒
True
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

cbn [ conf_state ls_mem ls_fuel ]

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hnf :
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w
⊢
match stepge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ c_memc; c_fuel ≔ c_fuelc with
⇒
False
⇒
⇒
True
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

rewrite external_site_stuck_ _ _ external_site_framege c c_memc c_fuelc site Hs

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hnf :
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w
⊢
True
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

exact I

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
False

–assert site′ = site as →

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
⊢
site′ = site
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site
Hs′ :
⊢
False

{eapply external_site_uniquege ; | exact Hs′ | exact Hs

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
site′ :
Hs′ :
external_sitege c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w site′
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site′
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site
Hs′ :
⊢
False

reflexivity

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
Hs :
external_sitege c site
Hrej :
M.rejectedworld registry ge c w site why
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec s w; c_fuel ≔ ls_fuelconf_statec s w ls_worldconf_statec s w site
Hs′ :
⊢
False

destruct c as fr cs m fuel

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
fr :
cs :
listframe × pending
m :
fuel :
Z
s :
R.state
w :
world
site :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hr :
iris_reachc_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w
Hs :
external_sitege c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel site
Hrej :
M.rejectedworld registry ge c_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel w site why
Hadm :
M.admissibleregistry ge c_frame ≔ c_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w; c_fuel ≔ ls_fuelconf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w ls_worldconf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w site
Hs′ :
external_sitege c_frame ≔ c_framec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel; c_callers ≔ [ ]; c_mem ≔ ls_memconf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w; c_fuel ≔ ls_fuelconf_statec_frame ≔ fr; c_callers ≔ cs; c_mem ≔ m; c_fuel ≔ fuel s w site
⊢
False

exact M.admissible_not_rejectedworld registry ge mkConfigfr cs m fuel w site why Hadm Hrej

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had Hr Hs Hrej
destruct reach_proceedsφ c s w Had Hr as Hnf | site′ & Hs′ & Hadm
–apply Hnf
unfold fails
exact I
–assert site′ = site as →
{eapply external_site_uniquege ; | exact Hs′ | exact Hs
reflexivity
destruct c as fr cs m fuel
exact M.admissible_not_rejectedworld registry ge mkConfigfr cs m fuel w site why Hadm Hrej

What adequacy says of a labelled machine state: a running state is Iris-reachable; a stopped one stopped with no failure_ending, and a returning core ending satisfies φ in some state.

938Definition labelled_goodφ : outcome → lstateworld → Prop st : M.stateworld : Prop ≔
match st with
⇒
iris_reachfstms sndms w
M.Stoppedwhy _ _
⇒
¬failure_endingwhy ∧ ∀o, why = CoreEndo → returningo → ∃σ, φo σ

Every labelled step from an Iris-reachable running state reaches a labelled_good state: a core step is reach_step; an external return is reach_return; a core ending is reach_end; an exit is no failure, nor a resource ending (invoke_resource_refusal), nor a refusal; and a stuck core step, a rejected call and a bad return cannot happen.

951Lemma reach_labelled
∀ φ c s w trace st
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
M.stepregistry ge M.Runningc, s w trace st
Proof 30 steps Qed
intros Had Hr Hs
inversion Hs ; subst ; cbn [ labelled_good fst snd ]
–match goal withH : M.P.I.RM.mstep_ _ ?ms′ |- _⇒destruct ms′ as c′ s′ ; exact reach_stepφ c s w c' s' Had Hr labelled_core_step_ _ _ Hend
–match goal withHn : ∀site, ¬external_site_ _ site , E : Semantics.step_ _ = Done?o |- _⇒destruct reach_endφ c s w o Had Hr Hn E as Hf Hφend
split ; exact Hf |
intros o′ Ho
injection Ho as ←
exact Hφ
–exfalso
match goal withHn : ∀site, ¬external_site_ _ site , E : Semantics.step_ _ = Stuck_ |- _⇒exact reach_stuckφ c s w _ Had Hr Hn Eend
–split
+cbn
unfold refusal
tauto
+intros o Ho
injection Ho as ←
cbn
tauto
–eapply reach_return ; eassumption
–split ; cbn ; tauto | discriminate
–split
+match goal withHi : M.E.invoke_ _ _ _ _ _ _ _ CallResource_ _ _ _ |- _⇒exact invoke_resource_refusal_ _ _ _ _ _ _ _ _ _ _ _ Hiend
+intros o Ho
injection Ho as ←
cbn
tauto
–exfalso
eapply reach_rejected ; eassumption
–exfalso
eapply reach_bad ; eassumption

Adequacy for the labelled machine (ExternalMachine.v): where Iris adequacy holds for ERunfr0 from m0, s0, fuel0 and w0, every running state of a labelled run from there is Iris-reachable, and every stopped state stopped with no failure_ending; where it stopped with a returning core ending, a top-level return, its value satisfies φ in some state.

983Theorem adequate_labelled
∀ φ trace st
@adequatenanofil_langregistry ge NotStuck ERunfr0 mkLstatem0 s0 fuel0 w0 φ
M.runregistry ge M.RunningmkConfigfr0 [ ] m0 fuel0, s0 w0 trace st
∀c s w, st = M.Runningc, s w → iris_reachc s w ∧ ∀why ms w, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o, why = CoreEndo → returningo → ∃σ, φo σ
Explore proof 18 tactics

Initial goal

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ → ∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

intros Had

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

assert Hgen : ∀st1 trace st2, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
⊢
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

{intros st1 trace st2 H

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
st1 :
M.stateworld
trace :
listevent
st2 :
M.stateworld
H :
M.runregistry ge st1 trace st2
⊢
labelled_goodφ st1 → labelled_goodφ st2
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

induction H as st | st tr mid tail last Hs _ IH ; auto |

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
st :
M.stateworld
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge st tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
⊢
labelled_goodφ st → labelled_goodφ last
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

intros Hg

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
st :
M.stateworld
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge st tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

apply IH

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
st :
M.stateworld
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge st tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

destruct st as c s w | why ms w

3 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
s :
R.state
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Runningc, s w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
⊢
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

–exact reach_labelledφ c s w tr mid Had Hg Hs

2 open

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

–exfalso

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
False
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

eapply M.stopped_no_step

10 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
M.step?registry ?ge M.Stopped?why ?ms ?w ?trace ?st
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
Type
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
name → optioncontract?world
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
?world
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
listevent
shelved goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
why :
w :
world
tr :
listevent
mid :
M.stateworld
tail :
listevent
last :
M.stateworld
Hs :
M.stepregistry ge M.Stoppedwhy ms w tr mid
IH :
labelled_goodφ mid → labelled_goodφ last
Hg :
⊢
M.state?world

exact Hs

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
⊢
∀trace : listevent st : M.stateworld, M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st → ∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

intros trace st Hrun

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
⊢
∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

pose proof Hgen_ _ _ Hrun rtc_refl_ _ as Hg

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
Hg :
⊢
∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w ∧ ∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

split

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
Hg :
⊢
∀c : config s : R.state w : world, st = M.Runningc, s w → iris_reachc s w
focused goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
Hg :
⊢
∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

–intros c s w →

2 open

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
s :
R.state
w :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace M.Runningc, s w
⊢
deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
Hg :
⊢
∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

exact Hg

deferred goal
world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
st :
M.stateworld
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace st
Hg :
⊢
∀why : ending ms : M.P.I.RM.mstate w : world, st = M.Stoppedwhy ms w → ¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

–intros why ms w →

world :
Type
registry :
name → optioncontractworld
ge :
fr0 :
m0 :
s0 :
R.state
fuel0 :
Z
w0 :
world
φ :
valnanofil_langregistry ge → statenanofil_langregistry ge → Prop
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ s0; ls_fuel ≔ fuel0; ls_world ≔ w0 φ
Hgen :
∀st1 : M.stateworld trace : listevent st2 : M.stateworld, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
trace :
listevent
why :
w :
world
Hg :
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, s0 w0 trace M.Stoppedwhy ms w
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → ∃σ : statenanofil_langregistry ge, φo σ

exact Hg

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had
assert Hgen : ∀st1 trace st2, M.runregistry ge st1 trace st2 → labelled_goodφ st1 → labelled_goodφ st2
{intros st1 trace st2 H
induction H as st | st tr mid tail last Hs _ IH ; auto |
intros Hg
apply IH
destruct st as c s w | why ms w
–exact reach_labelledφ c s w tr mid Had Hg Hs
–exfalso
exact Hs
intros trace st Hrun
pose proof Hgen_ _ _ Hrun rtc_refl_ _ as Hg
split
–intros c s w →
exact Hg
–intros why ms w →
exact Hg

With no contracts no call is admissible: a frame proceeds only where it does not fail.

1007Lemma proceeds_closed
∀ ge fr σ
Explore proof 1 tactics

Initial goal

ge :
fr :
σ :
⊢
proceedsno_contracts ge fr σ → ¬failsge c_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ ls_memσ; c_fuel ≔ ls_fuelσ

intros H | site & _ & spec & xs & Hr & _ ; exact H | unfold no_contracts in Hr ; discriminate Hr

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros H | site & _ & spec & xs & Hr & _ ; exact H | unfold no_contracts in Hr ; discriminate Hr

Where Iris adequacy holds for ERunfr0 with no contracts, every core machine state the run reaches is Iris-reachable, and none fails.

1014Lemma adequate_no_fails
∀ ge fr0 m0 fuel0 φ st
@adequatenanofil_langno_contracts ge NotStuck ERunfr0 mkLstatem0 R.start fuel0 tt φ
RM.mreachablege mkConfigfr0 [ ] m0 fuel0, R.start st
¬failsge fstst
Explore proof 15 tactics

Initial goal

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
⊢
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ → ∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

intros Had

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

pose reach := λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 tt fstst sndst tt

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

assert Hgen : ∀st1 st2, RM.mreachablege st1 st2 → reachst1 → reachst2

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
⊢
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
focused goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

{intros st1 st2 H

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
st1, st2 :
H :
RM.mreachablege st1 st2
⊢
reachst1 → reachst2
deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

induction H as c s c′ s′ Hs | st1 | st1 st2 st3 _ IH1 _ IH2 ; auto

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
s :
R.state
c′ :
s′ :
R.state
Hs :
RM.mstepge c, s c′, s′
⊢
reachc, s → reachc′, s′
deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

unfold reach

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
s :
R.state
c′ :
s′ :
R.state
Hs :
RM.mstepge c, s c′, s′
⊢
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c, s.1 c, s.2 () → iris_reachno_contracts ge fr0 m0 R.start fuel0 () c′, s′.1 c′, s′.2 ()
deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

cbn

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
s :
R.state
c′ :
s′ :
R.state
Hs :
RM.mstepge c, s c′, s′
⊢
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c s () → iris_reachno_contracts ge fr0 m0 R.start fuel0 () c′ s′ ()
deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

intros Hr

2 open

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
s :
R.state
c′ :
s′ :
R.state
Hs :
RM.mstepge c, s c′, s′
Hr :
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c s ()
⊢
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c′ s′ ()
deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

exact reach_step_ _ _ _ _ _ _ φ c s tt c′ s′ Had Hr Hs

deferred goal
ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
⊢
∀st : RM.mstate, RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start st → ¬failsge st.1

intros c s Hreach

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
s :
R.state
Hreach :
RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start c, s
⊢
¬failsge c, s.1

pose proof Hgen_ _ Hreach rtc_refl_ _ as Hr

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
s :
R.state
Hreach :
RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start c, s
Hr :
reachc, s
⊢
¬failsge c, s.1

unfold reach in Hr

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
s :
R.state
Hreach :
RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start c, s
Hr :
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c, s.1 c, s.2 ()
⊢
¬failsge c, s.1

cbn [ fst snd ] in Hr |- *

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
s :
R.state
Hreach :
RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start c, s
Hr :
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c s ()
⊢
¬failsge c

apply reach_not_fails_ _ _ _ _ _ _ φ c s tt Had Hr

ge :
fr0 :
m0 :
fuel0 :
Z
φ :
Had :
adequateNotStuck ERunfr0 ls_mem ≔ m0; ls_rt ≔ R.start; ls_fuel ≔ fuel0; ls_world ≔ () φ
reach :=
λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 () st.1 st.2 () : RM.mstate → Prop
Hgen :
∀st1 st2 : RM.mstate, RM.mreachablege st1 st2 → reachst1 → reachst2
s :
R.state
Hreach :
RM.mreachablege c_frame ≔ fr0; c_callers ≔ [ ]; c_mem ≔ m0; c_fuel ≔ fuel0, R.start c, s
Hr :
iris_reachno_contracts ge fr0 m0 R.start fuel0 () c s ()
⊢
¬failsge c_frame ≔ c_framec; c_callers ≔ [ ]; c_mem ≔ c_memc; c_fuel ≔ c_fuelc

exact proceeds_closedge c_framec _ reach_proceeds_ _ _ _ _ _ _ φ c s tt Had Hr

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Had
pose reach := λst : RM.mstate ⇒ iris_reachno_contracts ge fr0 m0 R.start fuel0 tt fstst sndst tt
assert Hgen : ∀st1 st2, RM.mreachablege st1 st2 → reachst1 → reachst2
{intros st1 st2 H
induction H as c s c′ s′ Hs | st1 | st1 st2 st3 _ IH1 _ IH2 ; auto
unfold reach
cbn
intros Hr
exact reach_step_ _ _ _ _ _ _ φ c s tt c′ s′ Had Hr Hs
intros c s Hreach
pose proof Hgen_ _ Hreach rtc_refl_ _ as Hr
unfold reach in Hr
cbn [ fst snd ] in Hr |- *
apply reach_not_fails_ _ _ _ _ _ _ φ c s tt Had Hr
exact proceeds_closedge c_framec _ reach_proceeds_ _ _ _ _ _ _ φ c s tt Had Hr

Adequacy: Iris adequacy proves never_panics. Where the module's initial memory and entry function exist, every admissible input makes the entry's frame, and (where R is ready at its start in that memory) for every fuel and every invariant instance a state interpretation stateI can be allocated that holds of the initial state and gives a NotStuck weakest precondition of the entry's ERun, with no contracts, the module never panics. The later-credit flag hlc is left to the caller.

1038Theorem wp_never_panics
∀ hlc : has_lc Σ `{!invGpreSΣ} md entry input : listword → Prop globals m f
initial_memorymd = Someglobals, m
find_fnP.program_genvmd globals entry = SomeDefinedf
∀xs, inputxs → ∃fr, call_framef xs = Somefr ∧ R.readyR.start m → ∀fuel : Z Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateunit → iPropΣ, let _ : irisGS_genhlc nanofil_langno_contracts P.program_genvmd globals Σ ≔ IrisGHinv λσ _ _ _ ⇒ stateIσ λ_ ⇒ True%I λ_ ⇒ 0%nat λ_ _ _ _ ⇒ fupd_intro_ _ in stateImkLstatem R.start fuel tt ∗ WPNotStuck; ⊤ERunfr : language.exprnanofil_langno_contracts P.program_genvmd globals {_. True}
P.never_panicsmd entry input
Proof 21 steps Qed
intros Hm Hf Hwp
exists globals, m, f
split ; exact Hm |
split ; exact Hf |
intros xs Hxs
destruct Hwpxs Hxs as fr & Hfr & Hw
exists fr
split ; exact Hfr |
intros Hready fuel st Hreach
set ge := P.program_genvmd globals in *
assert Had : @adequatenanofil_langno_contracts ge NotStuck ERunfr mkLstatem R.start fuel tt λ_ _ ⇒ True
{apply wp_adequacy_genhlc Σ nanofil_langno_contracts ge NotStuck _ _ λ_ ⇒ True
intros Hinv κs
iMod HwHready fuel Hinv as stateI [Hσ Hwp]
iModIntro
iExists λσ _ ⇒ stateIσ, λ_ ⇒ True%I
cbn
iFrame Hσ
iApply wp_mono with Hwp
auto
exact adequate_no_failsge fr m fuel _ Had st Hreach

The labelled machine's safety for the frame fr, with the contracts of registry in the genv ge, from the memory m, the runtime state s, the world w and the fuel fuel: every labelled run from there that stops, stops with no failure_ending, and where it stops with a returning core ending, a top-level return, its value satisfies φ.

1071Definition labelled_safeworld : Type registry : name → optioncontractworld ge : genv fr : frame m : mem s : R.state w : world fuel : Z φ : outcome → Prop : Prop ≔
∀trace why ms w′, M.runregistry ge M.RunningmkConfigfr [ ] m fuel, s w trace M.Stoppedwhy ms w′ → ¬failure_endingwhy ∧ ∀o, why = CoreEndo → returningo → φo

Adequacy for the labelled machine: where, for every invariant instance, a state interpretation stateI can be allocated that holds of the initial state (the memory m, the runtime state s, the fuel, the world w) and gives a NotStuck weakest precondition of ERunfr with the postcondition φ, the run is labelled_safe. Where R must be ready in s and m, as for a ghost heap, that is the caller's premise for allocating stateI (heap_labelled_safe).

1084Theorem wp_labelled_safe
∀ hlc : has_lc Σ `{!invGpreSΣ} world : Type registry : name → optioncontractworld ge fr m s w : world fuel φ : outcome → Prop
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let _ : irisGS_genhlc nanofil_langregistry ge Σ ≔ IrisGHinv λσ _ _ _ ⇒ stateIσ λ_ ⇒ True%I λ_ ⇒ 0%nat λ_ _ _ _ ⇒ fupd_intro_ _ in stateImkLstatem s fuel w ∗ WPNotStuck; ⊤ERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
labelled_saferegistry ge fr m s w fuel φ
Explore proof 16 tactics

Initial goal

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
⊢
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝} → labelled_saferegistry ge fr m s w fuel φ

intros Hw trace why ms w′ Hrun

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

assert Had : @adequatenanofil_langregistry ge NotStuck ERunfr mkLstatem s fuel w λo _ ⇒ φo

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
⊢
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
focused goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

{apply wp_adequacy_genhlc Σ nanofil_langregistry ge NotStuck _ _ φ

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
⊢
∀Hinv : invGS_genhlc Σ κs : listobservationnanofil_langregistry ge, ⊢ |⇛⊤ ∃stateI : statenanofil_langregistry ge → listobservationnanofil_langregistry ge → iPropΣ fork_post : valnanofil_langregistry ge → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat κs0 : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ κs0; fork_post ≔ fork_post; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat κs0 : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ κs0 in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w κs ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

intros Hinv κs

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
⊢
⊢ |⇛⊤ ∃stateI : statenanofil_langregistry ge → listobservationnanofil_langregistry ge → iPropΣ fork_post : valnanofil_langregistry ge → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat κs0 : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ κs0; fork_post ≔ fork_post; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat κs0 : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ κs0 in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w κs ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

iMod HwHinv as stateI [Hσ Hwp]

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
stateI :
lstateworld → iPropΣ
Hσ :
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
Hwp :
WPERunfr {o. ⌜φo⌝}
∗
|⇛⊤ ∃stateI0 : statenanofil_langregistry ge → listobservationnanofil_langregistry ge → iPropΣ fork_post : valnanofil_langregistry ge → iPropΣ, stateI0ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w κs ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

iModIntro

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
stateI :
lstateworld → iPropΣ
Hσ :
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
Hwp :
WPERunfr {o. ⌜φo⌝}
∗
∃stateI0 : statenanofil_langregistry ge → listobservationnanofil_langregistry ge → iPropΣ fork_post : valnanofil_langregistry ge → iPropΣ, stateI0ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w κs ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

iExists λσ _ ⇒ stateIσ, λ_ ⇒ True%I

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
stateI :
lstateworld → iPropΣ
Hσ :
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
Hwp :
WPERunfr {o. ⌜φo⌝}
∗
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

cbn

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
stateI :
lstateworld → iPropΣ
Hσ :
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w
Hwp :
WPERunfr {o. ⌜φo⌝}
∗
stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

iFrame Hσ

2 open

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Hinv :
invGS_genhlc Σ
κs :
listobservationnanofil_langregistry ge
stateI :
lstateworld → iPropΣ
Hwp :
WPERunfr {o. ⌜φo⌝}
∗
WPERunfr {v. ⌜φv⌝}
deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

iExact Hwp

deferred goal
hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

destruct adequate_labelledregistry ge fr m s fuel w _ Had _ _ Hrun as _ H

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
H :
∀why0 : ending ms0 : M.P.I.RM.mstate w : world, M.Stoppedwhy ms w′ = M.Stoppedwhy0 ms0 w → ¬failure_endingwhy0 ∧ ∀o : outcome, why0 = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

destruct Hwhy ms w′ eq_refl as Hf Hφ

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
H :
∀why0 : ending ms0 : M.P.I.RM.mstate w : world, M.Stoppedwhy ms w′ = M.Stoppedwhy0 ms0 w → ¬failure_endingwhy0 ∧ ∀o : outcome, why0 = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Hφ :
∀o : outcome, why = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
⊢
¬failure_endingwhy ∧ ∀o : outcome, why = CoreEndo → returningo → φo

split ; exact Hf |

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
H :
∀why0 : ending ms0 : M.P.I.RM.mstate w : world, M.Stoppedwhy ms w′ = M.Stoppedwhy0 ms0 w → ¬failure_endingwhy0 ∧ ∀o : outcome, why0 = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Hφ :
∀o : outcome, why = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
⊢
∀o : outcome, why = CoreEndo → returningo → φo

intros o Ho Hr

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
H :
∀why0 : ending ms0 : M.P.I.RM.mstate w : world, M.Stoppedwhy ms w′ = M.Stoppedwhy0 ms0 w → ¬failure_endingwhy0 ∧ ∀o : outcome, why0 = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Hφ :
∀o : outcome, why = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Ho :
why = CoreEndo
⊢
φo

destruct Hφo Ho Hr as σ Hσ

hlc :
has_lc
Σ :
gFunctors
invGpreS0 :
invGpreSΣ
world :
Type
registry :
name → optioncontractworld
ge :
fr :
m :
s :
R.state
w :
world
fuel :
Z
φ :
outcome → Prop
Hw :
∀Hinv : invGS_genhlc Σ, ⊢ |⇛⊤ ∃stateI : lstateworld → iPropΣ, let H ≔ iris_invGS ≔ Hinv; state_interp ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ stateIσ; fork_post ≔ λ_ : valnanofil_langregistry ge ⇒ True; num_laters_per_step ≔ λ_ : nat ⇒ 0%nat; state_interp_mono ≔ λσ : statenanofil_langregistry ge _ : nat _ : listobservationnanofil_langregistry ge _ : nat ⇒ fupd_intro∅ stateIσ in stateIls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w ∗ WPERunfr : language.exprnanofil_langregistry ge {o. ⌜φo⌝}
trace :
listevent
why :
w′ :
world
Hrun :
M.runregistry ge M.Runningc_frame ≔ fr; c_callers ≔ [ ]; c_mem ≔ m; c_fuel ≔ fuel, s w trace M.Stoppedwhy ms w′
Had :
adequateNotStuck ERunfr ls_mem ≔ m; ls_rt ≔ s; ls_fuel ≔ fuel; ls_world ≔ w λo : valnanofil_langregistry ge _ : statenanofil_langregistry ge ⇒ φo
H :
∀why0 : ending ms0 : M.P.I.RM.mstate w : world, M.Stoppedwhy ms w′ = M.Stoppedwhy0 ms0 w → ¬failure_endingwhy0 ∧ ∀o : outcome, why0 = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Hφ :
∀o : outcome, why = CoreEndo → returningo → ∃_ : statenanofil_langregistry ge, φo
Ho :
why = CoreEndo
σ :
statenanofil_langregistry ge
Hσ :
φo
⊢
φo

exact Hσ

No remaining goals.

Qed

✓ Proof checked and closed by Rocq.

Source script
intros Hw trace why ms w′ Hrun
assert Had : @adequatenanofil_langregistry ge NotStuck ERunfr mkLstatem s fuel w λo _ ⇒ φo
{apply wp_adequacy_genhlc Σ nanofil_langregistry ge NotStuck _ _ φ
intros Hinv κs
iMod HwHinv as stateI [Hσ Hwp]
iModIntro
iExists λσ _ ⇒ stateIσ, λ_ ⇒ True%I
cbn
iFrame Hσ
iExact Hwp
destruct adequate_labelledregistry ge fr m s fuel w _ Had _ _ Hrun as _ H
destruct Hwhy ms w′ eq_refl as Hf Hφ
split ; exact Hf |
intros o Ho Hr
destruct Hφo Ho Hr as σ Hσ
exact Hσ