| asynced0 ↔ asynced5, ((cache_files ⊕ cache_pcache) ⊕ cache_icache)[m] = mkfile(m0, md0, # links(m, cache_dirs), content), cache_files[m] = mkfile(m1, md2, # links(m, cache_dirs), content1), afs_files = (cache_files ⊕ cache_pcache) ⊕ cache_icache, buf-opt = none, dirs = cache_dirs, files = afs_files, inode = mkinode(m, md, false, # links(m, cache_dirs), 0, m2), old_ino = 0, pageno = m2 / VFS_PAGE_SIZE, size = 0, afs-cons(cache_dirs, (cache_files ⊕ cache_pcache) ⊕ cache_icache), afs-cons(cache_dirs, cache_files), dcache-cons(cache_dcache, cache_dirs, cache_files), icache-cons(cache_icache, cache_dirs, cache_files), pcache-cons(cache_pcache, cache_dirs, cache_files), synced(cache_dirs, cache_icache, cache_pcache), m ∈ cache_files, ⌊err0⌋ , cache_sync → synced(cache_files, cache_icache, cache_pcache) ⊦ ⟨fail#(; ; err); asynced := ?⟩ ( dirs = cache_dirs ∧ files = (cache_files ⊕ cache_pcache) ⊕ cache_icache ∧ (asynced ↔ asynced2) ∧ none = buf-opt ∧ mkinode(m, md, false, # links(m, cache_dirs), 0, m2) = inode ∧ (asynced5 ↔ asynced0) ∧ err0 = err), ⟨let ino = inode.ino, content = files[inode.ino].content, buf = ? in {old_ino := inode.size % VFS_PAGE_SIZE, size := min(n, inode.size); asynced0 := inode.size ≤ n ∧ old_ino ≠ 0 ∧ (pageno ∈ content ∨ buf-opt.some?); if asynced0 then {if buf-opt.some? then buf := buf-opt.buf else buf := files[ino].content[pageno]; buf := fill(buf, zero, old_ino, VFS_PAGE_SIZE - old_ino); content[pageno] := buf; buf-opt := some(buf)}; files[ino].content := content upto size; let new_inode = inode in {new_inode.size := n; afs_inode_sync#(new_inode; dirs, files)}; inode := getinode(inode.ino, dirs, files); err := ESUCCESS}; asynced := ?⟩ ( dirs = cache_dirs ∧ files = (cache_files ⊕ cache_pcache) ⊕ cache_icache ∧ (asynced ↔ asynced2) ∧ none = buf-opt ∧ mkinode(m, md, false, # links(m, cache_dirs), 0, m2) = inode ∧ (asynced5 ↔ asynced0) ∧ err0 = err), VFS_PAGE_SIZE = 0, datakey(m, m2 / VFS_PAGE_SIZE) ∈ cache_pcache |
cache_files[m] = mkfile(m1, md2, # links(m, cache_dirs), content1), ((cache_files ⊕ cache_pcache) ⊕ cache_icache)[m] = mkfile(m0, md0, # links(m, cache_dirs), content), afs-cons(cache_dirs, cache_files), afs-cons(cache_dirs, (cache_files ⊕ cache_pcache) ⊕ cache_icache), dcache-cons(cache_dcache, cache_dirs, cache_files), icache-cons(cache_icache, cache_dirs, cache_files), pcache-cons(cache_pcache, cache_dirs, cache_files), synced(cache_dirs, cache_icache, cache_pcache), m ∈ cache_files, ⌊err0⌋ , ¬ datakey(m, m2 / VFS_PAGE_SIZE) ∈ cache_pcache, cache_sync → synced(cache_files, cache_icache, cache_pcache) ⊦ ⟨fail#(; ; err); asynced := ?⟩ ((asynced ↔ asynced2) ∧ err0 = err), ⟨let ino = m, content = ((cache_files ⊕ cache_pcache) ⊕ cache_icache)[m].content, buf = ? in {old_ino := m2 % VFS_PAGE_SIZE, size := min(n, m2); asynced0 := m2 ≤ n ∧ old_ino ≠ 0 ∧ m2 / VFS_PAGE_SIZE ∈ content; buf-opt := none; afs_files := (cache_files ⊕ cache_pcache) ⊕ cache_icache; if asynced0 then {pageno := m2 / VFS_PAGE_SIZE; if buf-opt.some? then buf := buf-opt.buf else buf := afs_files[ino].content[pageno]; buf := fill(buf, zero, old_ino, VFS_PAGE_SIZE - old_ino); content[pageno] := buf; buf-opt := some(buf)}; afs_files[ino].content := content upto size; let new_inode = mkinode(m, md, false, # links(m, cache_dirs), 0, m2) in {new_inode.size := n; cache_dirs0 := cache_dirs; afs_inode_sync#(new_inode; cache_dirs, afs_files)}; inode := (m ∈ cache_dirs ⊃ mkinode(m, cache_dirs[m].meta, true, cache_dirs[m].nlink, cache_dirs[m].nsubdirs, cache_dirs[m].size) ;mkinode(m, afs_files[m].meta, false, afs_files[m].nlink, 0, afs_files[m].size) ); err := ESUCCESS}; asynced := ?⟩ ( cache_dirs = cache_dirs0 ∧ afs_files = (cache_files ⊕ cache_pcache) ⊕ cache_icache ∧ (asynced ↔ asynced2) ∧ none = buf-opt ∧ mkinode(m, md, false, # links(m, cache_dirs0), 0, m2) = inode ∧ (asynced5 ↔ asynced0) ∧ err0 = err)
Used simplifier rules: ⊦ getinode(ino, dirs, files) = (ino ∈ dirs ⊃ mkinode (ino, dirs[ino].meta, true, dirs[ino].nlink, dirs[ino].nsubdirs, dirs[ino].size) ;mkinode (ino, files[ino].meta, false, files[ino].nlink, 0, files[ino].size) ); (s)% ⊦ ¬ none.some?; (s)% ⊦ mkinode(m, md, boolvar, m0, m1, m2).size = m2; (s)% ⊦ mkinode(m, md, boolvar, m0, m1, m2).ino = m; (s)% ⊦ VFS_PAGE_SIZE ≠ 0; (s)