Troubleshooting
Common mistakes, and what they look like when they happen.
The evaluation never produces a graph
Symptom. A query silently fails, or graph() returns an empty graph.
Most often the theory is refused by its profile, or a flag has a value it does not take: the evaluation halts with
an error telling which (an Arg2pException, a halt solution of a goal); every flag has a default otherwise.
The other frequent cause is reading the graph before running a query: graph() mines the current evaluation
context, so a query such as arg2p::solve has to succeed first.
A hand-built solver behaves strangely
Symptom. Queries fail where they should succeed, or the flags seem ignored.
A solver assembled by hand has no flags: add the flags library (Flags.defaults().library().baseContent) to its
libraries, as in Building a solver by hand. Build it with
Arg2pPrologSolverFactory, the engine of Arg2P: the solver of 2P-Kt (PrologSolverFactory) runs the module calls
of Arg2P through a slower path. Arg2pSolverFactory does all of this for you.
Theory.parse rejects the theory
Symptom. A syntax error on a rule that looks perfectly valid.
Arg2P adds operators (=>, :=>, :->, :) that the default parser does not know. Parse with the Arg2P
operator set, with RuleAnnotations.parse (it also tags the clauses with the identifiers of their comments, for
plain Prolog theories):
val theory = RuleAnnotations.parse(theoryText, Arg2pSolver.default().operators())A goal using :: cannot be parsed
Symptom. Struct.parse("arg2p::solve(d, Res)") raises a syntax error.
:: is an operator defined by Arg2P, so the parser has to be told about it:
Struct.parse("arg2p::solve(d, Res)", solver.operators)The same applies to parsing a theory — see Kotlin API.
An invalid flag value
Symptom. You set a semantics and the evaluation raises an existence error.
Flag values are module identifiers, and an unknown value names no module: the error names the value. Check the spelling against
the Flags Reference — for instance the grounded semantics is grounded, and
there is no grounded_hash mode.
Only one labelling comes back
Symptom. Under preferred, stable, cf2 or stage2 you see a single result.
These semantics produce one solution per labelling. Taking first() on the sequence, or reading only the
first Prolog solution, discards the rest. Iterate over all solutions instead.
A causality query fails or raises a type error
In the causality module, ness/3 and ness_original/3 require their
first argument to be unbound. Passing a concrete intervention raises a type error; use
ness_intervention/2 for that instead.
A program using the distributed solver does not terminate
The actor solver runs non-daemon threads for the cluster. Call leave
when the work is done, or the JVM will stay alive.
Weak negation in a conclusion has no effect
Weak negation ~(Term) is negation by failure in the body of a rule. In a conclusion it is just a statement,
conflicting with nothing: to conclude the contrary of a statement, use strong negation -Term (which cannot be
nested).
Results change when preferences are enabled
This is expected: with graphExtension(standardPref) an attack only succeeds as a defeat if the attacker is
not weaker than its target, so some attacks disappear. The outcome also depends on orderingPrinciple and
orderingComparator. To evaluate without any preference handling, pass an empty extension list
(Flags.defaults().graphExtensions()).
Rationality postulates are not satisfied
Closure under transposition is on under the profiles aspic_plus (the default) and aspic, and off under the others,
or where the theory or the flags turn it off (autoTransposition(off).). Some postulates require it:
autoTransposition.Note that it enlarges the theory, since each strict rule gains its contrapositive variants.