TestSolver
The main, comprehensive conformance suite for a Solver implementation: control-flow constructs (conjunction, disjunction, if-then(-else), cut, call/1, catch/3, not/\+), timeouts, side effects (assert, write, standard output, findall/3), and a battery of classic Prolog examples (search trees, backtracking, recursive list processing, term ordering, etc.) drawn from PrologStandardExampleTheories and TestingClauseTheories.
Packaging it here lets every Solver implementation run the very same test cases without re-authoring or duplicating them: a concrete :solve-classic/:solve-streams/:solve-concurrent module declares a commonTest class implementing both this interface and its own SolverFactory, obtains a prototype via TestSolver.prototype, and delegates each overridden test method to it, e.g.:
class TestClassicSolver : TestSolver, SolverFactory by ClassicSolverFactory {
private val prototype = TestSolver.prototype(this)
@Test
override fun testTrue() = prototype.testTrue()
// ... one such override per test method declared here
}(see TestClassicSolver in :solve-classic for the full example). Because callErrorSignature, nafErrorSignature and notErrorSignature differ slightly across implementations (e.g. whether not/1 or \+/1 is used to report an error), they are supplied as constructor parameters to prototype rather than hard-coded.
Properties
The Signature expected in errors raised while resolving a goal through call/1.
A long test max duration, four times mediumDuration; used for queries involving deeper search or recursion.
A medium test max duration, twice shortDuration; used for queries involving a handful of resolution steps.
The Signature expected in errors raised while resolving a goal through \+/1 (negation as failure).
The Signature expected in errors raised while resolving a goal through not/1.
A short test max duration, used for queries expected to resolve almost immediately.
Functions
Test presence of correct built-ins
Call primitive testing with callTestingGoalsToSolutions and callStandardExampleTheoryGoalsToSolution
A test in which all testing goals are called through the Call primitive
Call primitive testing with catchTestingGoalsToSolutions and catchAndThrowTheoryExampleNotableGoalToSolution
A test in which all testing goals are called through the Catch primitive
A test with all goals used in conjunction with true or fail to test Conjunction properties
Halt primitive testing with haltTestingGoalsToSolutions
Test with ifThen1ToSolution
Test with ifThen2ToSolution
Test with ifThenElse1ToSolution
Test with ifThenElse2ToSolution
If-Then-Else rule testing with ifThenElseStandardExampleNotableGoalToSolution
If-Then rule testing with ifThenStandardExampleTheoryNotableGoalToSolution
A test in which all testing goals are called through the Not rule
Not rule testing with notStandardExampleTheoryNotableGoalToSolution
Test with simpleCutTheoryNotableGoalToSolutions
Test with lessThan500MsGoalToSolution
Test with slightlyMoreThan500MsGoalToSolution
Test with slightlyMoreThan600MsGoalToSolution
Test with slightlyMoreThan700MsGoalToSolution
Test with simpleFactTheoryNotableGoalToSolutions