ClauseVisitor

interface ClauseVisitor<T> : TermVisitor<T>

A TermVisitor specialised for walking a Clause literal by literal, rather than term by term: instead of overriding TermVisitor.visitClause directly, implementors get separate hooks for the clause's head and for each body literal, further split into the negated (visitNegatedLiteral) and non-negated (visitNonNegatedLiteral) case — the very distinction the Datalog well-formedness checks in it.unibo.tuprolog.datalog are built on (see it.unibo.tuprolog.datalog.isNegated).

it.unibo.tuprolog.datalog.visitors.AbstractClauseVisitor is the base implementation that does the actual dispatching (head vs. body, negated vs. non-negated) on top of this interface; it.unibo.tuprolog.datalog.visitors.CompoundFinder is a concrete example.

Inheritors

Functions

Link copied to clipboard
abstract fun defaultValue(term: Term): T
Link copied to clipboard
open fun visitAtom(term: Atom): T
Link copied to clipboard
open fun visitBlock(term: Block): T
Link copied to clipboard
abstract override fun visitClause(term: Clause): T
Link copied to clipboard
open fun visitCollection(term: Recursive): T
Link copied to clipboard
open fun visitCons(term: Cons): T
Link copied to clipboard
open fun visitConstant(term: Constant): T
Link copied to clipboard
open fun visitDirective(term: Directive): T
Link copied to clipboard
open fun visitEmpty(term: Empty): T
Link copied to clipboard
open fun visitEmptyBlock(term: EmptyBlock): T
Link copied to clipboard
open fun visitEmptyList(term: EmptyList): T
Link copied to clipboard
open fun visitFact(term: Fact): T
Link copied to clipboard
open fun visitHead(head: Struct): T

Visits the head of a Clause (a no-op wrapper around visitLiteral by default).

Link copied to clipboard
open fun visitIndicator(term: Indicator): T
Link copied to clipboard
open fun visitInteger(term: Integer): T
Link copied to clipboard
open fun visitList(term: List): T
Link copied to clipboard
abstract fun visitLiteral(literal: Struct): T

Visits any literal (head or body) of a Clause, regardless of whether it is negated.

Link copied to clipboard
open fun visitNegatedLiteral(literal: Struct): T

Visits a body literal known to be negated, receiving the literal inside the not(...)/\+(...) wrapper (not the wrapper itself). Falls back to visitLiteral.

Link copied to clipboard
open fun visitNonNegatedLiteral(literal: Struct): T

Visits a body literal known not to be negated. Falls back to visitLiteral.

Link copied to clipboard
open fun visitNumeric(term: Numeric): T
Link copied to clipboard
open fun visitReal(term: Real): T
Link copied to clipboard
open fun visitRule(term: Rule): T
Link copied to clipboard
open fun visitStruct(term: Struct): T
Link copied to clipboard
open fun visitTerm(term: Term): T
Link copied to clipboard
open fun visitTruth(term: Truth): T
Link copied to clipboard
open fun visitTuple(term: Tuple): T
Link copied to clipboard
open fun visitVar(term: Var): T