ExDatalog.Constraints.StringPredicate (ExDatalog v0.2.0)

Copy Markdown View Source

String predicate constraint implementation for the Constraint behaviour.

Evaluates string constraints (:starts_with, :contains) which filter bindings based on string relationships. Both operands must be bound and resolve to binaries (strings). Returns :filter if either operand is unbound or not a binary.

Summary

Functions

Evaluates a string predicate constraint against a binding environment.

Functions

evaluate(constraint, binding, context)

Evaluates a string predicate constraint against a binding environment.

Accepts an IR.Constraint struct as produced by the compiler. Returns {:ok, binding} (unchanged) when the predicate passes, or :filter when it fails or an input variable is unbound or not a binary.