it.unibo.tuprolog.core

package it.unibo.tuprolog.core

Classes

Name Description
interface Atom: Struct, Constant, Any
interface Clause: Struct, Any
interface Collection: Struct, Any
interface Cons: List, Any
interface Constant: Term, Any
interface Directive: Clause, Any
interface Empty: Atom, Any
interface EmptyList: Empty, List, Any
interface EmptySet: Empty, Set, Any
interface Fact: Rule, Any
interface Formatter<T> : Any

A type for objects encapsulating some logic to convert any object of type T into a String

interface Indicator: Struct, Any

A predicate indicator is used to denote predicates or functors.

It is a ground term of the form Name/Arity where Name is an Atom denoting the name of a predicate or a functor and Arity is a non-negative Integer denoting the number of its arguments.

Examples: sumlist/2, '.'/2, '/'/2, animal/1, '1'/0.

interface Integer: Numeric, Any
interface List: Collection, Any
interface Numeric: Constant, Any
interface Real: Numeric, Any
interface Rule: Clause, Any
interface Scope: Any
interface Set: Collection, Any
interface Struct: Term, Any
sealed class Substitution: Map<Var, Term>, Any

An interface representing a mapping between Variables and their Term substitutions

interface Term: Comparable<Term>, Any

Base type for all logic terms. Terms are immutable tree-like data structures.

interface TermComparator<T : Term> : Any
interface TermFormatter: Formatter<Term>, TermVisitor<String>, Any

A particular sort of Formatters aimed at representing terms

interface TermVisitor<T> : Any
interface ToTermConvertible: Any

An interface to be implemented by types convertible to Prolog Terms

interface Truth: Atom, Any
interface Tuple: Collection, Any
interface Var: Term, Any

Methods

prepareForExecution

fun Clause.prepareForExecution(): Clause

Prepares the receiver Clause for execution, using the provided visitor

For example, the Clause product(A) :- A, A is transformed, after preparation for execution, as the Term: product(A) :- call(A), call(A)

Receiver

Name Description
Clause

ReturnValue

Name Description
Clause

prepareForExecution

fun Clause.prepareForExecution(unifier: Unifier): Clause

Receiver

Name Description
Clause

Parameters

Name Description
unifier: Unifier

ReturnValue

Name Description
Clause

toTerm

fun BigInteger.toTerm(): Integer

Receiver

Name Description
BigInteger

ReturnValue

Name Description
Integer

toTerm

fun Sequence<Term>.toTerm(): List

Receiver

Name Description
Sequence<Term>

ReturnValue

Name Description
List

format

fun <T> T.format(formatter: Formatter<T>): String

Receiver

Name Description
T

Parameters

Name Description
formatter: Formatter<T>

ReturnValue

Name Description
String

toTerm

fun Float.toTerm(): Real

Receiver

Name Description
Float

ReturnValue

Name Description
Real

toTerm

fun Double.toTerm(): Real

Receiver

Name Description
Double

ReturnValue

Name Description
Real

toTerm

fun Int.toTerm(): Integer

Receiver

Name Description
Int

ReturnValue

Name Description
Integer

toTerm

fun Long.toTerm(): Integer

Receiver

Name Description
Long

ReturnValue

Name Description
Integer

toTerm

fun Short.toTerm(): Integer

Receiver

Name Description
Short

ReturnValue

Name Description
Integer

toTerm

fun Byte.toTerm(): Integer

Receiver

Name Description
Byte

ReturnValue

Name Description
Integer

toTerm

fun Number.toTerm(): Numeric

Receiver

Name Description
Number

ReturnValue

Name Description
Numeric

toTerm

fun String.toTerm(): Term

Receiver

Name Description
String

ReturnValue

Name Description
Term

toAtom

fun String.toAtom(): Atom

Receiver

Name Description
String

ReturnValue

Name Description
Atom

toVar

fun String.toVar(): Var

Receiver

Name Description
String

ReturnValue

Name Description
Var

toTerm

fun List<Term>.toTerm(): List

Receiver

Name Description
List<Term>

ReturnValue

Name Description
List

toTerm

fun Iterable<Term>.toTerm(): List

Receiver

Name Description
Iterable<Term>

ReturnValue

Name Description
List

toTerm

fun Array<Term>.toTerm(): List

Receiver

Name Description
Array<Term>

ReturnValue

Name Description
List