Compiler from GUARD constraint DSL to FLUX-C bytecode.
constraint coolant_temp: -40.0 <= x <= 150.0 severity CAUTION
constraint rpm: 0.0 <= x <= 8000.0 severity CRITICAL
constraint battery_voltage: 10.5 <= x <= 15.0 severity WARNING
GUARD is a small language for defining numeric constraints. Each constraint has:
- A name
- Lower and upper bounds
- A severity level (PASS / CAUTION / WARNING / CRITICAL)
The compiler turns these into FLUX-C bytecode that the flux-vm executes.
git clone https://github.com/SuperInstance/guardc-v3
cd guardc-v3
cargo build --release
cargo testguardc compile constraints.guard -o output.fluxguardc preset automotive_can -o auto.fluxGUARD source
↓ Lexer
Tokens
↓ Parser
AST (constraint definitions)
↓ Codegen
FLUX-C bytecode (60 opcodes)
↓ Proof module
SHA-256 source hash (anchors the proof chain)
10 industry presets with realistic constraint sets. Each preset compiles to valid FLUX-C bytecode:
guardc list-presets
# automotive_can, aviation_adsb, medical_fhir, financial_fix,
# energy_scada, iot_mqtt, maritime_nmea, nuclear_reactor,
# railway_ertms, roboticsconstraint <name>: <lo> <= x <= <hi> severity <level>
name: identifier (letters, digits, underscore)lo,hi: floating-point literalslevel:PASS|CAUTION|WARNING|CRITICAL
constraint engine_rpm: 0.0 <= x <= 8000.0 severity CRITICAL
constraint coolant_temp: -40.0 <= x <= 150.0 severity CAUTION
constraint battery_voltage: 10.5 <= x <= 15.0 severity WARNING
constraint throttle_pos: 0.0 <= x <= 100.0 severity CAUTION
constraint fuel_level: 0.0 <= x <= 100.0 severity PASS
constraint speed_kmh: 0.0 <= x <= 300.0 severity WARNING
running 22 tests
test result: ok. 22 passed; 0 failed; 0 ignored
| If you want to... | Go to... |
|---|---|
| Execute the compiled bytecode | flux-vm-v3 |
| See the full constraint ecosystem | constraint-theory-ecosystem |
| Use standalone fracture in Rust | flux-fracture |
| Use standalone fracture in C | flux-fracture-c |
MIT