Skip to content

Environment Application

Environment blocks bind execution conditions to enclosed steps.

text
with env(thermal = 37C, duration = 10min) {
    hold(sample = reactor);
}

Environment blocks describe operational conditions. They do not predict biological or chemical outcomes.

The public environment example is:

text
examples/minimal/public_env_readout.culs

Scalar Thermal Environment

Scalar thermal authoring uses a temperature and a duration.

text
with env(thermal = 37C, duration = 10min) {
    hold(sample = reactor);
}

For scalar thermal = ..., duration is required.

Pure Hold

Use hold(sample = ...) when the intended action is to keep a sample under the environment condition.

text
with env(thermal = 37C, duration = 10min) {
    hold(sample = reactor);
}

Rules:

  • hold(sample = ...) is only valid inside with env.
  • A pure hold block must write hold(...) explicitly.
  • An empty with env(...) {} block is not valid.
  • In a pure hold block, hold(...) is the only body statement.

Thermal Programs

For programmatic thermal control, use thermal_program(...).

text
let ramp = thermal_program(from = 60C, to = 95C, duration = 350s);

with env(thermal = ramp) {
    hold(sample = reactor);
}

Supported source shapes:

text
thermal_program(from = 37C, duration = 120min)
thermal_program(from = 60C, to = 95C, duration = 350s)

thermal_program(...) defines a single thermal segment. It does not carry cycles or staged PCR logic by itself. Multi-segment workflows compose thermal programs with explicit control flow.

When thermal is a thermal_program(...), the outer with env(...) must not also define duration.

Field Environment

Environment can also bind a field condition:

text
with env(field = mz_separation) {
    ...
}

Field environments do not use the scalar thermal duration rule.

Thermal Modifiers

co2 and rh are thermal-environment modifiers.

They require thermal and are not valid when thermal is a thermal_program(...).

Body Semantics

The body of with env(...) { ... } executes once in lexical order. If work must repeat, use an explicit repeat.

An environment block scopes execution conditions. It does not mean "simulate what happens biologically during this time."

Released under the Apache-2.0 license.