{"id":13779793,"url":"https://github.com/pirapira/eth-isabelle","last_synced_at":"2025-09-12T04:32:11.651Z","repository":{"id":66718409,"uuid":"69765845","full_name":"pirapira/eth-isabelle","owner":"pirapira","description":"A Lem formalization of EVM and some Isabelle/HOL proofs","archived":false,"fork":false,"pushed_at":"2022-03-24T10:29:19.000Z","size":3773,"stargazers_count":239,"open_issues_count":146,"forks_count":42,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-20T11:05:24.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Isabelle","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/pirapira.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-10-01T21:53:01.000Z","updated_at":"2025-04-06T12:45:14.000Z","dependencies_parsed_at":"2023-03-21T04:32:49.619Z","dependency_job_id":null,"html_url":"https://github.com/pirapira/eth-isabelle","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pirapira/eth-isabelle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirapira%2Feth-isabelle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirapira%2Feth-isabelle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirapira%2Feth-isabelle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirapira%2Feth-isabelle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirapira","download_url":"https://codeload.github.com/pirapira/eth-isabelle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirapira%2Feth-isabelle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274753612,"owners_count":25342825,"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-09-12T02:00:09.324Z","response_time":60,"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-08-03T18:01:09.301Z","updated_at":"2025-09-12T04:32:11.616Z","avatar_url":"https://github.com/pirapira.png","language":"Isabelle","funding_links":[],"categories":["EVM Implementations"],"sub_categories":["Other Implementations"],"readme":"# Formalization of Ethereum Virtual Machine in Lem\n\n[![Build Status](https://travis-ci.org/pirapira/eth-isabelle.svg?branch=master)](https://travis-ci.org/pirapira/eth-isabelle)\n[![CircleCI](https://circleci.com/gh/pirapira/eth-isabelle/tree/master.svg?style=svg)](https://circleci.com/gh/pirapira/eth-isabelle/tree/master)\n\nThis repository contains\n\n* an EVM implementation in Lem `lem/evm.lem`\n* a Keccak-256 implementation in Lem `lem/keccak.lem`\n* a form of functional correctness defined in Lem `lem/evmNonExec.lem`\n* a relational semantics that captures the environment's nondeterministic behavior `RelationalSem.thy`\n* some example verified contracts in `example`\n* a parser that parses hex code and emits an Isabelle/HOL expression representing the program `parser/hexparser.rb`\n\nWhen you see `\\\u003cRightarrow\u003e` in the source, try using the [Isabelle2017](https://isabelle.in.tum.de/index.html) interface.  There you see `⇒` instead.\n\n## Lem?\n\n[Lem](https://www.cl.cam.ac.uk/~pes20/lem/) is a language that can be translated into [Coq](https://coq.inria.fr/), [Isabelle/HOL](https://isabelle.in.tum.de/), [HOL4](https://hol-theorem-prover.org/), [OCaml](http://www.ocaml.org/), HTML and [LaTeX](https://www.latex-project.org/).\n\n## Prerequisites\n\n* [Isabelle2017](https://isabelle.in.tum.de/installation.html)\n* [lem](http://www.cl.cam.ac.uk/~pes20/lem/built-doc/lem-manual.html#installation)\n* [OCaml](http://www.ocaml.org/) 4.02.3\n* [opam](https://opam.ocaml.org/) 1.2.2\n* Some opam packages: use `opam install ocamlfind batteries yojson bignum easy-format bisect_ppx ocamlbuild sha secp256k1`\n* [ECC-OCaml from mrsmkl](https://github.com/mrsmkl/ECC-OCaml)\n* [secp256k1](https://github.com/bitcoin-core/secp256k1)\n    * On Ubuntu Artful, `apt install secp256k1-0 secp256k1-dev` is enough\n    * On older versions of Ubuntu, installation from the current `master` branch is necessary\n    * configure option `--enable-module-recovery` is needed\n\n## How to read the proofs\n\nFirst translate the Lem definitions into Isabelle/HOL:\n```\n$ make lem-thy\n```\n\nThen, use Isabelle2017 to open `./examples/AlwaysFail.thy`.  The prerequisite Isabelle/HOL files are automatically opened.\n\n## How to run VM tests and state tests\n\nMake sure the tests submodule is cloned\n```\n$ git submodule init tests\n$ git submodule update tests\n```\n\nExtract the OCaml definitions\n```\n$ make lem-ocaml\n```\n\nAnd move to `tester` directory.\n```\n$ cd tester\n```\n\nOne way is to run the VM Test.\n```\n$ sh compile.sh\n$ ./runVmTest.native\n```\n(When `./runVmTest.native` takes an argument, it executes only the test cases whose names contain the argument as a substring.)\n\n\nAnother way is to run the VM Test and measure the coverage.\n```\n$ sh measure_coverage.sh\n```\n\nMoreover, it's possible to run Blockchain Tests.\n```\n$ ./runBlockchainTest.native\n```\n\n## Makefile goals\n\n* `make doc` produces `output/document.pdf` as well as `lem/*.pdf`.\n* `make lem-thy` compiles the Lem sources into Isabelle/HOL\n* `make lem-hol` compiles the Lem sources into HOL4\n* `make lem-coq; cd lem; make` compiles the Lem sources into Coq (and then compiles the Coq sources)\n* `make lem-pdf` compiles some of the Lem sources into PDF through LaTeX\n* `make all-isabelle` checks all Isabelle/HOL sources (but not the ones compiled from Lem)\n* `make` does everything above\n* `script/gen_coq.sh` generates a distribution useful for Coq users\n\n## Links\n\n* For a bigger picture, see [overview of Yoichi's formal verification efforts on smart contracts](https://github.com/pirapira/ethereum-formal-verification-overview/blob/master/README.md#formal-verification-of-ethereum-contracts-yoichis-attempts)\n* For updates, visit [a gitter channel](https://gitter.im/ethereum/formal-methods)\n* A related project [EVM formalization in K framework](https://github.com/kframework/evm-semantics)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirapira%2Feth-isabelle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirapira%2Feth-isabelle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirapira%2Feth-isabelle/lists"}