TestTimeout

Conformance tests for Solver.solve(goal, maxDuration)'s timeout enforcement: checking that a computation exceeding its allotted it.unibo.tuprolog.solve.TimeDuration halts with a it.unibo.tuprolog.solve.exception.TimeOutException, both for a plainly slow goal (sleep/1) and for non-terminating all-solutions collectors (findall/3, bagof/3, setof/3) fed by an infinite generator. Shared by every Solver implementation via the TestTimeout.prototype(solverFactory) factory (see TestClassicTimeout in :solve-classic for a concrete usage).

Inheritors

Types

Link copied to clipboard
object Companion

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

Link copied to clipboard
abstract fun testInfiniteBagOf()

Same as testInfiniteFindAll, but with bagof(N, nat(N), L) in place of findall/3.

Link copied to clipboard
abstract fun testInfiniteFindAll()

Tests the query

Link copied to clipboard
abstract fun testInfiniteSetOf()

Same as testInfiniteFindAll, but with setof(N, nat(N), L) in place of findall/3.

Link copied to clipboard
abstract fun testSleep()

Tests the query