Metadata-Version: 2.1
Name: vnnlib
Version: 0.0.1a2
Author-email: David Shriver <davidshriver@outlook.com>
License: MIT
Project-URL: Documentation, https://github.com/dlshriver/vnnlib#readme
Project-URL: Issues, https://github.com/dlshriver/vnnlib/issues
Project-URL: Source, https://github.com/dlshriver/vnnlib
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: lint
Provides-Extra: style
Provides-Extra: test
Provides-Extra: docs
Provides-Extra: dist
License-File: LICENSE.txt

# vnnlib

[![PyPI - Version](https://img.shields.io/pypi/v/vnnlib.svg)](https://pypi.org/project/vnnlib)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vnnlib.svg)](https://pypi.org/project/vnnlib)

-----

A python package for parsing neural network properties in the [VNN-LIB format](https://www.vnnlib.org/).
It should currently parse a superset of the VNN-LIB spec supported by [example parser](https://github.com/stanleybak/nnenum/blob/master/src/nnenum/vnnlib.py) written by Stan Bak for [VNN-COMP](https://sites.google.com/view/vnn2023), and will produce compiled specs in the same format.
Additionally, we allow parsing of gzip, bzip2, and lzma compressed specs.

> Our parser is currently slower than the previous scripts due to the increased specification support. However, we expect significant optimization opportunities are available, and that overhead will decrease over time.

> This package is still alpha software and APIs other than the compatibility API may change before the first release. We hope to have a stable release out before or during the benchmark proposal phase of VNN-COMP 2023.


## Installation

For the latest stable version, you can install from PyPI with:

```console
pip install vnnlib
```

> PyPI currently only has pre-releases of `vnnlib`. To install a pre-release version, add the `--pre` option to the above command.

For the latest updates of `vnnlib`, you can pip install directly from the GitHub repo with:

```console
pip install git+https://github.com/dlshriver/vnnlib.git@main
```

## Usage

This package can be used as a drop-in replacement for the VNN-COMP utility script by importing 

```python
from vnnlib.compat import read_vnnlib_simple
```

wherever you previously imported `read_vnnlib_simple`.

### Standalone

The parser can also be used to compile vnnlib ahead of time to reduce future property read times. The result of parsing will be pickled and saved to the location specified.

```console
python -m vnnlib [FILE] --compat -o [OUTPUTFILE]
```

## License

`vnnlib` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
