VBL BOUNDARY Expressions: Inline Evaluation Logic
When to Use a BOUNDARY Block
Section titled “When to Use a BOUNDARY Block”Named predicates are evaluated conjunctively: all must pass. This is sufficient for most boundaries:
predicate: creditworthy: credit_score >= 600predicate: affordable: debt_to_income_pct <= 40predicate: established: account_age_months >= 6When you need OR, NOT, or complex grouping, use a BOUNDARY block:
BOUNDARY { (oncall_approved == 1 AND steps_completed >= 1) OR NOT severity_level >= 1}BOUNDARY Block Syntax
Section titled “BOUNDARY Block Syntax”The BOUNDARY block contains inline field comparisons combined with logical operators:
BOUNDARY { confidence_level >= 80 AND severity IN ("HIGH", "CRITICAL") AND indicator_type IN @containable_threats AND (affected_systems <= 50 OR NOT critical_systems_impacted == 0)}The expression inside the block uses the same comparison operators, set membership, and containment operators available in predicates: but combined with OR, NOT, and parenthesized grouping.
Logical Operators
Section titled “Logical Operators”| Operator | Meaning | Precedence |
|---|---|---|
NOT |
Logical negation | Highest |
AND |
Logical conjunction | Middle |
OR |
Logical disjunction | Lowest |
Precedence
Section titled “Precedence”NOT binds tightest, then AND, then OR. Use parentheses to override:
BOUNDARY { (beneficiary_verified == 1 OR amount_cents < 100000) AND routing_valid == 1}Without parentheses, beneficiary_verified == 1 OR amount_cents < 100000 AND routing_valid == 1 would evaluate as beneficiary_verified == 1 OR (amount_cents < 100000 AND routing_valid == 1).
Inline Comparisons
Section titled “Inline Comparisons”The BOUNDARY expression contains inline field comparisons:
BOUNDARY { refund_amount_cents <= order_total_cents AND risk_score <= 30 AND (return_eligible == 1 OR (NOT order_total_cents >= 10000 AND refund_reason IN @auto_refund_reasons))}All operators available in predicates work inside BOUNDARY blocks: comparisons, IN, NOT IN, CONTAINS, boolean and string literals, and field-to-field comparisons.
Empty BOUNDARY
Section titled “Empty BOUNDARY”An empty BOUNDARY block is valid:
BOUNDARY { }Zero inline comparisons, always passes Stage 3. This is useful when the boundary only enforces admissibility and prohibition constraints.
Both Branches Evaluated
Section titled “Both Branches Evaluated”AND and OR expressions always evaluate both branches, regardless of the left-side result. This ensures deterministic instruction counting:
false AND expr:expris still evaluatedtrue OR expr:expris still evaluated
This differs from most programming languages where && and || short-circuit. The design ensures that evaluation timing does not depend on evidence values.
Predicates and BOUNDARY Together
Section titled “Predicates and BOUNDARY Together”Named predicates and BOUNDARY blocks are both evaluated in Stage 3. All named predicates must pass (conjunctively), and the BOUNDARY expression must also evaluate to true. Both must succeed for an ASSERT verdict.
Next Steps
Section titled “Next Steps”- Operators: all operators in detail
- Predicates: named conditions
- Examples: complete boundary examples
