A Python package for parsing and manipulating neural network properties in the updated VNN-LIB format.
Features include:
- Parsing: Convert VNN-LIB file or string into a type-checked AST
- AST traversal: Access, traverse, and convert the AST back to a string.
- Transformers:
- Linearise arithmetic expressions
- Convert boolean expressions to Disjunctive Normal Form (DNF)
- Transform spec to reachability format used in prior VNN-COMPs.
Install the latest stable version via PyPi:
pip install vnnlibimport vnnlib
# Parse a VNN-LIB specification
query = vnnlib.parse_query_file("path/to/spec.vnnlib")
for assertion in query.assertions:
print(assertion)| VNNLIB-Python version | VNNLIB version |
|---|---|
| v1.0.1 | v2.0 |
| v1.0 | v2.0 |
| v0.0.1 | v1.0 |