| # 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) |
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.stream to m0 * VFS_PAGE_SIZE) + ⌜copy(buf, n, getpage(m0, content0), n2, m)⌝ + (content0.stream from VFS_PAGE_SIZE * m0 + VFS_PAGE_SIZE) = (content.stream to n0) + (⌜buf⌝ to n + m) + (content.stream from n0 + n + m)
Used simplifier rules: append-assoc: ⊦ (σ0 + σ3) + σ4 = σ0 + σ3 + σ4; from specification stream[buffer-inf]%mult-c: ⊦ m * n = n * m; from specification nat-mult%mult-a: ⊦ m0 * m * n = (m0 * m) * n; from specification nat-mult%c: ⊦ m + n = n + m; from specification nat-basic%a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic% ⊦ m * (n + 1) = m * n + m; (s)%⊦ afs-cons(dirs, files) ∧ ino ∈ files ∧ files[ino] = mkfile(m, md, m0, content) → # getpage(n, content) = VFS_PAGE_SIZE; (s)% ⊦ # copy(buf, m, buf0, m0, n) = # buf0; (s)