HeadVariablesOutsideNonNegatedLiterals

A AbstractClauseVisitor that collects the Vars occurring in a clause's head which do not also occur in one of its non-negated body literals — i.e. the offending variables that would make it.unibo.tuprolog.datalog.allHeadVariablesInNonNegatedLiterals false. Variables inside negated body literals (ClauseVisitor's negated-literal visit path) are deliberately ignored when collecting "positive" variables, since a negated goal does not bind anything.

clause.accept(HeadVariablesOutsideNonNegatedLiterals) returns the empty set for a well-formed clause, and the set of unsafe head variables otherwise.

Functions

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

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

Link copied to clipboard
open fun visitIndicator(term: Indicator): Set<Var>
Link copied to clipboard
open fun visitInteger(term: Integer): Set<Var>
Link copied to clipboard
open fun visitList(term: List): Set<Var>
Link copied to clipboard
open override fun visitLiteral(literal: Struct): Set<Var>

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

Link copied to clipboard
open override fun visitNegatedLiteral(literal: Struct): Set<Var>

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): Set<Var>

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

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