{"id":15168716,"url":"https://github.com/pkutcs-cbs/cbs-verification","last_synced_at":"2026-01-31T14:04:38.203Z","repository":{"id":166450504,"uuid":"611724249","full_name":"PKUTCS-CBS/CBS-Verification","owner":"PKUTCS-CBS","description":"A verification tool developed in Coq for analyzing cloud block storage","archived":false,"fork":false,"pushed_at":"2023-05-17T13:46:21.000Z","size":3683,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T09:41:30.252Z","etag":null,"topics":["cloud-block-store","coq","formal-verification","separation-logic","theorem-proving"],"latest_commit_sha":null,"homepage":"","language":"Coq","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PKUTCS-CBS.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T12:17:43.000Z","updated_at":"2023-03-09T12:29:00.000Z","dependencies_parsed_at":"2023-10-02T20:10:18.197Z","dependency_job_id":null,"html_url":"https://github.com/PKUTCS-CBS/CBS-Verification","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"023f1dd53f39dff238c8bf68b9e88c573377aedb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKUTCS-CBS%2FCBS-Verification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKUTCS-CBS%2FCBS-Verification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKUTCS-CBS%2FCBS-Verification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKUTCS-CBS%2FCBS-Verification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PKUTCS-CBS","download_url":"https://codeload.github.com/PKUTCS-CBS/CBS-Verification/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819353,"owners_count":21166474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-block-store","coq","formal-verification","separation-logic","theorem-proving"],"created_at":"2024-09-27T06:40:58.477Z","updated_at":"2026-01-31T14:04:38.176Z","avatar_url":"https://github.com/PKUTCS-CBS.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Formal Verification of Cloud Block Storage in Coq\n\nTo rigorously discuss the reliability of cloud block storage (CBS), we develop a proof system and implement a verification tool for reasoning about the correctness of CBS data operations. The proof system has separation logic features, and the tool simplifies derivation while retaining mathematical rigor.\n\nThis proof system consists of the modeling language, heap predicates, triples, and reasoning rules. The modeling language represents CBS state and data operations, and the heap predicates describe the properties of a given CBS state. Besides, the triples specify the correct behavior of a program, and the reasoning rules supports verifying those triples.\n\nWe implement this proof system as a verification tool in Coq. Our tool can encode actual operations intuitively and verify specifications efficiently. The notations and type conversions in our tool improve the readability of the representation code. The automated proof scripts simplify the verifying process and skip the unnecessary details. \n\n## How We Reason about CBS Programs\n\nFirst, code a function with the modeling language to represent an actual CBS data operation.\n\n```Coq\nDefinition CopyBlk : val := \n  Fun 'f 'n := \n  \tLet 'b := 'nthblk 'f 'n in     (* get the target block's loction *)\n    Let 'ln := 'bget 'b in         (* get the block's contents *)\n      'bcreate 'ln                 (* create a new block *)\n```\n\nSecond, specify the invocation of this function by a triple. This triple captures the system properties before and after the function invocation.\n\n```Coq\nLemma triple_CopyBlk : forall (f:floc) (b:bloc) (lb:list bloc) (ln:list int) (n:int),\n  triple (CopyBlk f n)  (* invocate the function *)\n(* pre-condition: the pure fact constrains the location; the predicate describes the storage of the target block *)\n    ( \\[b = nth n lb] \\* \\R[f ~f~\u003e lb, b ~b~\u003e ln] )\n(* post-condition: the pure fact describes the new block's location; the predicate additionally declares that a new block has been created *) \n    ( fun r =\u003e \\exists (b1:bloc), \\[r=b1] \\* (\\R[f ~f~\u003e lb,(b1 ~b~\u003e ln) \\b* (b ~b~\u003e ln)]) ).\n```\n\nLast, reason and prove such a triple using the proven reasoning rules. If this triple can be proved, it is sound since the reasoning rules are all sound. \n\n```Coq\nProof.\n  intros. apply triple_hpure. intros -\u003e.\n  applys* triple_app_fun2. ext.                (* invoke a funcation *)\n  applys* triple_let triple_fget_nth_blk. ext. (* get the block's loc *)\n  applys triple_let triple_bget. ext.          (* get the block's contents *)\n  applys triple_conseq_frame triple_bcreate.   (* create a new block *)\n  rewrite* hstar_hempty_l'.                  (* rewrite the format and complete proof *)\n  introv M. rewrite hstar_hexists in M.\n  destruct M as (b1\u0026M).\n  rewrite hstar_assoc, hstar_sep, hfstar_hempty_l in M.\n  exists~ b1.\nQed.\n```\n\n## Overview of Implementation\n\nThe Implementation of our proof system mainly consists the following parts:.\n\n- Modeling Language  ——  Language.v\n- Assertion Language  ——  CBS heap predicates (Himpl.v) + Internal heap predicates (InnerPre.v)\n- Hoare Logic  —— Hoare.v\n- The proof system for CBS —— TripleAndRules.v\n- Verification of basic operations  ——  ExBasic.v\n- Verification of data modifications ——  ExModification.v\n- Verification of a MapReduce application (WordCount) ——  ExMapReduce.v\n- Variable Notations —— Var.v \n\nIn additions, our tool depends on a Coq standard library (TLC.v) and a definition of finite map (Fmap.v).\n\nThe implementation of the verification tool amount to 5664 non-blank lines of Coq script. It includes 115 definitions, 368 lemmas, and the verifications of 12 scenarios.\n\n## Environment\n\n- Coq Version : Coq 8.8.0\n\n- IDE : VScode\n\n- OS : Windows 10\n\n## Installation\n\nThe standard installation procedure requires Coq 8.8.0. If you do not have it yet, please [install Coq](https://github.com/coq/coq/releases/download/V8.8.0/coq-8.8.0-installer-windows-x86_64.exe) first.\n\nTo install the latest development version of our tool, use this:\n\n```\n  git clone https://github.com/BinksZhang/CBS-Verification.git\n  cd CBS-Verification\n  make\n```\n\n**Note** : \u003cfont color=red\u003eOnly English or Number is allowed in the file path!!\u003c/font\u003e\n\n## Replaying a Sample Proof\n\nThen, you can load an example proof. There are several examples in the files ExBasic.v, ExModification.v, and ExMapReduce.v. Just use the CoqIDE to open a file and check the corresponding proof. The success proof of a program will be as follows.\n\n\u003cimg src=\"Move.png\" alt=\"avatar\" style=\"zoom:50%;\" /\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkutcs-cbs%2Fcbs-verification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkutcs-cbs%2Fcbs-verification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkutcs-cbs%2Fcbs-verification/lists"}