Metadata-Version: 2.4
Name: asp-fzn
Version: 0.3.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: clingo==5.8.2
Requires-Dist: maturin ; extra == 'dev'
Provides-Extra: dev
Summary: asp-fzn: A tool that enables solving ASP programs via FlatZinc solvers
Author-email: Tobias Geibinger <tobias.geibinger@tuwien.ac.at>, Thomas Eiter <thomas.eiter@tuwien.ac.at>, Tobias Kaminski <tobias.kaminski@de.bosch.com>, Johannes Oetsch <johannes.oetsch@tuwien.ac.at>, Nysret Musliu <nysret.musliu@tuwien.ac.at>
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# asp-fzn

Python interface for [asp-fzn](https://gitlab.tuwien.ac.at/kbs/BAI/asp-fzn) which enables solving head-cycle free ASP programs via FlatZinc solvers via translation written in rust.

The inferface supports answer set solving through Python directly through [MiniZinc](https://www.minizinc.org/), which needs to be installed on the system and in `PATH`.

Alternatively, FlatZinc solver directly, without MiniZinc, by passing their `.msc` file.

The package can also be used to translate ASP programs into FlatZinc and store the model in a file.

## Example

Enumerating answer sets with [CP-SAT](https://developers.google.com/optimization) (bundled in MiniZinc, which needs to be installed)
```python
import aspfzn

prg = '''
a:- not b.
b :- not a.
c :- b.
'''
result = aspfzn.solve(prg, "cp-sat", all_solutions=True, on_solution=print)
print(result)
```

## License

The code of this project is licensed under the *Apache License 2.0*. 

Furthermore, note the following legal disclaimer:

*This software is a research prototype only. It has not been tested for the use in or for products and/or services (in particular in any safety-relevant areas). It was solely published as part of the publication “ASP-FZN: A Translation-based Constraint Answer Set Solver“ and will neither be maintained nor monitored.*

Robert Bosch GmbH is acknowledged for financial support.

