TermObjectifier

An Objectifier of Terms, implemented as a TermVisitor so that every Term sub-type is converted into a plain object following a fixed, format-agnostic scheme. This scheme is what lets a TermSerializer render any Term as JSON, YAML, or XML.

The scheme used by the platform-provided implementations (default) is, informally:

A TermDeobjectifier recognizes exactly this shape, so deobjectifier.deobjectify(objectifier.objectify(term)) round-trips (up to variable renaming and numeric literal formatting).

See also

for the inverse conversion.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun defaultValue(term: Term): Any
Link copied to clipboard
open override fun objectify(value: Term): Any

Converts a single value into a plain object.

Link copied to clipboard
abstract fun objectifyMany(values: Iterable<Term>): Any
open fun objectifyMany(values: Sequence<Term>): Any
open fun objectifyMany(vararg values: Term): Any

Converts several values into a single plain object representing all of them.

Link copied to clipboard
open fun visitAtom(term: Atom): Any
Link copied to clipboard
open fun visitBlock(term: Block): Any
Link copied to clipboard
open fun visitClause(term: Clause): Any
Link copied to clipboard
open fun visitCollection(term: Recursive): Any
Link copied to clipboard
open fun visitCons(term: Cons): Any
Link copied to clipboard
open fun visitConstant(term: Constant): Any
Link copied to clipboard
open fun visitDirective(term: Directive): Any
Link copied to clipboard
open fun visitEmpty(term: Empty): Any
Link copied to clipboard
open fun visitEmptyBlock(term: EmptyBlock): Any
Link copied to clipboard
open fun visitEmptyList(term: EmptyList): Any
Link copied to clipboard
open fun visitFact(term: Fact): Any
Link copied to clipboard
open fun visitIndicator(term: Indicator): Any
Link copied to clipboard
open fun visitInteger(term: Integer): Any
Link copied to clipboard
open fun visitList(term: List): Any
Link copied to clipboard
open fun visitNumeric(term: Numeric): Any
Link copied to clipboard
open fun visitReal(term: Real): Any
Link copied to clipboard
open fun visitRule(term: Rule): Any
Link copied to clipboard
open fun visitStruct(term: Struct): Any
Link copied to clipboard
open fun visitTerm(term: Term): Any
Link copied to clipboard
open fun visitTruth(term: Truth): Any
Link copied to clipboard
open fun visitTuple(term: Tuple): Any
Link copied to clipboard
open fun visitVar(term: Var): Any