| files0 -- m2 = files -- m2, (content.stream to m).buf = splice(buf, 0, (content0.stream to m1).buf, m3, n1), files[m2] = mkfile(m1, md, # links(m2, dirs), content0), files0[m2] = mkfile(m, md, m0, content), of[fd] = mkfile(m2, mode, m3), err0 = ESUCCESS, f = fs[fh.fid], fh = ofh[fd], fs = abs-files(files), ofh = abs-of(of), root.dir?, dom of < ino, abs(root, ROOT_INO)(dirs), afs-cons(dirs, files), fids-cons(root, abs-files(files), abs-of(of)), of-cons(of, dirs, files), fd ∈ ofh, m2 ∈ files0, m2 ∈ files, fd ∈ of, fh.fid ∈ fs, n1 ≤ n0, n0 ≤ # buf, n1 ≤ # buf, psynced → asynced, mode = MODE_W ∨ mode = MODE_RW ⊦ ∃ n. n ≤ n0 ∧ ⟨n0 := n; f.content := splice(buf, 0, f.content, fh.pos, n0); fs[fh.fid] := f; ofh[fd].pos := fh.pos + n0; psynced := ?⟩ (ofh = abs-of(of[fd, of[fd].pos:= (m3 + n0)]) ∧ fs = abs-files(files0) ∧ (psynced → asynced0) ∧ n1 = n0 ∧ ESUCCESS = err0) |
files0 -- m2 = files -- m2, (content.stream to m).buf = splice(buf, 0, (content0.stream to m1).buf, m3, n1), files[m2] = mkfile(m1, md, # links(m2, dirs), content0), files0[m2] = mkfile(m, md, m0, content), of[fd] = mkfile(m2, mode, m3), root.dir?, dom of < ino, abs(root, ROOT_INO)(dirs), afs-cons(dirs, files), fids-cons(root, abs-files(files), abs-of(of)), of-cons(of, dirs, files), m2 ∈ files0, fd ∈ of, m2 ∈ files, n1 ≤ n0, n0 ≤ # buf, n1 ≤ # buf, psynced → asynced, mode = MODE_W ∨ mode = MODE_RW ⊦ ∃ n. n ≤ n0 ∧ ⟨n0 := n; f := mkfile(abs-files(files)[abs-of(of)[fd].fid].meta, splice(buf, 0, abs-files(files)[abs-of(of)[fd].fid].content, abs-of(of)[fd].pos, n0)); fs := abs-files(files)[abs-of(of)[fd].fid, f]; ofh := abs-of(of)[fd, mkfh(abs-of(of)[fd].fid, abs-of(of)[fd].mode, abs-of(of)[fd].pos + n0)]; psynced := ?⟩ (ofh = abs-of(of[fd, of[fd].pos:= (m3 + n0)]) ∧ fs = abs-files(files0) ∧ (psynced → asynced0) ∧ n1 = n0)
Used simplifier rules: ⊦ mkfile(m, mode, m0).ino = m; (s)% ⊦ fh.pos:= m = mkfh(fh.fid, fh.mode, m); (s)% ⊦ f.content:= buf = mkfile(f.meta, buf); (s)% ⊦ fd ∈ abs-of(of) ↔ fd ∈ of; (s)% ⊦ ⌜ino⌝ ∈ abs-files(files) ↔ ino ∈ files; (s)% ⊦ mkfh(fid, mode, m).fid = fid; (s)%fd ∈ of ⊦ abs-of(of)[fd] = mkfh(⌜of[fd].ino⌝ , of[fd].mode, of[fd].pos); (s)