predicate

A function or condition that answers true or false about a value, used to filter, search or check data.

In more detail

Predicates are passed to filters, searches and checks, such as the condition given to a filter function. In SQL a predicate is a condition tested on each row, such as price_cents < 4000, and it can also be unknown when a value is missing. Binary search can find where a monotone predicate first becomes true.

Examples

first_true(pred, lo, hi) finds the first integer where pred returns True.
tenant_id = current tenant added to every query
Java: the Predicate interface; value -> value % 2 != 0; User::active.
value -> value % 2 != 0

Related terms

Taught in

References

Certification courses