{"id":50446706,"url":"https://github.com/lean-machines-central/lean-machines","last_synced_at":"2026-05-31T22:00:46.278Z","repository":{"id":252080998,"uuid":"839357281","full_name":"lean-machines-central/lean-machines","owner":"lean-machines-central","description":"a Lean4 framework for the modeling and refinement of stateful systems","archived":false,"fork":false,"pushed_at":"2026-05-25T15:46:47.000Z","size":838,"stargazers_count":28,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-30T00:14:25.778Z","etag":null,"topics":["event-b","formal-methods","lean4"],"latest_commit_sha":null,"homepage":"","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lean-machines-central.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-07T12:55:05.000Z","updated_at":"2026-05-25T15:46:51.000Z","dependencies_parsed_at":"2024-08-21T17:26:32.273Z","dependency_job_id":"76dec8f8-2237-4cdb-98a9-666acd99373f","html_url":"https://github.com/lean-machines-central/lean-machines","commit_stats":null,"previous_names":["lean-machines-central/lean-machines"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lean-machines-central/lean-machines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-machines-central%2Flean-machines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-machines-central%2Flean-machines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-machines-central%2Flean-machines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-machines-central%2Flean-machines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lean-machines-central","download_url":"https://codeload.github.com/lean-machines-central/lean-machines/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-machines-central%2Flean-machines/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33679310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["event-b","formal-methods","lean4"],"created_at":"2026-05-31T22:00:32.701Z","updated_at":"2026-05-31T22:00:46.268Z","avatar_url":"https://github.com/lean-machines-central.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeanMachines: a Lean4 framework for the modeling and refinement of stateful systems\n\n## Overview\n\nLeanMachines is a library for the Lean4 programming language and proof\nassistant dedicated to the formal modeling of stateful systems.\nThe main objective is to support a stepwise refinement methodology \ninspired by the Event-B formal method but in the context of a functional\nprogramming environment. The implementation provides the\nconstruction inspired by Event-B constructions such as contexts, machines, events\nand, most importantly, the associated refinement principles. It also\nintroduces extensions such as event combinators and\nfunctional variants of the (relational) refinement principles of\nEvent-B. Most importantly, the framework enforces the fundamental principle of\ncorrectness-by-construction: machine states, events structures\nand refinement steps cannot be fully constructed without discharging\nthe prescribed proof obligations. The implementation is open source and\navailable for external contributions. Heavily commented examples of use are also provided.\n\n**Important** : The framework is not directly compatible with Event-B\nand related implementations such as Rodin \n(although a translator is under consideration).\n\n## Project status : alpha\n\nThe framework is in alpha stage of development and may be modified without prior warning and without ensuring non-regression. The framework also depends on a rather \"moving target\": the Mathlib4 framework.\n\n## Getting started\n\n**As a user** :\n\nThe simplest way to experiment with the LeanMachines framework is\nto add the dependency in an existing Lean4 project :\n\n```lean\n-- in the build file: lakefile.lean\nrequire «lean-machines» from git\n  \"https://github.com/lean-machines-central/lean-machines.git\" @ \"main\"\n```\n\nAn example repository is available online:\n\nhttps://github.com/lean-machines-central/lean-machines-examples\n\nThis provides a set of fully documented example specifications than \ncan be \"played with\". Cloning this repository is probably the best way to start experimenting with he LeanMachines framework.\n\n**As a library developer** :\n\nTo experiment with the framework implementation, the first requirement is to install the Lean4 proof assistant and the Mathlib4 library, see: \u003chttps://leanprover-community.github.io/get_started.html\u003e\n\nThe framework can be compiled using the lake tool :\n\n```\n$ lake build \n...\n```\n\nThis can take a relatively long time for the first build, or when Mathlib4 receives a large update.\n\nBecause of the Mathlib4 dependency, it may be required to update the `lean-toolchain` :\n\n```\n$ lake update\n...\n$ cp .lake/packages/mathlib/lean-toolchain .\n```\n(please see the Mathlib4 documentation for details)\n\nThe recommended way to experiment with the framework is to use a\nlean4-enabled editor: either *vscode* or *emacs*\n(editor support for Lean4 is discussed in the Lean4 documentation).\n\n## Repository structure\n\nThe framework is decomposed into several modules, within the `LeanMachines` directory, structured as follows:\n\n - LeanMachines/Algebra : common algebraic definitions (Mathlib4 extensions)\n - LeanMachines/Event : the basic definitions : contexts, machines and deterministic events\n - EventSystem/NonDet : non-deterministic events\n\nThe refinement principles are developed in EventSystem/Refinement\n\n - LeanMachines/Refinement/Relational : the Event-B relational principles\n - LeanMachines/Refinement/Functional : functional abstraction\n - LeanMachines/Refinement/Strong : strong refinement for algorithmic refinement\n\nAll the examples are developed in the Examples/ directory.\n\n## Authors and acknowledgment\n\nThe main author is Frederic Peschanski,  Sorbonne University\nContributors (thanks !):\n  - Danael Carbonneau\n  - Pietro Monticone\n\n## License\n\nThe software is licensed (C) 2024-2026 Frédéric Peschanski\nunder the Apache License 2.0  (the same as Lean4 and Mathlib4). Please see the `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-machines-central%2Flean-machines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flean-machines-central%2Flean-machines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-machines-central%2Flean-machines/lists"}