NLA-lib Explorer

NLAlib.Ops.wp_alloc

Library · theorem

Scratch buffer: the body runs with the new buffer on top, which is then popped.

NLAlib.Ops.wp_alloc {Op Tst K : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  {ρ : Ops.Env} {Q : Ops.Mem K → Prop} {m : Ops.Mem K} {format : Ops.StorageFormat} {len : Ops.IExp}
  {body : Ops.Stmt Op Tst} {n : ℕ} (hn : Ops.IExp.eval ρ.idx len = some n)
  (h :
    Ops.Wp md I τ body (ρ.pushBuf (List.length m.store))
      (fun m' ↦ Q { store := m'.store.pop, pos := m'.pos })
      { store := m.store.push n, pos := m.pos }) :
  Ops.Wp md I τ (Ops.Stmt.allocAs format len body) ρ Q m

Full source on GitHub

Import NLAlib.Ops.Logic.