Solution
A type representing a solution to a goal, as produced by it.unibo.tuprolog.solve.Solver.solve.
Every Solution is one of three sealed subtypes, distinguished by isYes/isNo/isHalt (and matched exhaustively via whenIs):
Yes -- the goal succeeded, with solvedQuery and a Substitution.Unifier as substitution;
No -- the goal failed, substitution is Substitution.Fail and solvedQuery is
null;Halt -- resolution was aborted by a ResolutionException, carried in exception.
Construct instances via the companion's yes, no, halt factories.
Inheritors
Properties
The exception that made resolution halt, if this is a Halt solution, or null otherwise
The Struct representing the solution, or null in case of a non-successful solution
The substitution that has been applied to find the solution, or a failed substitution
Functions
Returns a Solution equivalent to this one, but with every variable not occurring in query (nor bound, in substitution, to a variable occurring in query) removed from substitution. Useful to drop resolution-internal variables before presenting a solution to a user.