Skip to content

Execution Requirements

constraint(...) expresses execution requirements.

It is separate from env(...): environment describes physical conditions, while constraints describe how execution should be performed.

Block Form

text
with constraint(gentle, preserve_boundary) {
    target << [source:5uL];
}

The block form applies requirements to the statements inside the block.

Single-Step Form

text
target << [source:5uL] with constraint(gentle);

This is equivalent to wrapping that single statement in a constraint block.

Trailing with is only for constraints. It is not used for env(...).

Requirement Names

Requirements are flat names in source code.

Examples:

CategoryRequirements
Structure preservationpreserve_boundary, preserve_layering, preserve_fraction_order
Contamination controlaseptic, low_carryover, cross_contam_control
Material integritygentle, avoid_resuspension, avoid_shear, preserve_viability
Environmental protectioncold_chain, dark_protected, controlled_atmosphere
Quantitative qualityhigh_precision, low_loss, quantitative_recovery
Measurement qualitystabilized_reading, low_noise, noninvasive

Customized Constraints

Use customized with a schema when a requirement does not fit the named set.

text
let req_schema = data_schema(label = "CustomRequirement", fields = [target_state]);

with constraint(customized, schema_ref = req_schema) {
    target << [source:5uL];
}

customized is exclusive: do not mix it with standard requirements in the same constraint list.

Compatibility

Constraint compatibility is checked semantically. For example, a requirement may be valid for transfer but not for an unrelated operation family.

Released under the Apache-2.0 license.