Predicates

Predicates let you embed comparisons, set membership, and typed constraints directly in a boolean expression.

Overview

A predicate is an atomic comparison involving a typed variable: age >= 18, region in {CA, US}, or tier == "gold". Logic Studio treats each unique predicate as a boolean atom — it's either true or false for any given input value.

Predicates are useful for modelling real-world gate logic where the inputs are not simple booleans but scalars, enumerations, or set memberships.

Feature-flag expression with predicates — the left panel shows Predicate Variables for age and region, each with type badges and predicate chips.
The feature-flag example. The Predicate Variables section shows age (with predicate age >= 18) and region (with predicate region in {CA, US, UK}).

Predicate syntax

Write predicates inline in the expression, wrapping in parentheses:

can_buy = (age >= 18) & (tier in {gold, platinum}) & !banned;

Supported operators

OperatorApplies toExample
==number, string, enumstatus == "active"
!=number, string, enumcountry != "banned"
<numberage < 18
<=numberscore <= 100
>numberbalance > 0
>=numberage >= 18
inenum, stringregion in {CA, US, UK}
not-inenum, stringcountry not-in {IR, KP}
Limitation
Each predicate compares one variable with a literal or literal set. Use separate predicates joined by Boolean operators to build a rule. Sets are literal lists of values; set union and intersection are outside the expression syntax.

Variable types

The Predicate Variables section in the left panel shows each predicate variable with a type badge. Click + to declare a type. Until you do, the badge can show UNTYPED. Available declarations include:

These annotations describe value buckets in the Predicate Variables controls. Write required integer bounds in the expression itself.

Buckets

For a typed variable, Logic Studio generates buckets — mutually exclusive, collectively exhaustive value ranges that make each predicate constant. The Predicate Variables controls use buckets to describe values. The standard Truth Table still enumerates independent Boolean predicate columns.

For a numeric variable with predicates age < 18 and age >= 21, the buckets are:

Enum variables enumerate each value in the declared value list plus an "other" bucket.

Contradictions & subsumption

Two common integer-predicate relationships are:

Use SMT/Z3 to check integer contradictions, or compare the original and reduced rules in Equiv Diff.

Limitations

SMT reasoning uses integer comparisons and integer-literal sets. String and enum predicates remain independent Boolean inputs. Decimal real-number reasoning is outside this model.

The standard Truth Table and QM simplifier use independent predicate columns. For a numeric relationship such as age < 18 and age >= 18, use SMT/Z3.