| n0 + n = m0 * VFS_PAGE_SIZE + n2, files1 -- ino = files0 -- ino, content0.stream = (content.stream to n0) + (⌜buf⌝ to n) + (content.stream from n0 + n), files1[ino] = mkfile(m2, md0, # links(ino, dirs), content0), files0[ino] = mkfile(m2, md0, m4, content), n2 < VFS_PAGE_SIZE, afs-cons(dirs, files1), ino ∈ files1, ino ∈ files0, n ≤ # buf, n1 ≤ # buf + n0, n0 + n ≤ n1, m + n2 ≤ VFS_PAGE_SIZE, n + m ≤ # buf ⊦ content0[m0, copy(buf, n, getpage(m0, content0), n2, m)].stream = (content.stream to n0) + (⌜buf⌝ to n + m) + (content.stream from n0 + n + m) |
⊦ # buf = VFS_PAGE_SIZE → content[n, buf].stream = (content.stream to n * VFS_PAGE_SIZE) + ⌜buf⌝ + (content.stream from (n + 1) * VFS_PAGE_SIZE)
# copy(buf, n, getpage(m0, content0), n2, m) = VFS_PAGE_SIZE, n0 + n = m0 * VFS_PAGE_SIZE + n2, files1 -- ino = files0 -- ino, content0.stream = (content.stream to n0) + (⌜buf⌝ to n) + (content.stream from n0 + n), files0[ino] = mkfile(m2, md0, m4, content), files1[ino] = mkfile(m2, md0, # links(ino, dirs), content0), n2 < VFS_PAGE_SIZE, afs-cons(dirs, files1), ino ∈ files0, ino ∈ files1, n + m ≤ # buf, m + n2 ≤ VFS_PAGE_SIZE, n0 + n ≤ n1, n1 ≤ # buf + n0, n ≤ # buf ⊦ (content0.stream to m0 * VFS_PAGE_SIZE) + ⌜copy(buf, n, getpage(m0, content0), n2, m)⌝ + (content0.stream from (m0 + 1) * VFS_PAGE_SIZE) = (content.stream to n0) + (⌜buf⌝ to n + m) + (content.stream from n0 + n + m)
Used simplifier rules: ⊦ # copy(buf, m, buf0, m0, n) = # buf0; (s)%⊦ afs-cons(dirs, files) ∧ ino ∈ files ∧ files[ino] = mkfile(m, md, m0, content) → # getpage(n, content) = VFS_PAGE_SIZE; (s) Used terms: copy(buf, n, getpage(m0, content0), n2, m), m0, content0