TestFlagsImpl

class TestFlagsImpl(solverFactory: SolverFactory) : TestFlags

Concrete implementation of TestFlags, instantiated via TestFlags.prototype.

Constructors

Link copied to clipboard
constructor(solverFactory: SolverFactory)

Properties

Link copied to clipboard

A long test max duration, four times mediumDuration; used for queries involving deeper search or recursion.

Link copied to clipboard

A medium test max duration, twice shortDuration; used for queries involving a handful of resolution steps.

Link copied to clipboard

A short test max duration, used for queries expected to resolve almost immediately.

Functions

Tests that the query

Tests that, by default (unique_solutions left off), member(X, [1, 1, 1]) yields three yes solutions (one per list element), even though they all carry the same solved-query term -- unaffected, standard behaviour.

Tests that, by default (show_wildcard_variables_in_solutions left on), a wildcard variable (e.g. _P) still appears in a yes solution's substitution -- unaffected, standard behaviour (see #980).

Tests that it.unibo.tuprolog.solve.flags.GroundQueriesHaveBooleanSolution's default value is off, and that the query

Link copied to clipboard

Tests that it.unibo.tuprolog.solve.flags.LastCallOptimization's default value is on, and that the query

Tests that it.unibo.tuprolog.solve.flags.ShowWildCardVariablesInSolutions's default value is on, and that the query

Link copied to clipboard
open override fun defaultUniqueSolutionsIsOff()

Tests that it.unibo.tuprolog.solve.flags.UniqueSolutions's default value is off, and that the query

Link copied to clipboard
open override fun defaultUnknownIsWarning()

Tests that it.unibo.tuprolog.solve.flags.Unknown's default value is warning, and that the query

Link copied to clipboard
open override fun flagsNamesMustBeAtoms()

Tests that every flag returned by current_flag(F, _) (with F unbound) is bound to an atom, and that passing a non-atom flag name (an integer, a compound, a float) to either current_flag/2 or set_flag/2 fails producing a type_error(atom, Name).

Link copied to clipboard

Tests that current_flag(F, X), with F unbound, enumerates on backtracking every flag currently set on the solver (each name bound to F, each value bound to X), matching the solver's flags map exactly.

Link copied to clipboard
open override fun gettingMissingFlagsFails()

Tests that, for flag names not present in a solver's default flags map (a, b, c), the query

Tests that, with show_wildcard_variables_in_solutions set to off, a wildcard variable (e.g. _P) is removed from a yes solution's substitution, while every other variable is kept -- fixing #980.

Tests that the query

Link copied to clipboard
open override fun settingMissingFlagsSucceeds()

Tests that, for flag names not present in a solver's default flags map (a, b, c), the query

Link copied to clipboard

Tests that, for every admissible value of the unknown flag, the query

Tests that, with unique_solutions set to on, member(X, [1, 1, 1]) yields a single yes solution (X = 1) instead of three, since the later two repeat the first one's solved-query term.