Metadata-Version: 2.4
Name: arg2p
Version: 0.19.0
Summary: Arg2P, structured argumentation in Prolog (ASPIC+, ABA, abstract frameworks), from Python
License: MIT
Project-URL: Homepage, https://tuprolog.github.io/arg2p-kt/
Project-URL: Source, https://github.com/tuProlog/arg2p-kt
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Java
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: JPype1>=1.5
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"

# arg2p for Python

[Arg2P](https://github.com/tuProlog/arg2p-kt), structured argumentation in Prolog (ASPIC+, ABA, ABA+, abstract
frameworks, ...), from Python: the API of the library of the JVM, in snake case, run through
[JPype](https://jpype.readthedocs.io) on the Java runtime the wheel bundles.

```sh
pip install arg2p
```

```python
from arg2p import Arg2p, Flags, Semantics

arg2p = Arg2p.of("""
r1 : [] => a.
r2 : [] => -a.
sup(r1, r2).
""")

arg2p.answer("a").in_statements                 # ['a']
(graph,) = arg2p.graphs()
graph.conclusions("out")                        # ['-a']

preferred = Arg2p.of("f1 :=> d.\nf2 :=> -d.", Flags.defaults().argument_labelling_mode(Semantics.PREFERRED))
len(preferred.graphs())                         # 2

Arg2p.of("r1 :=> a.\nr2 : a => b.").causality.but_for("a", "b")   # True
```

See [the documentation](https://tuprolog.github.io/arg2p-kt/docs/api/python/) for the whole API: flags, graphs,
Prolog goals, causality, the parallel solver and the command line (`arg2p theory.pl -q a`).

## Building

The package is a project of the Gradle build of Arg2P, which gives it its jars, its version and its Java runtime:

```sh
./gradlew :python:pythonJars :python:pythonVersion :python:pythonRuntime
pip install "./python[test]"
pytest python/tests
```

Without the runtime (`pythonRuntime`), the package runs on the Java of the system (21 or later). `ARG2P_JVM` names
another library of the JVM, `ARG2P_CLASSPATH` other jars.
