Skip to content

VBL Operators: Comparison, Logical, and Set Operations

Operator Meaning Example
== Equal to status == 1
!= Not equal to risk_level != 0
> Greater than balance > 1000
< Less than score < 100
>= Greater than or equal to age >= 18
<= Less than or equal to amount <= 50000

Comparison operators work on:

  • Integer values: 64-bit signed integer arithmetic
  • String values: all six comparison operators (lexicographic ordering)
  • Boolean values: equality comparisons (==, !=) only
  • Field references: compare two workload fields: refund_amount <= order_total
predicate: sanctions_ok: sanctions_cleared == true
predicate: not_break_glass: is_break_glass == false

Boolean literals are lowercase: true and false.

predicate: read_only: access_level == "read_only"

All six comparison operators work on strings using lexicographic ordering.

predicate: dosage_safe: prescribed_mg <= max_daily_mg
predicate: refund_ok: refund_amount_cents <= order_total_cents

Both sides reference workload fields. The engine compares their values at evaluation time.

Operator Meaning Precedence
NOT Logical negation Highest
AND Logical conjunction Middle
OR Logical disjunction Lowest

All logical operators are non-short-circuiting: both branches of AND and OR are always evaluated for deterministic instruction counting.

Test whether a value belongs to a set:

field IN @set_name
field NOT IN @set_name

Named sets are defined with define_set and referenced with @:

define_set blocked_jurisdictions: ("NK", "IR", "SY", "CU")
predicate: not_blocked: destination_country NOT IN @blocked_jurisdictions

Inline literal sets are also valid:

predicate: severity_actionable: severity IN ("HIGH", "CRITICAL")

Test whether a list-valued field contains a scalar value:

field CONTAINS literal

Example:

predicate: has_required_approver: approver_list CONTAINS "compliance_officer"

From highest to lowest:

  1. NOT
  2. Comparison operators (==, !=, >, <, >=, <=), IN, NOT IN, CONTAINS
  3. AND
  4. OR

Use parentheses to override precedence when needed.