{"id":22202952,"url":"https://github.com/logsem/free-theorems-sl","last_synced_at":"2025-08-17T20:05:30.332Z","repository":{"id":74946000,"uuid":"298526340","full_name":"logsem/free-theorems-sl","owner":"logsem","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-29T12:50:33.000Z","size":856,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-27T06:01:32.448Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/logsem.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":"2020-09-25T09:21:28.000Z","updated_at":"2024-12-19T02:27:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3db1a26-d52c-4be4-8d7c-8d18adbcc8ee","html_url":"https://github.com/logsem/free-theorems-sl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/logsem/free-theorems-sl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsem%2Ffree-theorems-sl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsem%2Ffree-theorems-sl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsem%2Ffree-theorems-sl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsem%2Ffree-theorems-sl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logsem","download_url":"https://codeload.github.com/logsem/free-theorems-sl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logsem%2Ffree-theorems-sl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899578,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-02T16:39:10.120Z","updated_at":"2025-08-17T20:05:30.324Z","avatar_url":"https://github.com/logsem.png","language":"Coq","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Theorems from Separation Logic Specifications\n\nThis repository contains the Coq mechanization associated with the paper \"Free\nTheorems from Separation Logic Specifications\".\n\n## Navigating the development\n\nThe html rendering of the Coq scripts provides an easy way of navigating the\ndevelopment, without having to build anything. It is [available\nonline](https://logsem.github.io/free-theorems-sl/html/toc.html).\n\n### Examples\n\n- `stack`: a simple stack specification (§2)\n- `file`: simple specification for a file API with open/read/close operations (§5.1)\n- `iterator`: specification for an iterator over a mutable collection (§5.2)\n- `well_bracketed`: specification enforcing a well-bracketing protocol (§5.3)\n- `traversable_stack`: a stack specification with a `foreach` operation (§5.4)\n- `linearizability`: a concurrent specification using logically atomic triples (§6)\n\nBonus:\n- `stack_impl`: an example implementation of the stack library, satisfying the\n  specifications in `stack` and `traversable_stack`\n\n### Language and logic\n\nThe `heap_lang` directory contains the definition of the language. It is based\non the standard cbv language of the same name shipped with Iris, extended with\nthe additional trace primitives and corresponding reasoning principles.\n\n- `lang` defines the syntax and operational semantics of the language (Fig. 1)\n- `lifting` defines the trace-related resources (see `trace_is`, `hist`,\n  `trace_inv` and related lemmas) and proves the Separation Logic specifications\n  for the trace operations (`wp_emit` and `wp_fresh`) (Fig. 3)\n- `adequacy` establishes the Adequacy theorem: lemma `modular_invariance`\n  corresponds to Theorem 4.1.\n\nThe remaining unlisted files typically contain helper lemmas or tactics.\n\n### Notations\n\nSome notations differ between the Coq formalization and the paper. Here is a\nshort cheatsheet of the common Coq notations that we use:\n\n- Hoare triples are written as `{{{ P }}} e {{{ RET r; Q }}}`, where `P` is the\n  pre-condition, `Q` the post-condition, and `r` is a binder naming the return\n  value in `Q`;\n- `# x` denotes a (deep embedded) value of the programming language, for the\n  literal `x`. For instance, `#()` is the \"unit\" value, `# 3` is the integer\n  value 3, and `# \"abc\"` is the value for the event tag `\"abc\"`;\n- `(a, b)%V` denotes a deep embedded value of the programming language, which is\n  the pair of values `a` and `b`. In the paper, it is written using angle\n  brackets `⟨ a, b ⟩`. This is to distinguish with `(a, b)` which is a pair in\n  Coq;\n- `_ !! _` corresponds to the \"lookup\" operation. In particular, if `t` is a\n  trace (a list of events), `t !! i` looks up the `i`-th value of the trace (and\n  returns an option as trace might be of length less than `i`);\n- `_ ++ _` is the list concatenation operation. We use `t ++ [e]` for the trace\n  adding event `e` at the end of trace `t`;\n- `[]` denotes the empty trace (i.e. the empty list), corresponding to `ε` in\n  the paper;\n- the `trace_is` predicate corresponds to \"trace\" in the paper.\n\n## Building the proofs\n\n### Installing the dependencies\n\nThe development is known to build with Coq 8.9.1 to 8.12 and Iris 3.3. \n\nThe easiest way to install those is by creating a fresh *local*\n[opam](https://opam.ocaml.org/) switch with everything needed (check that opam\n`\u003e= 2.0` is installed):\n\n```\n  opam switch create -y --repositories=default,coq-released=https://coq.inria.fr/opam/released . ocaml-base-compiler.4.09.1\n  eval $(opam env)\n```\n\n#### Troubleshooting\n\nIf the invocation fails at some point, either remove the `_opam` directory and\nre-run the command (this will redo everything), or do `eval $(opam env)` and\nthen `opam install -y .` (this will continue from where it failed).\n\n### Building\n\nSimply run:\n```\nmake\nmake html  # rebuild the html rendering of the proofs\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogsem%2Ffree-theorems-sl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogsem%2Ffree-theorems-sl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogsem%2Ffree-theorems-sl/lists"}