TestStackTrace

Conformance tests for a resolution exception's logicStackTrace: the sequence of goal Signatures active when the exception was raised, from the innermost failing goal to the top-level query. All test cases share the same three-rule theory foo(X) :- bar(X). bar(X) :- baz(X). baz(X) :- <errorExpression>., varying only the innermost <errorExpression> and the query wrapping foo(X). Shared by every Solver implementation via the TestStackTrace.prototype(solverFactory) factory (see TestClassicStackTrace 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 testDoubleStackTrace()

Same theory as testSimpleStackTrace, but with the query wrapped in findall(X, foo(X), L); the resulting logicStackTrace gains one extra findall/3 frame between foo/1 and the top-level ?-/1.

Link copied to clipboard
abstract fun testSimpleStackTrace()

Tests the query

Link copied to clipboard

Same query as testTripleStackTrace, but with baz/1's body replaced by throw(x): the resulting halt is a SystemError wrapping the uncaught x, and its logicStackTrace does not include a frame for throw/1 itself — only [baz/1, bar/1, foo/1, bagof/3, findall/3, ?-/1] — since a throw/1 call does not push a stack frame the way a user-defined goal invocation does.

Link copied to clipboard
abstract fun testTripleStackTrace()

Same theory as testSimpleStackTrace, but with the query wrapped in findall(X, bagof(Z, foo(Z), X), L); the resulting logicStackTrace gains both a bagof/3 and a findall/3 frame, in that order, between foo/1 and the top-level ?-/1.