# `ExDatalog.Constraints.Membership`
[🔗](https://github.com/thanos/ex_datalog/blob/v0.5.0/lib/ex_datalog/constraints/membership.ex#L1)

Membership constraint implementation for the Constraint behaviour.

Evaluates membership constraints (`:member`) which filter bindings based
on whether a value is present in a constant list. The `left` operand must
be bound; the `right` operand must be a constant list. Returns `:filter`
when the value is not in the list or the left variable is unbound.

# `evaluate`

```elixir
@spec evaluate(
  ExDatalog.IR.Constraint.t(),
  ExDatalog.Engine.Binding.t(),
  ExDatalog.Constraint.Context.t()
) :: {:ok, ExDatalog.Engine.Binding.t()} | :filter
```

Evaluates a membership constraint against a binding environment.

Accepts an `IR.Constraint` struct as produced by the compiler. Returns
`{:ok, binding}` (unchanged) when the left value is a member of the
right list, or `:filter` when it is not or the left variable is unbound.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
