Prove hybrid programs correct using Hybrid Hoare Logic
Project description
HHLPy
HHLPy is a formal verification tool for hybrid systems. It is based on an extension of Hoare logic to hybrid systems called Hybrid Hoare Logic.
Installation
Base installation
The base installation of HHLPy does not require Wolfram Engine:
- Install Python 3.9 or higher: https://www.python.org/downloads/.
- Run
pip install hhlpyorpython -m pip install hhlpyto install HHLPy. - Run
python -m hhlpyto start HHLPy. Your browser should open automatically. (If it doesn't, openhttp://127.0.0.1:8000/in your browser.)
Install Wolfram Engine
To be able to proof more verification conditions, install Wolfram Engine on your system:
- Download Wolfram Engine and install it: https://www.wolfram.com/engine/
- Get a license for Wolfram Engine and activate it.
- If you use the standard installation path, HHLPy should be able to
find it automatically; simply run
python -m hhlpy. - If you see the message
Please install Wolfram Kernel ..., you need to set the environment variableWolframKernelto the path of the fileWolframKernelorWolframKernel.exethat comes with the Wolfram Engine installation. Then restart your terminal and runpython -m hhlpy. - If you see the line
Socket exception: Socket operation aborted.in the terminal, you probably still need to activate your license.
First Steps
Click on the file basic1.hhl in the list of example files on the left panel. A
file with the following content will open:
pre [x >= 0];
x := x+1;
post [x >= 1];
This example program has a single instruction: it increases the variable x by 1.
The only precondition is x >= 0; the only postcondition is x >= 1.
These conditions seem correct: If x is at least 0 and increased by 1, it
is at least 1 afterwards.
On the right side, you see the verification condition panel. It contains a single verification condition that has been generated from the program:
assume:
x >= 0
show: x + 1 >= 1
Click on the button Verify to check the verification condition. A green
checkmark appears below the condition. And the counter next to the button
indicates that 1/1 verification conditions have been proved.
Next, add a second instruction to the program that divides x by 2:
pre [x >= 0];
x := x+1;
x := x/2;
post [x >= 1];
Observe that the verification condition on the right updates automatically.
Click the button Verify to verify the new condition. You will see an X mark
indicating that the verification condition could not be verified. Try to adapt
the postcondition to make the verification go through...
Explore the other example files to see more!
Project details
Release history Release notifications | RSS feed
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 hhlpy-0.1.0.tar.gz.
File metadata
- Download URL: hhlpy-0.1.0.tar.gz
- Upload date:
- Size: 2.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d93df566fae1d5651963f2fcadd705e6c6b1308bb5526b34d390b883081dfe
|
|
| MD5 |
0f4aedb0afd230f55775fe001550ccd4
|
|
| BLAKE2b-256 |
2ebec7ac3820b077ea3ab7120c88f070a16b17f3a0f4ed9b3ea2b4b39c1daf7d
|
File details
Details for the file hhlpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hhlpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9899f4b9084d51525e06ea10d014e08fd87929122f8f2cbf280de557732dcb37
|
|
| MD5 |
bf6b157c598473c5941b13ebc4a8274f
|
|
| BLAKE2b-256 |
9724854e1648d3602dc5d7bac85ad663cca6b8ec22a8092e5ac1ab6dd9bee0ce
|