Getting Started

This page takes you from nothing to a first working evaluation. If you only want to try the framework out, start with the IDE — it needs no project setup at all.


Try it without installing anything

Two ready-made environments run Arg2P without any configuration:

  • the Web Playground, which runs entirely in your browser;
  • the desktop IDE, a single executable jar. Download arg2p-ide-0.16.3-redist.jar from the latest release and run it:
java -jar arg2p-ide-0.16.3-redist.jar

Both accept a theory, run queries against it, draw the resulting argumentation graph and let you change the flags interactively.


Your first theory

Arg2P reasons about theories made of rules that can conflict with each other. Here are two premises that support opposite conclusions:

f1 :=> d.
f2 :=> -d.

:=> introduces a defeasible premise, and - is strong negation. So this theory says: there is a reason to believe d, and a reason to believe the opposite. Neither wins, and argumentation tells us precisely that.

Ask the engine what it makes of d:

?- arg2p::solve(d, Res).

Res = [und(d)]

d is undecided: it is supported by an argument, that argument is attacked by the one for -d, and neither defeats the other. Add a preference between the two premises:

f1 :=> d.
f2 :=> -d.
sup(f1, f2).

and the answer changes:

?- arg2p::solve(d, Res).

Res = [in(d)]

f1 is now stronger, so its argument defeats the other and d is accepted.

Both versions can be run without installing anything: the first one and the one with the preference.

The Language page describes the full syntax: strict rules, undercutting, obligations and permissions, burden of persuasion.


Using it from Kotlin

Add the dependency:

repositories {
    mavenCentral()
}

dependencies {
    implementation("it.unibo.tuprolog.argumentation:arg2p-jvm:0.16.3")
}

Then evaluate a theory and read the labelling:

import it.unibo.tuprolog.argumentation.core.Arg2pSolverFactory
import it.unibo.tuprolog.argumentation.core.libs.basic.FlagsBuilder

fun main() {
    val graph = Arg2pSolverFactory.evaluate(
        """
        f1 :=> d.
        f2 :=> -d.
        """.trimIndent(),
        FlagsBuilder(),
    ).first()

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

which prints:

und : '-'(d)
und : d

Both conclusions are undecided, and the negated one is printed in canonical term form, '-'(d).

The Kotlin API page covers configuration, the result model and how to embed Arg2P in an existing 2P-Kt solver.


Using it from JavaScript

{
  "dependencies": {
    "@tuprolog/arg2p": "0.16.3"
  }
}
const arg2p = require('@tuprolog/arg2p').it.unibo.tuprolog.argumentation.bridge.JsBridge

const graph = arg2p.solve('arg2p::solve', `
    f1 :=> d.
    f2 :=> -d.`, `
    graphBuildMode(standard_af).
    statementLabellingMode(statement).
    argumentLabellingMode(grounded).
    orderingPrinciple(last).
    orderingComparator(elitist).
    graphExtension(standardPref).
    queryMode.`, _ => { }).i.next().graph

graph.arguments.forEach(arg => console.log(`${arg.label} : ${arg.descriptor}`))

See JavaScript API for the full bridge.


Where to go next

If you want to…Read
Learn the theory languageLanguage
Know which queries you can askAPI & Flags
Change semantics or preferencesFlags Reference
Evaluate a plain abstract frameworkAbstract Evaluation
See complete, runnable theoriesExamples
Understand the engine’s structureModules
Fix something that went wrongTroubleshooting