Crate r2u2_core

Crate r2u2_core 

Source
Expand description

§Library for r2u2_core

R2U2: A stream-based runtime monitor written in #![no_std] that reasons over Mission-Time Linear Temporal Logic (MLTL) specifications compiled with the Configuration Compiler for Property Organization (C2PO).

§Optional Features:

§Usage:

  1. A monitor must be created utilizing get_monitor. The specification file from C2PO must be passed by reference as &[u8]. The specifications can later be updated with update_binary_file; this will also reset the monitor to its intial state.
  2. Signals must be loaded in according to the mapping specified when compiling the specification file through load_bool_signal, load_float_signal, load_int_signal, and load_string_signal.
  3. Run the monitor for a single timestep with monitor_step.
  4. Get output data through get_output_buffer and get_contract_buffer.
  5. Repeat steps 2-4. (Optionally check for overflow with the output of monitor_step or get_overflow_error.)

For details on compiling specifications with C2PO, refer to README.

Structs§

Monitor
Struct to contain monitor information
r2u2_contract
Struct to contain Assume-Guarantee Contract (AGC) verdicts (i.e., contract identification and status)
r2u2_output
Struct to contain output verdicts (i.e., specification identification and verdict)
r2u2_verdict
Struct to contain verdict-timestamp tuples

Constants§

AGC_INACTIVE
Assume-Guarantee Contract (AGC) inactive status
AGC_INVALID
Assume-Guarantee Contract (AGC) invalid status
AGC_VERIFIED
Assume-Guarantee Contract (AGC) verified status
R2U2_AUX_MAX_CONTRACTS
Number of assume-guarantee contract (AGC) auxilary information metadata blocks Represents maximum number of assume-guarantee contracts being monitored (only utilized when aux_string_specs feature is enabled)
R2U2_AUX_MAX_FORMULAS
Number of formula auxilary information metadata blocks Represents maximum number of formulas being monitored (only utilized when aux_string_specs feature is enabled)
R2U2_FLOAT_EPSILON
R2U2_MAX_ATOMICS
Represents maximum number of Booleans passed from the front-end (booleanizer or directly loaded atomics) to the temporal logic engine
R2U2_MAX_BZ_INSTRUCTIONS
Represents maximum number of booleanizer instructions
R2U2_MAX_OUTPUT_CONTRACTS
Represents maximum number of output contract statuses that can be returned at a single timestamp (only utilized when aux_string_specs feature is enabled)
R2U2_MAX_OUTPUT_VERDICTS
Represents maximum number of output verdicts that can be returned at a single timestamp
R2U2_MAX_QUEUE_SLOTS
Represents total number of SCQ slots for both future-time and past-time reasoning
R2U2_MAX_SIGNALS
Represents maximum number of input signals
R2U2_MAX_TL_INSTRUCTIONS
Represents maximum number of temporal logic instructions

Functions§

get_contract_buffer
Get Assume-Guarantee Contract (AGC) buffer
get_monitor
Get runtime monitor
get_output_buffer
Get output verdict buffer
get_overflow_error
Get overflow error flag
load_bool_signal
Load boolean signal
load_float_signal
Load float signals
load_int_signal
Load integer signal
load_string_signal
Load signal as string (decoded as integer, float, or boolean)
monitor_step
Take a step with runtime monitor
reset_overflow_error
Reset overflow flag
update_binary_file
Update specification binary file (and reset monitor)