westtide / cln2inv

Open source release from our ICLR 2020 paper, CLN2INV: Learning Loop Invariants with Continuous Logic Networks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLN2INV

CLN2INV is the loop invariant inference system from our ICLR 2020 paper, CLN2INV: Learning Loop Invariants with Continuous Logic Networks.

arch

Setup Instructions:

  1. Install miniconda for python 3.7+: https://docs.conda.io/en/latest/miniconda.html
  2. Install pytorch conda install pytorch cpuonly -c pytorch See https://pytorch.org/get-started/locally/ for other pytorch install options
  3. Install other dependencies
conda install pandas matplotlib
pip install z3-solver sklearn tqdm

Code2Inv benchmark

python cln2inv.py

The script will run through each problem in the code2inv benchmark and print out the learned invariants, whether it passes the benchmark check, and a summary of all results.

You may also run individual problems. For example, to run problem 5:

python cln2inv.py 5

You can regenerate training samples for each problem. For example, to record execution traces for problem 5,

cd cln
python instrument.py 5

About

Open source release from our ICLR 2020 paper, CLN2INV: Learning Loop Invariants with Continuous Logic Networks.

License:MIT License


Languages

Language:Roff 60.5%Language:SMT 29.9%Language:Python 5.3%Language:C 4.2%