Value

sealed class Value

A Prolog term, as arg2p gives it (a statement, the binding of a variable, ...) and takes it: an Atom, an Integer, a Real, a Variable, a List or a compound term (Struct). A value is written as arg2p writes it, with its operators (-a, r1 : [a] => b); parse reads it back.

Inheritors

Types

Link copied to clipboard
data class Atom(val name: String) : Value

An atom, as a or 'Hello world'

Link copied to clipboard
object Companion
Link copied to clipboard
data class Integer(val value: Int) : Value

An integer (one beyond the range of 32 bits is a Real)

Link copied to clipboard
data class List(val items: ValueList) : Value

A list, as [a, b] ([] the empty one)

Link copied to clipboard
data class Real(val value: Double) : Value

A floating-point number

Link copied to clipboard
data class Struct(val functor: String, val args: ValueList) : Value

A compound term, as f(a, b) or -a

Link copied to clipboard
data class Variable(val name: String) : Value

A variable, by its name

Properties

Link copied to clipboard
abstract val kind: String

What the value is: atom, integer, real, variable, list or struct

Functions

Link copied to clipboard
open override fun toString(): String

The value as Prolog text, written with the operators of arg2p