pub enum Formula {
True,
AtLeast {
signal: usize,
threshold: f64,
},
AtMost {
signal: usize,
threshold: f64,
},
Not(Box<Formula>),
And(Vec<Formula>),
Or(Vec<Formula>),
Always {
from: usize,
to: usize,
formula: Box<Formula>,
},
Eventually {
from: usize,
to: usize,
formula: Box<Formula>,
},
Until {
from: usize,
to: usize,
left: Box<Formula>,
right: Box<Formula>,
},
}Expand description
An STL formula over signals indexed 0...
Variants§
True
Always true (ρ = +∞).
AtLeast
x_signal ≥ threshold.
AtMost
x_signal ≤ threshold.
Not(Box<Formula>)
Negation.
And(Vec<Formula>)
Conjunction; empty is True.
Or(Vec<Formula>)
Disjunction; empty is false (-∞).
Always
G[from, to] φ: φ holds at every step of the window.
Fields
Eventually
F[from, to] φ: φ holds at some step of the window.
Fields
Until
φ U[from, to] ψ: ψ holds at some step of the window and φ at every step before.
Implementations§
Source§impl Formula
impl Formula
Sourcepub fn eventually(from: usize, to: usize, formula: Self) -> Self
pub fn eventually(from: usize, to: usize, formula: Self) -> Self
F[from, to] φ.
Sourcepub fn robustness<S: AsRef<[f64]>>(&self, trace: &[S]) -> f64
pub fn robustness<S: AsRef<[f64]>>(&self, trace: &[S]) -> f64
The robustness at the first step of trace.
Sourcepub fn violation<S: AsRef<[f64]>>(&self, trace: &[S]) -> f64
pub fn violation<S: AsRef<[f64]>>(&self, trace: &[S]) -> f64
The constraint violation max(0, -ρ) at the first step: 0 when satisfied.
Sourcepub fn signal<S: AsRef<[f64]>>(&self, trace: &[S], len: usize) -> Vec<f64>
pub fn signal<S: AsRef<[f64]>>(&self, trace: &[S], len: usize) -> Vec<f64>
The robustness at every step 0..len (steps past the trace see an empty future).
Sourcepub fn complexity(&self) -> usize
pub fn complexity(&self) -> usize
The number of nodes, the complexity term of fit().
Sourcepub fn thresholds(&self) -> Vec<f64>
pub fn thresholds(&self) -> Vec<f64>
The predicate thresholds in depth-first order: the parameters fit() tunes.
Sourcepub fn with_thresholds(&self, values: &[f64]) -> Self
pub fn with_thresholds(&self, values: &[f64]) -> Self
A copy with the thresholds replaced, in the order of Formula::thresholds; missing
values leave thresholds unchanged.