Package it.unibo.tuprolog.solve.function

Types

AbstractEvaluator
Link copied to clipboard
common
abstract class AbstractEvaluator<E : ExecutionContext, T : Term>(request: Solve.Request<E>, index: Int?) : TermVisitor<T>
ArithmeticEvaluator
Link copied to clipboard
common
class ArithmeticEvaluator<E : ExecutionContext>(request: Solve.Request<E>, index: Int?) : AbstractEvaluator<E, Numeric>
Evaluates an expression as a Numeric term.
BinaryMathFunction
Link copied to clipboard
common
abstract class BinaryMathFunction(name: String) : MathFunction
Base class to implement unary math functions
Compute
Link copied to clipboard
common
sealed class Compute
A base class for Computation requests and responses
ExpressionEvaluator
Link copied to clipboard
common
class ExpressionEvaluator<E : ExecutionContext>(request: Solve.Request<E>, index: Int?) : AbstractEvaluator<E, Term>
Evaluates a Term as an expression, w.r.t.
ExpressionReducer
Link copied to clipboard
common
class ExpressionReducer<E : ExecutionContext>(request: Solve.Request<E>, index: Int?) : AbstractEvaluator<E, Term>
Reduces a Term as an expression by evaluating all the evaluable sub-terms it contains w.r.t.
FunctionWrapper
Link copied to clipboard
common
abstract class FunctionWrapper<C : ExecutionContext> : AbstractWrapper<PrologFunction>
A class wrapping a PrologFunction implementation
IntegersBinaryMathFunction
Link copied to clipboard
common
abstract class IntegersBinaryMathFunction(name: String) : BinaryMathFunction
Base class to implement math functions accepting only integers
MathFunction
Link copied to clipboard
common
abstract class MathFunction : FunctionWrapper<ExecutionContext>
Base class to implement arithmetic functions
NullaryMathFunction
Link copied to clipboard
common
abstract class NullaryMathFunction(name: String) : MathFunction
Base class to implement nullary math functions (with no arguments)
PrologFunction
Link copied to clipboard
common
typealias PrologFunction = (Compute.Request<ExecutionContext>) -> Compute.Response

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

UnaryMathFunction
Link copied to clipboard
common
abstract class UnaryMathFunction(name: String) : MathFunction
Base class to implement unary math functions

Functions

evalAsArithmeticExpression
Link copied to clipboard
common
fun Term.evalAsArithmeticExpression(request: Solve.Request<*>, index: Int? = null): Numeric
evalAsExpression
Link copied to clipboard
common
fun Term.evalAsExpression(request: Solve.Request<*>, index: Int? = null): Term
functionOf
Link copied to clipboard
common
fun functionOf(supportedSignature: Signature, uncheckedFunction: PrologFunction): PrologFunction
Creates a new PrologFunction, behaving exactly as given uncheckedFunction, but accepting only provided supportedSignature as Compute.Request signature, throwing IllegalArgumentException otherwise