feat(argus-semantics): finish quantitative semantics

The Boolean semantics are still incomplete. The decision to keep the
computations separate stays, as using the quantitative semantics for
Boolean values (while sound) interpolates in weird places.
May revisit this decision in the future
This commit is contained in:
Anand Balakrishnan 2023-08-29 18:16:52 -07:00
parent 28a79cb88c
commit ad9afb4eba
No known key found for this signature in database
7 changed files with 858 additions and 337 deletions

View file

@ -1,6 +1,5 @@
//! Traits to define semantics for temporal logic specifications
use argus_core::expr::{IsBoolExpr, IsNumExpr};
use argus_core::prelude::*;
/// A trace is a collection of signals
@ -50,13 +49,3 @@ pub trait Trace {
/// Query a signal using its name
fn get<T: 'static>(&self, name: &str) -> Option<&Signal<T>>;
}
/// Boolean semantics for a [`BoolExpr`] or type that is
/// convertable to a [`BoolExpr`]
pub trait BooleanSemantics: IsBoolExpr {
fn eval(&self, trace: &impl Trace) -> ArgusResult<Signal<bool>>;
}
pub trait QuantitativeSemantics: IsNumExpr {
fn eval(&self, trace: &impl Trace) -> ArgusResult<Signal<bool>>;
}