ARB models are YAML files with the .arb.yaml extension.
arb_version: 0.1
model: <model_name>
target:
rtos: zephyr
profile: static_c
safety_profile: <optional>
facts: [...]
modes: [...]
rules: [...]
actions: [...]- arb_version (required): Must be
0.1. - model (required): Model name, used in generated code identifiers.
- target (required): Target platform and profile.
- system (optional): System/item context for safety traceability.
- includes (optional): List of reusable ARB fragment files to import.
- facts (required): List of fact definitions.
- modes (optional): List of mode definitions.
- rules (required): List of rule definitions.
- actions (optional): List of action definitions.
Each fact represents a typed value in the reasoning context.
facts:
- id: sensor.temperature
type: int32 # bool | int32 | uint32 | enum
unit: millideg # optional, documentation only
range: [-40000, 125000] # optional, enforced at write time
default: 25000 # optional, initial value
source: sensor # optional, documentation
stale_after_ms: 100 # optional, staleness threshold
safety_relevant: true # optional, marks for safety analysisTypes: bool, int32, uint32, enum
Modes represent the system's state machine states.
modes:
- id: mode.idle
- id: mode.running
- id: mode.faultRules are the core reasoning elements. Each rule has conditions and consequences.
rules:
- id: "01_safety_guard"
class: safety_guard # safety_guard | mode_guard | inference |
# constraint | obligation | advisory
when:
all: # all | any
- fact: sensor.valid
op: "==" # == != < <= > >= in not_in stale
value: false # not_stale changed delta_gt delta_lt
then:
set_mode: mode.fault
action: emergency_stop
compute: # optional compute expressions
- target: output.value
op: assign # add sub mul div mod abs negate
left_literal: 0 # min max clamp shift_r shift_l
# scale assign accumulate
explanation: "Sensor fault detected."
criticality: safety_criticalsafety_guard— Evaluated first; effects take precedencemode_guard— State machine transitionsinference— Computational rulesconstraint— Invariant enforcementobligation— Required actionsadvisory— Non-critical informational
==, !=, <, <=, >, >=, in, not_in, stale, not_stale, changed, delta_gt, delta_lt
add, sub, mul, div, mod, abs, negate, min, max, clamp, shift_r, shift_l, scale, assign, accumulate
scale:target = (left * right) / scale— fixed-point multiplyaccumulate:target += (left * right) / scale— running sumclamp:target = clamp(left, right_literal=lo, scale=hi)- All arithmetic uses 64-bit widening; division by zero returns 0.
actions:
- id: emergency_stop
type: callback # callback | log | notify | set_fact |
# set_mode | raise_fault | clear_fault
symbol: app_emergency_stop # C function name (callback type)
must_complete_within_ms: 5 # optional timing constraint
safe_state_action: true # marks as safe-state actionReuse common fact/rule fragments from the include library:
includes:
- lib/arb/sensor_health.arb.yaml
- lib/arb/estop.arb.yamlModels can be validated against the JSON schema:
arbiterc validate model.arb.yaml --strictThe schema is at schema/arb.schema.json.