Companion

object Companion

Properties

Link copied to clipboard
const val FUNCTOR: String

The canonical tuple functor: ,

Functions

Link copied to clipboard
fun of(terms: List<Term>): Tuple

Creates a right-nested Tuple out of terms.

fun of(left: Term, right: Term): Tuple

Creates a Tuple with left and right as its two direct arguments.

fun of(first: Term, second: Term, vararg others: Term): Tuple

Creates a right-nested Tuple out of first, second, and others.

Link copied to clipboard
fun wrapIfNeeded(terms: Iterable<Term>, ifEmpty: () -> Term = { Truth.TRUE }): Term
fun wrapIfNeeded(terms: Sequence<Term>, ifEmpty: () -> Term = { Truth.TRUE }): Term

fun wrapIfNeeded(vararg terms: Term, ifEmpty: () -> Term = { Truth.TRUE }): Term

Wraps terms into a single Term: returns ifEmpty's result if terms is empty, the sole element if terms has exactly one, or a Tuple otherwise. Used, in particular, to fold a Clause's body goals into a single Term.