| asynced ↔ bv, VFS_PAGE_SIZE = n7 + (n0 + n6) % VFS_PAGE_SIZE, files[m] = mkfile(m1, md0, # links(m, dirs), content), err = err0, err = ESUCCESS, err1 = ESUCCESS, afs-cons(dirs, files), (n0 + n6) / VFS_PAGE_SIZE ∈ files[m].content, m ∈ files, (n0 + n6) / VFS_PAGE_SIZE ∈ content, n6 + min(n5 + n0 + n6 - n0 + n6, n7) ≤ # buf1, (n0 + n6) % VFS_PAGE_SIZE + min(n5 + n0 + n6 - n0 + n6, n7) ≤ # files[m].content[(n0 + n6) / VFS_PAGE_SIZE], n5 + n6 ≤ # buf1, n6 ≤ # buf1, n5 + n0 + n6 ≥ n0 + n6, ⌊err0⌋ ∨ err0 = ESUCCESS, ∀ n2, n3, n4, files, m, m1, md0, dirs, content, inode, md, m2, isdir, buf, err, asynced. n2 - n3 + n4 < n5 → files[m] = mkfile(m1, md0, # links(m, dirs), content) ∧ inode = mkinode(m, md, false, # links(m, dirs), 0, m2) ∧ ¬ isdir ∧ afs-cons(dirs, files) ∧ m ∈ files ∧ n4 ≤ # buf ∧ n3 + n4 ≤ n2 ∧ n2 ≤ # buf + n3 → ⟪while err = ESUCCESS ∧ ¬ isdir do vfs_write_block#(n3, inode, buf, n2, dirs; n4, isdir, err, files, asynced)⟫ (m ∈ files ∧ # links(m, dirs) = files[m].nlink) ⊦ ⟪afs_writepage# (mkinode(m, md, false, # links(m, dirs), 0, m2), (n0 + n6) / VFS_PAGE_SIZE, copy(buf1, n6, files[m].content[(n0 + n6) / VFS_PAGE_SIZE], (n0 + n6) % VFS_PAGE_SIZE, min(n5 + n0 + n6 - n0 + n6, n7)), dirs ; err, files ; asynced); n := min(n5 + n0 + n6 - n0 + n6, n7); ino0 := n6; if err = ESUCCESS then ino0 := ino0 + n; inode := mkinode(m, md, false, # links(m, dirs), 0, m2); n := ino0; n1 := n5 + n0 + n6; isdir := false; while err = ESUCCESS ∧ ¬ isdir do vfs_write_block#(n0, inode, buf1, n1, dirs; n, isdir, err, files, asynced)⟫ (m ∈ files ∧ # links(m, dirs) = files[m].nlink), VFS_PAGE_SIZE = 0, min(n5, n7) = 0 |
VFS_PAGE_SIZE = n7 + (n0 + n6) % VFS_PAGE_SIZE, files[m] = mkfile(m1, md0, # links(m, dirs), content), err = ESUCCESS, min(n5, n7) ≠ 0, afs-cons(dirs, files), m ∈ files, (n0 + n6) / VFS_PAGE_SIZE ∈ content, n6 + min(n5, n7) ≤ # buf1, (n0 + n6) % VFS_PAGE_SIZE + min(n5, n7) ≤ VFS_PAGE_SIZE, n5 + n6 ≤ # buf1, n6 ≤ # buf1, ∀ n2, n3, n4, files, m, m1, md0, dirs, content, inode, md, m2, isdir, buf, err, asynced. n2 - n3 + n4 < n5 → files[m] = mkfile(m1, md0, # links(m, dirs), content) ∧ inode = mkinode(m, md, false, # links(m, dirs), 0, m2) ∧ ¬ isdir ∧ afs-cons(dirs, files) ∧ m ∈ files ∧ n4 ≤ # buf ∧ n3 + n4 ≤ n2 ∧ n2 ≤ # buf + n3 → ⟪while err = ESUCCESS ∧ ¬ isdir do vfs_write_block#(n3, inode, buf, n2, dirs; n4, isdir, err, files, asynced)⟫ (m ∈ files ∧ # links(m, dirs) = files[m].nlink) ⊦ ⟪afs_writepage# (mkinode(m, md, false, # links(m, dirs), 0, m2), (n0 + n6) / VFS_PAGE_SIZE, copy(buf1, n6, content[(n0 + n6) / VFS_PAGE_SIZE], (n0 + n6) % VFS_PAGE_SIZE, min(n5 + n0 + n6 - n0 + n6, n7)), dirs ; err, files ; asynced); n := min(n5 + n0 + n6 - n0 + n6, n7); ino0 := n6; if err = ESUCCESS then ino0 := ino0 + n; inode := mkinode(m, md, false, # links(m, dirs), 0, m2); n := ino0; n1 := n5 + n0 + n6; isdir := false; while err = ESUCCESS ∧ ¬ isdir do vfs_write_block#(n0, inode, buf1, n1, dirs; n, isdir, err, files, asynced)⟫ (m ∈ files ∧ # links(m, dirs) = files[m].nlink)
Used simplifier rules: ⊦ afs-cons(dirs, files) ∧ ino ∈ files ∧ files[ino] = mkfile(m, md, n0, content) ∧ n ∈ content → # content[n] = VFS_PAGE_SIZE; (s)% ⊦ mkfile(m, md, m0, content).content = content; (s)% ⊦ ¬ ⌊ESUCCESS⌋ ; (s)% ⊦ m + n - m = n; (s)% ⊦ m + n - n + n1 = m - n1; (s)%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m ≤ m + n; (s)% ⊦ m + n ≤ m + n0 ↔ n ≤ n0; (s)% ⊦ n ≥ m ↔ m ≤ n; (s)% ⊦ VFS_PAGE_SIZE ≠ 0; (s)