| buf = mkbuf(VFS_PAGE_SIZE), buf0 = buf1, err = ESUCCESS, ino = (ino2 + ino0) % VFS_PAGE_SIZE, ino0 = n6, ino1 = n5 + n0 + n6, ino2 = n0, inode = mkinode(m, md, boolvar, m0, m1, m2), ¬ isdir, n = min(ino1 - ino2 + ino0, VFS_PAGE_SIZE - ino, inode.size - ino2 + ino0), n1 = n5 + n0 + n6, pageno = (ino2 + ino0) / VFS_PAGE_SIZE, afs-cons(dirs, files), m ∈ files, n0 + n6 ≤ m2, n6 ≤ # buf1, n5 + n6 ≤ # buf1, inode.size ≥ ino2 + ino0, VFS_PAGE_SIZE ≥ ino, ino1 ≥ ino2 + ino0, ∀ n2, n3, n4, err, inode, m, md, boolvar, m0, m1, m2, isdir, dirs, files, buf, asynced. n2 - n3 + n4 < n5 → err = ESUCCESS ∧ inode = mkinode(m, md, boolvar, m0, m1, m2) ∧ ¬ isdir ∧ afs-cons(dirs, files) ∧ m ∈ files ∧ n4 ≤ # buf ∧ n3 + n4 ≤ m2 ∧ n3 + n4 ≤ n2 ∧ n2 ≤ # buf + n3 → ⟪vfs_read_block#(n3, n2, inode, dirs, files, asynced; buf, n4, isdir, err); while err = ESUCCESS ∧ ¬ isdir do vfs_read_block#(n3, n2, inode, dirs, files, asynced; buf, n4, isdir, err)⟫ true ⊦ ⟪afs_readpage#(inode, pageno, dirs, files, asynced; buf, err); if err = ESUCCESS then {buf0 := copy(buf, ino, buf0, ino0, n); ino0 := ino0 + n}; inode := mkinode(m, md, boolvar, m0, m1, m2); n6 := ino0, buf1 := buf0; while err = ESUCCESS ∧ ¬ isdir do vfs_read_block#(n0, n1, inode, dirs, files, asynced; buf1, n6, isdir, err)⟫ true, VFS_PAGE_SIZE = 0, n = 0 |
buf = mkbuf(VFS_PAGE_SIZE), err = ESUCCESS, VFS_PAGE_SIZE - (n0 + n6) % VFS_PAGE_SIZE ≠ 0, m2 ≠ n0 + n6, n5 ≠ 0, n0 + n6 < m2, afs-cons(dirs, files), m ∈ files, n6 ≤ # buf1, n5 + n6 ≤ # buf1, ∀ n2, n3, n4, err, inode, m, md, boolvar, m0, m1, m2, isdir, dirs, files, buf, asynced. n2 - n3 + n4 < n5 → err = ESUCCESS ∧ inode = mkinode(m, md, boolvar, m0, m1, m2) ∧ ¬ isdir ∧ afs-cons(dirs, files) ∧ m ∈ files ∧ n4 ≤ # buf ∧ n3 + n4 ≤ m2 ∧ n3 + n4 ≤ n2 ∧ n2 ≤ # buf + n3 → ⟪vfs_read_block#(n3, n2, inode, dirs, files, asynced; buf, n4, isdir, err); while err = ESUCCESS ∧ ¬ isdir do vfs_read_block#(n3, n2, inode, dirs, files, asynced; buf, n4, isdir, err)⟫ true ⊦ ⟪afs_readpage#(mkinode(m, md, boolvar, m0, m1, m2), (n0 + n6) / VFS_PAGE_SIZE, dirs, files, asynced; buf, err); n := min(n5 + n0 + n6 - n0 + n6, VFS_PAGE_SIZE - (n0 + n6) % VFS_PAGE_SIZE, m2 - n0 + n6); ino0 := n6; buf0 := buf1; if err = ESUCCESS then {buf0 := copy(buf, (n0 + n6) % VFS_PAGE_SIZE, buf0, ino0, n); ino0 := ino0 + n}; inode := mkinode(m, md, boolvar, m0, m1, m2); n := ino0, buf1 := buf0; n1 := n5 + n0 + n6; isdir := false; while err = ESUCCESS ∧ ¬ isdir do vfs_read_block#(n0, n1, inode, dirs, files, asynced; buf1, n, isdir, err)⟫ true
Used simplifier rules: ⊦ m < n → n ≠ 0; (s)%f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic% ⊦ m < n → m ≤ n; (s)% ⊦ m ≠ n → (m ≤ n ↔ m < n); (s)%n ≠ 0 ⊦ m % n ≤ n; (s)% ⊦ m ≤ m + n; (s)% ⊦ m + n ≤ m + n0 ↔ n ≤ n0; (s)% ⊦ n ≥ m ↔ m ≤ n; (s)% ⊦ VFS_PAGE_SIZE ≠ 0; (s)% ⊦ m ≤ n → (n - m = 0 ↔ n = m); (s)% ⊦ min(n0, n1, n2) = 0 ↔ n0 = 0 ∨ n1 = 0 ∨ n2 = 0; (ws)% ⊦ mkinode(m, md, boolvar, m0, m1, m2).size = m2; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m + n - m = n; (s)% ⊦ m + n - n + n1 = m - n1; (s)