| of0[fd] = mkfile(m, mode, m0), files[m] = mkfile(m1, md, m2, content), fs = abs-files(files), ofh = abs-of(of0), root.dir?, dom of0 < ino0, abs(root, ROOT_INO)(dirs), afs-cons(dirs, files), fids-cons(root, abs-files(files), abs-of(of0)), is-open(m, of0 -- fd), of-cons(of0, dirs, files), of-cons(of0 -- fd, dirs, files), fd ∈ of0, psynced → asynced ⊦ ⟨choose err with pre-close(fd, err, user, root, fs, ofh) in err0 := err; if err0 = ESUCCESS then let fid = ofh[fd].fid in {ofh := ofh -- fd; if ¬ fid ∈ ofh.fids ∧ ¬ fid ∈ root.fids then fs := fs -- fid}⟩ (ofh = abs-of(of0 -- fd) ∧ fs = abs-files(files) ∧ (psynced → asynced) ∧ ESUCCESS = err0) |
files[m] = mkfile(m1, md, m2, content), of0[fd] = mkfile(m, mode, m0), fs = abs-files(files), ofh = abs-of(of0), root.dir?, dom of0 < ino0, abs(root, ROOT_INO)(dirs), afs-cons(dirs, files), fids-cons(root, abs-files(files), abs-of(of0)), is-open(m, of0 -- fd), of-cons(of0 -- fd, dirs, files), of-cons(of0, dirs, files), fd ∈ of0, psynced → asynced ⊦ ∃ err. pre-close(fd, err, user, root, fs, ofh) ∧ ⟨err0 := err; if err0 = ESUCCESS then let fid = ofh[fd].fid in {ofh := ofh -- fd; if ¬ fid ∈ ofh.fids ∧ ¬ fid ∈ root.fids then fs := fs -- fid}⟩ (ofh = abs-of(of0 -- fd) ∧ fs = abs-files(files) ∧ (psynced → asynced) ∧ ESUCCESS = err0)