Weakestpre sem completeness
Iris.ProgramLogic.weakestpre_sem_completeness
Plain-language statement
adequate gives a WP with a pure postcondition from an adequate fact.
Exact Lean statement
theorem weakestpre_sem_completeness (e : Expr) (σ : State) (φ : Val → Prop)
(Hade : adequate .NotStuck e σ (fun v _ => φ v)) :
⊢ tpInvIni (TI := TI) -∗
ACG.heap_inv [e] σ -∗
wp ⊤ e (fun v => iprop% ⌜φ v⌝)Formal artifact
Lean source
theorem weakestpre_sem_completeness (e : Expr) (σ : State) (φ : Val → Prop) (Hade : adequate .NotStuck e σ (fun v _ => φ v)) : ⊢ tpInvIni (TI := TI) -∗ ACG.heap_inv [e] σ -∗ wp ⊤ e (fun v => iprop% ⌜φ v⌝) := by have Hsafe0 : cfgSafeForking ([e], σ) .doesFork := fun {C₂} hreach => ⟨fun {e2} hmem => Hade.adequate_not_stuck _ _ e2 rfl hreach hmem, fun hf => Forking.noConfusion hf⟩ iintro Hini Hheap iapply LWP.fupd_wp imod (tpInv_set [e]) $$ Hini with ⟨Hauth, Hfrags⟩ imod (CancelableInvariant.alloc ⊤ completenessN (cfgInv ([e], σ) .doesFork)) $$ [Hauth Hheap] with ⟨%γ, #Hinv, Hq⟩ · inext iexists ([e], σ) iframe Hheap Hauth %Hsafe0 ipureintro exact .refl have Hn0 : (completenessN : CoPset) ⊆ ⊤ := fun _ _ => CoPset.mem_full ihave He0 := BigSepL.bigSepL_singleton $$ Hfrags imodintro iapply LWP.wp_fupd ihave Hccfg : iprop(isCcfg ([e], σ) .doesFork γ) $$ [Hinv] · unfold isCcfg; itrivial ihave Hwp := weakestpre_completeness $$ Hccfg Hq He0 iapply LWP.wp_wand $$ Hwp iintro %v ⟨Hv, %q', Hq', _⟩ imod (CancelableInvariant.acc Hn0) $$ Hinv Hq' with ⟨>⟨%cfg, Hheap, Htpinv, %Hsafe2, %Hreach2⟩, Hq', Hclose2⟩ ihave %Hlu := tpInv_lookup $$ Htpinv Hv imod Hclose2 $$ [Hheap Htpinv] with - · inext iexists cfg iframe ∗ % imodintro ipureintro obtain ⟨tp2, σ2⟩ := cfg rcases tp2 with _ | ⟨hd, rest⟩ · simp at Hlu · simp only [List.getElem?_cons_zero, Option.some.injEq] at Hlu subst Hlu exact Hade.adequate_result rest σ2 v Hreach2- Project
- Iris-Lean
- License
- Apache-2.0
- Commit
- 37f53e0ac065
- Source
- Iris/Iris/ProgramLogic/AbstractLangCompleteness.lean:253-294
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Co Pset Raw eq
CoPset.coPsetRaw_eq
Plain-language statement
Two CoPsetRaw trees are equal if they have the same membership function and both are well-formed.
Source project: Iris-Lean
Person-level attribution pending.
Inj on of nodup map
FromMathlib.inj_on_of_nodup_map
Plain-language statement
NB. Copied from Mathlib
Source project: Iris-Lean
Person-level attribution pending.
Big Op L hom weak
Iris.Algebra.BigOpL.bigOpL_hom_weak
Plain-language statement
Weak monoid homomorphisms distribute over non-empty big ops.
Source project: Iris-Lean
Person-level attribution pending.