Skip to main content

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 hhlpy or python -m pip install hhlpy to install HHLPy.
  • Run python -m hhlpy to start HHLPy. Your browser should open automatically. (If it doesn't, open http://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 variable WolframKernel to the path of the file WolframKernel or WolframKernel.exe that comes with the Wolfram Engine installation. Then restart your terminal and run python -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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hhlpy-0.1.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hhlpy-0.1.0-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

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

Hashes for hhlpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2d93df566fae1d5651963f2fcadd705e6c6b1308bb5526b34d390b883081dfe
MD5 0f4aedb0afd230f55775fe001550ccd4
BLAKE2b-256 2ebec7ac3820b077ea3ab7120c88f070a16b17f3a0f4ed9b3ea2b4b39c1daf7d

See more details on using hashes here.

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

Hashes for hhlpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9899f4b9084d51525e06ea10d014e08fd87929122f8f2cbf280de557732dcb37
MD5 bf6b157c598473c5941b13ebc4a8274f
BLAKE2b-256 9724854e1648d3602dc5d7bac85ad663cca6b8ec22a8092e5ac1ab6dd9bee0ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page