{"id":19608667,"url":"https://github.com/sel4/graph-refine","last_synced_at":"2025-04-27T20:33:02.241Z","repository":{"id":42977055,"uuid":"42096487","full_name":"seL4/graph-refine","owner":"seL4","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-17T00:43:28.000Z","size":1143,"stargazers_count":14,"open_issues_count":2,"forks_count":12,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-05T03:22:43.211Z","etag":null,"topics":["proof","refinement-proof","sel4","translation-validation"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seL4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2015-09-08T07:20:25.000Z","updated_at":"2025-03-22T18:15:16.000Z","dependencies_parsed_at":"2025-03-17T01:29:16.727Z","dependency_job_id":"f52cce1b-2da8-4339-8703-fa01ba2eb26d","html_url":"https://github.com/seL4/graph-refine","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Fgraph-refine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Fgraph-refine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Fgraph-refine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Fgraph-refine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seL4","download_url":"https://codeload.github.com/seL4/graph-refine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204731,"owners_count":21552280,"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":["proof","refinement-proof","sel4","translation-validation"],"created_at":"2024-11-11T10:16:19.790Z","updated_at":"2025-04-27T20:33:01.559Z","avatar_url":"https://github.com/seL4.png","language":"Python","readme":"\u003c!--\n     Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)\n\n     SPDX-License-Identifier: CC-BY-SA-4.0\n--\u003e\n\nThe NICTA Graph Refinement Toolset\n==================================\n\nThis is a set of tools which discover and check refinement proofs between\nprograms with fairly arbitrary control flow graphs, including a number of\nkinds of loop relationships. The tools are written in python and make heavy\nuse of SMT solvers.\n\nThe design and theory of this tool are described in the paper [Translation\nValidation for a Verified OS Kernel][1] by Sewell, Myreen \u0026 Klein.\n\n  [1]: https://trustworthy.systems/publications/nictaabstracts/Sewell_MK_13.abstract \"Translation Validation for a Verified OS Kernel\"\n\nRepository Setup\n----------------\n\nThis tool can be used as it is. It is also designed to link with the\n[L4.verified][2] proof chain. The full proof chain can be fetched via a\nGoogle [repo][3] setup. To obtain the full environment, instead of cloning\nthis repository, follow the instructions in the [manifest repository][4] here:\n\n   https://github.com/seL4/verification-manifest\n\nTo set up the various tools in the verification bundle, see the section\n[Dependencies](#dependencies) below.\n\n  [2]: https://github.com/seL4/l4v                   \"L4.verified Repository\"\n  [3]: http://source.android.com/source/downloading.html#installing-repo     \"google repo installation\"\n  [4]: https://github.com/seL4/verification-manifest \"Verification Manifest Repository\"\n\nExamples\n--------\n\nThe [`example`](example/) and [`loop-example`](loop-example/) directories\ncontain prebuilt example refinement targets. The [`example`](example/)\ndirectory contains a number of handwritten demonstration problems. The\n[`loop-example`](loop-example/) contains example compilation and decompilation\nof a simple example program involving a loop both the `-O1` and `-O2` arguments\nto `gcc`. Both versions should be provable, but the `-O2` version involves a\nloop unrolling that is computationally expensive to verify.\n\nThe examples can be used to exercise the tool as follows:\n\n    python graph-refine.py example f g rotate_right has_value\n    python graph-refine.py loop-example/O1 all\n\n    # *much* slower\n    python graph-refine.py loop-example/O2 all\n\nThe [`seL4-example`](seL4-example/) directory contains a recipe for building\nthe seL4 binary verification problem. If this repository is set up via the\n[verification manifest][4] then most of the necessary components will be\npresent. More information on running the full process is included in the\n[`seL4-example`](seL4-example/) directory.\n\nDependencies\n------------\n\nThe tool requires the use of an SMT solver supporting the QF\\_ABV logic, which\nis not provided here. Available solvers should be listed in a `.solverlist`\nconfiguration file. Further documentation will be given on the command line if\nthe configuration is missing or invalide. The `.solverlist` file format is also\ndocumented in in [`solver.py`](solver.py).\n\nTo test the solver setup is working:\n\n    python solver.py test\n\nAdditional dependencies are required to run the full seL4 binary verification\nproblem. They are described in the [`seL4-example`](seL4-example/) directory.\n\nUsage\n-----\n\nThe tool is invoked by:\n\n    python graph-refine.py \u003ctarget\u003e \u003cinstructions\u003e\n\nA target is a directory which contains all of the functions and configuration\nassociated with an input problem. Target directories must contain a target.py\nsetup script. See the example directory for an example.\n\nThere are various instructions available:\n\n  - all: test all functions. this will usually be the last instruction.\n  - no-loops: skip functions with loops\n  - only-loops: skip functions without loops\n  - verbose: produce a lot of diagnostic output in subsequent instructions.\n  - `function-name`: other instructions will be taken as the name of a single\nfunction to be tested.\n\nOverview\n--------\n\n  - [syntax.py](syntax.py): defines the syntax of the graph language and its parser. A syntax reference is included.\n  - [logic.py](logic.py): defines the top-level per-function proof obligations. Also provides various graph algorithms.\n  - [problem.py](problem.py): stores the state of one refinement problem. Keeps mutable copies of graph functions, allowing inlining.\n  - [solver.py](solver.py): controls the SMT solver. Manages an SMT problem state and some logical extensions.\n  - [rep\\_graph.py](rep_graph.py): populates the solver state with a model produced from a problem.\n  - [check.py](check.py): defines the refinement proof format and the process for checking a proof.\n  - [search.py](search.py): searches for a refinement proof.\n  - [stack\\_logic.py](stack_logic.py): provides additional analysis to address stack aspects of the binary calling convention.\n  - [graph-refine.py](graph-refine.py): top level.\n\n  - [trace\\_refute.py](trace_refute.py): adaptation of this tool to detect\n    impossible traces. This may be useful for other static analysis, e.g. WCET\n    estimation.\n  - [debug.py](debug.py): debug helper code.\n\n  - [example](example), [loop-example](loop-example),\n    [seL4-example](seL4-example) are discussed in the [Examples](#examples)\nabove.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsel4%2Fgraph-refine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsel4%2Fgraph-refine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsel4%2Fgraph-refine/lists"}