Skip to content

Class: LogicConstraint

Represents a logical constraint or guard that must evaluate to true. Unlike a Goal/Call, this delegates to the expression evaluator rather than the predicate resolution engine.

Example

ts
baz(X) :- X > 4.  // "X > 4" is the Constraint

Constructors

Constructor

new LogicConstraint(expression, loc?): LogicConstraint

Parameters

ParameterType
expressionExpression
loc?SourceLocation

Returns

LogicConstraint

Overrides

ASTNode.constructor

Methods

getMetadata()

getMetadata<T>(key): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring

Returns

T

Inherited from

ASTNode.getMetadata


hasMetadata()

hasMetadata(key): boolean

Parameters

ParameterType
keystring

Returns

boolean

Inherited from

ASTNode.hasMetadata


setMetadata()

setMetadata(key, value): void

Parameters

ParameterType
keystring
valueany

Returns

void

Inherited from

ASTNode.setMetadata