Companion

object Companion

Properties

Link copied to clipboard
const val FUNCTOR: String

The canonical clause functor: :- (same as Clause.FUNCTOR).

Functions

Link copied to clipboard
fun of(head: Struct, body: Iterable<Term>): Rule
fun of(head: Struct, body: Sequence<Term>): Rule

fun of(head: Struct, vararg body: Term): Rule

Creates a Rule with the given head and body goals (folded into a single Term via Tuple when there is more than one). If body is empty, or reduces to a single true goal, a Fact is returned instead of a generic Rule.

Link copied to clipboard
fun template(functor: String, arity: Int): Rule

Creates a Rule template: a head with functor and arity anonymous-variable arguments, and an anonymous-variable body (matching anything). See Struct.template.