| # lpt = # avol, bleb ≠ nobuffer, awbuf-inv(avol, bleb), synced(avol0), avol0 ↓ avol, # avol[bleb.leb].data + n ≤ LEB_SIZE, n ≤ # buf ⊦ ⟨awbuf_write_buf#(n, buf, adr0, m0, nx0, lpt, ns0, bleb; avol, isbuf; err)⟩ (avol0 ↓ avol) |
# lpt = # avol, adr = adr0, n0 = n, ns = ns0, nx = nx0, awbuf-inv(avol, bleb), synced(avol0), avol0 ↓ avol, n ≤ # buf, # avol[bleb.leb].data + n ≤ LEB_SIZE ⊦ ⟨if bleb ≠ nobuffer ∧ # avol[bleb.leb].data + n0 ≤ LEB_SIZE ∧ n0 ≤ # buf then if isbuf then err := EROFS else {fail_or_success#(; ; err); let m = bleb.leb in if err = ESUCCESS then avol[m] := mapped(avol[m].data + subarray(buf, 0, n0)) else { choose n with n ≠ 0 ∧ n < n0 ∧ is-aligned(# avol[m].data + n, EB_PAGE_SIZE) in avol[m] := mapped(avol[m].data + subarray(buf, 0, n)) ifnone skip or skip; isbuf := true}} else abort⟩ (avol0 ↓ avol), bleb = nobuffer
Used simplifier rules: write-buf: ⊦ ;