pub struct PolynomialInterpretation {
pub interpretations: HashMap<String, Vec<i64>>,
}Expand description
A polynomial interpretation for proving termination of a TRS.
Each function symbol f of arity n is mapped to a polynomial
p_f(x_1, …, x_n) with natural-number coefficients. A TRS is terminating
if for every rule l → r, the polynomial interpretation satisfies
Pol(l) > Pol(r) (as natural numbers for all assignments ≥ 0).
Fields§
§interpretations: HashMap<String, Vec<i64>>Maps function symbol names to their polynomial coefficients.
For a unary symbol the vector [c0, c1] represents c0 + c1 * x1.
For a binary symbol [c0, c1, c2] represents c0 + c1x1 + c2x2.
Constants (arity 0) are represented as [c0].
Implementations§
Source§impl PolynomialInterpretation
impl PolynomialInterpretation
Sourcepub fn set(&mut self, symbol: impl Into<String>, coefficients: Vec<i64>)
pub fn set(&mut self, symbol: impl Into<String>, coefficients: Vec<i64>)
Register an interpretation for symbol f: coefficients [c0, c1, …].
Sourcepub fn eval(&self, t: &Term, assignment: &[i64]) -> i64
pub fn eval(&self, t: &Term, assignment: &[i64]) -> i64
Evaluate the polynomial interpretation of term t given variable assignment.
Variable Var(i) maps to assignment[i].
Sourcepub fn orients_rule(&self, rule: &Rule, max_val: i64) -> bool
pub fn orients_rule(&self, rule: &Rule, max_val: i64) -> bool
Check whether rule lhs → rhs is oriented by this interpretation for
all variable assignments in [0, max_val]^n.
Sourcepub fn proves_termination(&self, trs: &Trs, max_val: i64) -> bool
pub fn proves_termination(&self, trs: &Trs, max_val: i64) -> bool
Check whether this interpretation proves termination of the given TRS (all rules are strictly oriented for assignments in [0, max_val]^n).
Trait Implementations§
Source§impl Clone for PolynomialInterpretation
impl Clone for PolynomialInterpretation
Source§fn clone(&self) -> PolynomialInterpretation
fn clone(&self) -> PolynomialInterpretation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more