TypeEnsurer

Base class for unary predicates (arity 1) that always succeed if their argument is of the expected type, and throw otherwise, rather than merely testing and failing on mismatch (contrast with TypeTester). ensureType is expected to throw (typically a it.unibo.tuprolog.solve.exception.error.TypeError) on a mismatching term, and return normally otherwise.

Inheritors

Constructors

Link copied to clipboard
constructor(typeName: String)

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

Functions

Link copied to clipboard
abstract fun Solve.Request<E>.ensureType(context: E, term: Term)

Template method expected to throw if term does not have the expected type, and return normally otherwise.