Operator

class Operator(val functor: String, val specifier: Specifier, val priority: Int) : Comparable<Operator> , TermConvertible

A logic (a.k.a. Prolog) operator declaration, associating a functor with a specifier (fixity and associativity) and a priority (lower binds tighter). Operators are what let a TermFormatter render, e.g., +(1, 2) as 1 + 2, and what an OperatorSet groups together for a parser or formatter to consult.

Constructors

Link copied to clipboard
constructor(functor: String, specifier: Specifier, priority: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The operator's functor, e.g. "+".

Link copied to clipboard

The operator's priority: the lower, the tighter it binds.

Link copied to clipboard

The operator's fixity/associativity, e.g. Specifier.YFX.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Operator): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun toTerm(): Struct

Converts this instance to a Prolog Term