Engine Interface

All the predicates below belong to the arg2p module, and the recommended way to call them is through the module prefix — arg2p::solve(Goal, Res), arg2p::buildLabelSets(...) and so on. The unqualified form works too where arg2p is a static library, as in the solvers of Arg2pSolver.default(), but the qualified one states where the predicate comes from and keeps working if your own theory defines a predicate with the same name.

The engine can be queried in two ways:

buildLabelSets.

build and prints (in the output and graph tabs) both the argument and statement labellings according to the provided theory. This predicate is also available in two others versions:

buildLabelSets(StatementIN, StatementOUT, StatementUND).

returning the statements labelling divided in the three sets IN, OUT and UND;

buildLabelSets([StatementIN, StatementOUT, StatementUND], [ArgumentIN, ArgumentOUT, ArgumentUND]).

returning both the statements and arguments labelling divided in the three sets IN, OUT and UND;

Try it — a small theory evaluated with buildLabelSets/3.

Alternatively, the framework can be queried with:

answerQuery(Goal, In, Out, Und).

allowing to query the engine about a given Goal. The result are collected in the In, Out, Und lists respectively.

Try it

Two shorter forms are available as well:

answerQuery(Goal, Res).

collecting the outcome as a list of in/1, out/1 or und/1 terms, and

answerQuery(Goal).

which runs the evaluation for Goal and succeeds only if Goal is labelled IN: use answerQuery/2 or answerQuery/4 to learn the label of a goal that is not.

Other entry points

buildLabelSetsSilent.

performs a complete evaluation without printing anything. This is the predicate used by the Kotlin evaluate helper, and the one to use when the results are read programmatically rather than displayed.

solve.            % same as buildLabelSetsSilent
solve(Goal).      % same as answerQuery(Goal)
solve(Goal, Res). % same as answerQuery(Goal, Res)

are shorthands for the predicates above.

argTuProlog.

succeeds when the Arg2P library is loaded — useful to check that a solver was assembled correctly.

Flags

The behaviour of the resolution process is controlled by flags. They can be written directly in the theory, set from Kotlin through FlagsBuilder, or edited in the Flags panel of the playground.

graphBuildMode, argumentLabellingMode, statementLabellingMode, orderingPrinciple and orderingComparator always need a value; everything else is optional. The complete list — accepted values, defaults, and the flags that can only be written in a theory — is on the Flags Reference page.