| fs = abs-files(files), n = n0, n1 = n0, 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 ∈ of, psynced → asynced ⊦ ∃ err. pre-seek(fd, n, whence, err, user, root, fs, ofh) ∧ ⟨err0 := err; if err0 = ESUCCESS then let fh = ofh[fd] in let f = fs[fh.fid] in {if whence = SEEK_CUR then n := fh.pos + n else if whence = SEEK_END then n := # f.content + n; ofh[fd].pos := n}⟩ (ofh = abs-of(of[fd, of[fd].pos:= n]) ∧ (psynced → asynced) ∧ n1 = n ∧ ESUCCESS = err0), whence = SEEK_END, whence = SEEK_CUR |
n = n0, ofh = abs-of(of), whence ≠ SEEK_CUR, whence ≠ SEEK_END, 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 ∈ of, psynced → asynced ⊦ ∃ err. pre-seek(fd, n, whence, err, user, root, abs-files(files), ofh) ∧ ⟨err0 := err; if err0 = ESUCCESS then let fh = ofh[fd] in let f = abs-files(files)[fh.fid] in {if whence = SEEK_CUR then n := fh.pos + n else if whence = SEEK_END then n := # f.content + n; ofh[fd] := mkfh(ofh[fd].fid, ofh[fd].mode, n)}⟩ (ofh = abs-of(of[fd, of[fd].pos:= n]) ∧ (psynced → asynced) ∧ n0 = n ∧ ESUCCESS = err0)
Used simplifier rules: ⊦ fh.pos:= m = mkfh(fh.fid, fh.mode, m); (s)