BinaryRelation

abstract class BinaryRelation<E : ExecutionContext>(operator: String) : PrimitiveWrapper<E>

Base class to implement primitives that relate two Terms and provide a single response, sparing implementers from manually pulling first/second out of Solve.Request.arguments and checking the request's arity (always 2, enforced by PrimitiveWrapper).

This class and its nested subclasses form a ladder of increasingly specific (and increasingly convenient) template methods to override, from most to least general:

See the it.unibo.tuprolog.solve.stdlib.primitive implementations (e.g. arithmetic comparisons) for concrete examples of each level.

Inheritors

Constructors

Link copied to clipboard
constructor(operator: String)

Types

Link copied to clipboard

A NonBacktrackable that only needs to produce a single Substitution, without custom side effects.

Link copied to clipboard
abstract class NonBacktrackable<E : ExecutionContext>(operator: String) : BinaryRelation<E>

A BinaryRelation known to be deterministic, i.e. producing exactly one Solve.Response (no choice points).

Link copied to clipboard

A NonBacktrackable that is a pure success/failure test, with no substitution nor side effects.

Link copied to clipboard
abstract class WithoutSideEffects<E : ExecutionContext>(operator: String) : BinaryRelation<E>

A BinaryRelation that only needs to produce the Substitutions for each solution, without custom side effects.

Properties

Link copied to clipboard

Gets this wrapped primitive description Pair formed by signature and wrapped primitive type

Link copied to clipboard

A shorthand to get the signature functor name

Link copied to clipboard

Checked primitive implementation

Link copied to clipboard