Arg2P

Registre officiel Autres

Structured argumentation: solve ASPIC+, ABA and abstract theories, explore their results

Que pouvez-vous faire avec Arg2P ?

  • Query Execution: Write your query in the text field and hit Enter or click >.
  • Solution Exploration: Click > for the next solution or >> to compute all solutions.
  • New Query: Click X to stop the current query, then enter a new one.

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

PYPI package arg2p
Claude Code
claude mcp add arg2p -- uvx arg2p==0.20.0 mcp
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "arg2p": {
            "command": "uvx",
            "args": [
                "arg2p==0.20.0",
                "mcp"
            ]
        }
    }
}

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. Arg2P
  2. Getting Started
  3. Arg2p IDE
  4. Arg2p Playground
  5. Arg2p for VS Code
  6. Arg2p for AI assistants (MCP)
  7. Issue tracking
  8. References

Arg2P

Arg2P is an implementation of the ASPIC+ framework for structured argumentation. Built on top of the tuProlog engine, it runs on the JVM, in JavaScript (Node.js and browsers) and in Python, with the same API.

More details are available on the official wiki.


Getting Started

Arg2p is available as a 2P-Kt library.

JVM Library - Gradle

To import the Arg2p module into your Kotlin-based Gradle project, declare the dependency in your build.gradle(.kts) file (<VERSION> is the latest release, shown by the Maven Central badge above):

repositories {
    mavenCentral()
}

dependencies {
    implementation("it.unibo.tuprolog.argumentation:arg2p-jvm:<VERSION>")
}
Usage Example
import it.unibo.tuprolog.argumentation.Arg2p

fun main() {
    val (graph) =
        Arg2p.of(
            """
            f1 :=> d.
            f2 :=> -d.
            """.trimIndent(),
        ).graphs()

    graph.labellings.forEach {
        println("${it.label} : ${it.argument.conclusion}")
    }
}

For a complete example, check out the GitHub demo.

NPM Library

The Arg2P software is available on NPM as a JavaScript library as well. It can be found under the @tuprolog organization. To use the library, add the dependency to your package.json (<VERSION> is the latest release, shown by the npm badge above):

{
  "dependencies": {
    "@tuprolog/arg2p": "<VERSION>"
  }
}
Usage Example
import { Arg2p } from '@tuprolog/arg2p'

const [graph] = Arg2p.of(`
    f1 :=> d.
    f2 :=> -d.`).graphs()

graph.labellings.forEach(it => console.log(`${it.label} : ${it.argument.descriptor}`))

For a complete example, see the repository.

Python Library

The same API, in snake case, is on PyPI: pip install arg2p (the wheel bundles a Java runtime).

from arg2p import Arg2p

(graph,) = Arg2p.of("f1 :=> d.\nf2 :=> -d.").graphs()
for labelled in graph.labellings:
    print(f"{labelled.label} : {labelled.argument.conclusion}")

Arg2p IDE

The Arg2p IDE is available on the Releases section of the GitHub repository.

In the latest release page, download the Asset named:

arg2p-ide-<VERSION>-redist.jar

a self-contained, executable Jar containing the 2P-Kt-based Prolog interpreter (<VERSION> is the release version).

After you download the jar, you can simply launch it by running:

java -jar arg2p-ide-<VERSION>-redist.jar

If your JVM is properly configured, you can also start the IDE by double-clicking the JAR file.

Features
  • Query Execution: Write your query in the text field and hit Enter or click >.
  • Solution Exploration: Click > for the next solution or >> to compute all solutions.
  • New Query: Click X to stop the current query, then enter a new one.
Additional Tabs
  • Graph Tab: Displays a graphical representation of the abstract argumentation graph.
  • Arg Flag Tab: Shows and allows modification of Arg2P flags. Detailed descriptions are on the Flags page of the wiki.

Arg2p Playground

Try Arg2P directly in your browser using the Web Playground.

No installation required: the solver runs in the browser. Write a theory, solve a query one solution at a time, and browse the argument graph of each solution and the stages of its computation. The profile a theory states (graphBuildMode(aba)., say) tells the framework it is read in, and the Flags panel sets the semantics and every other flag, with the value in effect and where it comes from.

An abstract framework is a theory too (graphBuildMode(abstract)., arguments a. and attacks a -> b.): it is drawn, and the drawing edits the theory. Arguments and attacks are added, renamed and deleted by drawing, the labelling of the solution colours them, and hovering or tapping an argument tells its label, what attacks it and what it attacks. Frameworks are imported from APX, TGF and ICCMA'23 files, and exported to APX and TGF.

Theories are kept in tabs in the browser, shared as links, opened from and saved to files; the playground works offline once installed as an app, on desktops, tablets and phones. Its components are on npm as @tuprolog/arg2p-ui, to embed the solver in other pages.


Arg2p for VS Code

The extension of VS Code edits theories as .arg2p files: their syntax is highlighted and their syntax errors show as they are typed. Arg2P: Open the Solver opens the solver of the playground beside a theory, running on the JVM: its solutions, their graphs, the drawing of an abstract framework and the flags.

The extension bundles the language server of Arg2P and the Java runtime it runs on; see its README for its settings.


Arg2p for AI assistants (MCP)

The language server of Arg2P is also an MCP server: AI assistants solve theories with it rather than guessing what they conclude. Its tools:

Tool
solveThe solutions of a query on a theory, with their bindings and the argument graph: every argument with its conclusion and label, every attack
answerThe statements of a query labelled in, out and und
checkWhether a theory or a query parses, and where it does not
settingsThe profile and the flags in effect for a theory
exploreShows the user the solver of a theory, in the conversation where the client shows MCP Apps, and as a link to the playground

The plugin arg2p bundles it with the skills of Arg2P, to formalize problems as theories, solve them and explore their results. In Claude Code:

/plugin install arg2p --marketplace tuProlog/arg2p-kt

Codex and ChatGPT read the same repository (codex plugin marketplace add tuProlog/arg2p-kt), any agent reading Agent Skills takes the skills alone (npx skills add tuProlog/arg2p-kt), and a release attaches them as zips for claude.ai. The server alone runs from the Python package with uv, in any MCP client:

{
  "mcpServers": {
    "arg2p": { "command": "uvx", "args": ["arg2p", "mcp"] }
  }
}

In VS Code, the extension registers it, nothing to configure. See AI assistants and the plugin.


Issue tracking

If you encounter any issues, please report them on the GitHub Issues page.
Your feedback helps improve the project!


References

Arg2P is described in:

  • Roberta Calegari, Andrea Omicini, Giuseppe Pisano, Giovanni Sartor. Arg2P: an argumentation framework for explainable intelligent systems. Journal of Logic and Computation, 32(2):369–401, 2022. doi:10.1093/logcom/exab089
  • Giuseppe Pisano. Argumentation for legal reasoning: meta-models, technology and beyond. PhD thesis, Alma Mater Studiorum — Università di Bologna, 2024. doi:10.48676/unibo/amsdottorato/11671

Individual features — burden of persuasion, defeasible preferences, modularity, causality, distributed reasoning — have their own papers, listed on the References page of the wiki.

Cite me

If you use Arg2P in academic work, please cite:

@article{arg2p,
  author  = {Calegari, Roberta and Omicini, Andrea and Pisano, Giuseppe and Sartor, Giovanni},
  title   = {{Arg2P}: an argumentation framework for explainable intelligent systems},
  journal = {Journal of Logic and Computation},
  volume  = {32},
  number  = {2},
  pages   = {369--401},
  year    = {2022},
  doi     = {10.1093/logcom/exab089}
}
@phdthesis{pisano2024argumentation,
  author  = {Pisano, Giuseppe},
  title   = {Argumentation for legal reasoning: meta-models, technology and beyond},
  school  = {Alma Mater Studiorum --- Universit\`a di Bologna},
  year    = {2024},
  doi     = {10.48676/unibo/amsdottorato/11671}
}

Questions fréquentes

Qu'est-ce que Arg2P ?

Structured argumentation: solve ASPIC+, ABA and abstract theories, explore their results

Comment installer Arg2P ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add arg2p -- uvx arg2p==0.20.0 mcp. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Arg2P ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

Arg2P est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Arg2P ?

Il est publié par tuProlog. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.