Package it.unibo.tuprolog.solve.function

Types

Link copied to clipboard
abstract class AbstractEvaluator<E : ExecutionContext, T>(request: Solve.Request<E>, index: Int?)
Link copied to clipboard
class ArithmeticEvaluator<E : ExecutionContext>(request: Solve.Request<E>, index: Int?) : AbstractEvaluator<E, <ERROR CLASS>>

Evaluates an expression as a Numeric term. Throws a TypeError in case a non-evaluable sub-term is met. Throws a TypeError in case the evaluation produces a non-numeric term.

Link copied to clipboard
abstract class BinaryMathFunction(name: String) : MathFunction

Base class to implement unary math functions

Link copied to clipboard
sealed class Compute

A base class for Computation requests and responses

Link copied to clipboard
class ExpressionEvaluator<E : ExecutionContext>(request: Solve.Request<E>, index: Int? = null) : AbstractEvaluator<E, <ERROR CLASS>>

Evaluates a Term as an expression, w.r.t. the loaded functions provided through request. Throws a TypeError in case a non-evaluable sub-term is met.

Link copied to clipboard
class ExpressionReducer<E : ExecutionContext>(request: Solve.Request<E>, index: Int? = null) : AbstractEvaluator<E, <ERROR CLASS>>

Reduces a Term as an expression by evaluating all the evaluable sub-terms it contains w.r.t. the loaded functions provided through request. If the input expression is non-evaluable, it remains unaffected and no error is thrown

Link copied to clipboard
abstract class FunctionWrapper<C : ExecutionContext> : AbstractWrapper<LogicFunction>

A class wrapping a LogicFunction implementation

Link copied to clipboard
abstract class IntegersBinaryMathFunction(name: String) : BinaryMathFunction

Base class to implement math functions accepting only integers

Link copied to clipboard
fun interface LogicFunction

A typealias for a prolog function that accepts a Compute.Request and returns a Compute.Response

Link copied to clipboard
abstract class MathFunction : FunctionWrapper<ExecutionContext>

Base class to implement arithmetic functions

Link copied to clipboard
abstract class NullaryMathFunction(name: String) : MathFunction

Base class to implement nullary math functions (with no arguments)

Link copied to clipboard
abstract class UnaryMathFunction(name: String) : MathFunction

Base class to implement unary math functions

Functions

Link copied to clipboard
fun <ERROR CLASS>.evalAsArithmeticExpression(request: Solve.Request<*>, index: Int? = null): <ERROR CLASS>
Link copied to clipboard
fun <ERROR CLASS>.evalAsExpression(request: Solve.Request<*>, index: Int? = null): <ERROR CLASS>