| n = 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 ⊦ ⟨posix_seek#(fd, whence, user, root, abs-files(files); n0, err0, ofh)⟩ (ofh = abs-of(of) ∧ (psynced → asynced) ∧ n = n0 ∧ EBADFD = err0) |
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), psynced → asynced ⊦ ⟨choose err with pre-seek(fd, n, whence, err, user, root, fs, ofh) in 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) ∧ (psynced → asynced) ∧ n1 = n ∧ EBADFD = err0), fd ∈ of
Used simplifier rules: posix_seek#(FD, WHENCE, USER, ROOT, FS; N, ERR, OFH) {choose E with pre-seek(FD, N, WHENCE, E, USER, ROOT, FS, OFH) in ERR := E; if ERR = ESUCCESS then let FH = OFH[FD] in let FDATA = FS[FH.fid] in {if WHENCE = SEEK_CUR then N := FH.pos + N else if WHENCE = SEEK_END then N := # FDATA.content + N; OFH[FD].pos := N} };