A refinement calculus implementation of Event-B in Python.
Project description
pyeb is a Python implementation of Event-B's refinement calculus. It takes an Event-B model as an input and generates proof-obligations that are eventually discharged with the Z3 SMT solver. Event-B models are written in Python following a special Object-Oriented syntax and notation. The pyeb tool generates proof obligations such as invariant preservation, feasibility of non-deterministic event actions, guard strengthening, simulation, preservation of machine variants, among others. pyeb uses `Z3 Python API to discharge the proof obligations automatically. It supports large parts of Event-B' syntax such as non-deterministic assignments, events, machines, contexts, and machine refinements.
pyeb can be downloaded from GitHub.
Getting Started (Mac OS X)
It is recommended to run pyeb in a virtual environment thus it will not have collateral effects on your local installation. pyeb dependencies are the Z3 solver, antlr Python runtime, and the antlr tools.
-
Creating and activating the virtual environment::
python -m venv .venv
source .venv/bin/activate
-
Optionally, you can deactivate the virtual environment after using pyeb::
deactivate
-
Installing dependencies::
pip install z3-solver==4.13.0.0
pip install antlr4-tools==0.2.1
pip install antlr4-python3-runtime==4.13.1
-
Installing pyeb::
pip install pyeb
Command Line Usage (Mac OS)
-
Running pyeb::
pyeb python-file
-
We have included a sample folder with several object-oriented examples of sequential algorithms (binary search, squared root, inverse function, etc.)::
pyeb sample/binsearch_oo.py
Unit testing with pytest
-
Installing pytest::
pip install pytest
-
Running pytest on a file in the sample directory::
pytest tests/test_binsearch.py
GitHub Installation
You might want to install and run the latest version of pyeb available from GitHub.
-
Installing pyeb::
mkdir dist
cd dist
git init
git remote add origin https://github.com/ncatanoc/pyeb.git
git pull origin main
git branch -M main
-
Running pyeb as a console script::
python main.py sample/binsearch_oo.py
-
Optionally, Running pyeb as a module::
python -m pyeb sample/binsearch_oo.py
Troubleshooting
For any questions or issues regarding pyeb, contact Néstor Cataño nestor.catano@gmail.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyeb-1.0.68.tar.gz.
File metadata
- Download URL: pyeb-1.0.68.tar.gz
- Upload date:
- Size: 83.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f7009332e1f52186c0e24df04c1539ad167a0f3e0611a8a4ef1595cff61fc5b
|
|
| MD5 |
77dd14c0ca845fc37036dbb9574c76f1
|
|
| BLAKE2b-256 |
6253fc606ad4ea4c37727d8e788af8ebefe4c64c1179623d5cd581595ab34a96
|
File details
Details for the file pyeb-1.0.68-py3-none-any.whl.
File metadata
- Download URL: pyeb-1.0.68-py3-none-any.whl
- Upload date:
- Size: 81.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96ab0a47f7880416044e431e72762a9110be583bebd9a69f7b2454053822ab49
|
|
| MD5 |
525c097b57b39cdd0849dbadf9b3f9c9
|
|
| BLAKE2b-256 |
8de9aa40a464d3ba8d490ef7513c6459553278cba65e69195949074fba653124
|