{"id":13472673,"url":"https://github.com/viperproject/prusti-dev","last_synced_at":"2025-05-13T18:08:10.009Z","repository":{"id":37431570,"uuid":"188058611","full_name":"viperproject/prusti-dev","owner":"viperproject","description":"A static verifier for Rust, based on the Viper verification infrastructure.","archived":false,"fork":false,"pushed_at":"2025-04-24T15:02:24.000Z","size":1348122,"stargazers_count":1629,"open_issues_count":280,"forks_count":111,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-25T17:53:53.533Z","etag":null,"topics":["formal-verification","rust","verification","viper"],"latest_commit_sha":null,"homepage":"http://prusti.org","language":"Rust","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/viperproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2019-05-22T14:46:23.000Z","updated_at":"2025-04-23T19:18:00.000Z","dependencies_parsed_at":"2022-07-11T03:18:31.999Z","dependency_job_id":"6b6a7305-24ac-4f50-b546-0388caa57d73","html_url":"https://github.com/viperproject/prusti-dev","commit_stats":{"total_commits":6053,"total_committers":73,"mean_commits":82.91780821917808,"dds":0.5868164546505865,"last_synced_commit":"aa8844c82ae12ded5c2e26a4661fed18a14cd740"},"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viperproject%2Fprusti-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viperproject%2Fprusti-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viperproject%2Fprusti-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viperproject%2Fprusti-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viperproject","download_url":"https://codeload.github.com/viperproject/prusti-dev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000849,"owners_count":21997441,"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":["formal-verification","rust","verification","viper"],"created_at":"2024-07-31T16:00:56.964Z","updated_at":"2025-05-13T18:08:09.983Z","avatar_url":"https://github.com/viperproject.png","language":"Rust","funding_links":[],"categories":["Projects","Rust","rust","Additional Resources","Verifiers"],"sub_categories":["Verification","18.3 Post-Quantum Cryptography"],"readme":"Prusti\n======\n\n[![Test](https://github.com/viperproject/prusti-dev/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/viperproject/prusti-dev/actions/workflows/test.yml?query=branch%3Amaster)\n[![Deploy](https://github.com/viperproject/prusti-dev/actions/workflows/deploy.yml/badge.svg?branch=master)](https://github.com/viperproject/prusti-dev/actions/workflows/deploy.yml?query=branch%3Amaster)\n[![Test coverage](https://codecov.io/gh/viperproject/prusti-dev/branch/master/graph/badge.svg)](https://codecov.io/gh/viperproject/prusti-dev)\n[![Project chat](https://img.shields.io/badge/Zulip-join_chat-brightgreen.svg)](https://prusti.zulipchat.com/)\n\n[Prusti](http://www.pm.inf.ethz.ch/research/prusti.html) is a prototype verifier for Rust that makes it possible to formally prove absence of bugs and correctness of code contracts. Internally, Prusti builds upon the [Viper verification infrastructure](http://www.pm.inf.ethz.ch/research/viper.html).\n\nBy default Prusti verifies absence of integer overflows and panics, proving that statements such as `unreachable!()` and `panic!()` are unreachable.\nOverflow checking can be disabled with a configuration flag, treating all integers as unbounded.\nIn Prusti, the functional behaviour of functions and external libraries can be specified by using annotations, among which are preconditions, postconditions, and loop invariants.\nThe tool checks them, reporting error messages when the code does not adhere to the provided specification.\n\nUseful links\n------------\n\n* :computer: [VS Code extension](https://marketplace.visualstudio.com/items?itemName=viper-admin.prusti-assistant) to use Prusti from your IDE.\n* :book: [User guide](https://viperproject.github.io/prusti-dev/user-guide/), containing installation instructions, a guided tutorial and a description of various verification features.\n* :woman_technologist: [Developer guide](https://viperproject.github.io/prusti-dev/dev-guide/), intended for new contributors. If you want to help, check our [good first issues](https://github.com/viperproject/prusti-dev/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).\n* :books: [List of publications](http://www.pm.inf.ethz.ch/research/prusti.html). To cite the Prusti verifier, please use [this BibTeX entry](http://pm.inf.ethz.ch/publications/getbib.php?action=bibtex\u0026bibname=Own\u0026id=AstrauskasMuellerPoliSummers19b).\n* :film_projector: [Presentation](https://www.youtube.com/watch?v=C9TTioH5JUg) of Prusti's research project. It includes a demo.\n* :balance_scale: [License](https://github.com/viperproject/prusti-dev/blob/master/LICENSE) of the source code (Mozilla Public License Version 2.0, for code authored by us).\n* :speech_balloon: Do you still have questions? Open an issue or contact us on the [Zulip chat](https://prusti.zulipchat.com/).\n\nGetting Prusti\n--------------\n\nThe easiest way to try out Prusti is by using the [\"Prusti Assistant\"](https://marketplace.visualstudio.com/items?itemName=viper-admin.prusti-assistant) extension for VS Code. See the **requirements** and the troubleshooting section in its [readme](https://github.com/viperproject/prusti-assistant/blob/master/README.md).\n\nAlternatively, if you wish to use Prusti from the command line there are three options:\n* Download the precompiled binaries for Ubuntu, Windows, or macOS from a [GitHub release](https://github.com/viperproject/prusti-dev/releases).\n* Compile from the source code, by installing [rustup](https://rustup.rs/), running `./x.py setup` and then `./x.py build --release`.\n* (unmaintained) Build a Docker image from this [`Dockerfile`](Dockerfile).\n\nAll three options provide the `prusti-rustc` and `cargo-prusti` programs that can be used analogously to, respectively, `rustc` and `cargo build`.\nFor more detailed instructions, refer to the guides linked above.\n\n\nQuick example\n-------------\n\n1. Take the following program:\n    ```rust\n    /// A monotonically increasing discrete function, with domain [0, domain_size)\n    trait Function {\n      fn domain_size(\u0026self) -\u003e usize;\n      fn eval(\u0026self, x: usize) -\u003e i32;\n    }\n\n    /// Find the `x` s.t. `f(x) == target`\n    fn bisect\u003cT: Function\u003e(f: \u0026T, target: i32) -\u003e Option\u003cusize\u003e {\n      let mut low = 0;\n      let mut high = f.domain_size();\n      while low \u003c high {\n        let mid = (low + high) / 2;\n        let mid_val = f.eval(mid);\n        if mid_val \u003c target {\n          low = mid + 1;\n        } else if mid_val \u003e target {\n          high = mid;\n        } else {\n          return Some(mid)\n        }\n      }\n      None\n    }\n    ```\n2. Run Prusti. You get the following error:\n    ```\n    error: [Prusti: verification error] assertion might fail with \"attempt to add with overflow\"\n      --\u003e example.rs:12:15\n       |\n    12 |     let mid = (low + high) / 2;\n       |               ^^^^^^^^^^^^\n\n    Verification failed\n    ```\n3. Fix the buggy line with `let mid = low + ((high - low) / 2);`\n4. Run Prusti. Now the `bisect` function verifies.\n\nCongratulations! You just proved absence of panics and integer overflows in the `bisect` function. To additionally prove that the result is correct (i.e. such that `f(x) == target`), see [this example](https://github.com/viperproject/prusti-dev/blob/master/prusti-tests/tests/verify_overflow/pass/overflow/bisect.rs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviperproject%2Fprusti-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviperproject%2Fprusti-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviperproject%2Fprusti-dev/lists"}