Struct term_rewriting::TRS [−][src]
A first-order term rewriting system.
Fields
rules: Vec<Rule>
Methods
impl TRS
[src]
impl TRS
pub fn new(rules: Vec<Rule>) -> TRS
[src]
pub fn new(rules: Vec<Rule>) -> TRS
Constructs a term rewriting system from a list of rules.
pub fn make_deterministic<R: Rng>(&mut self, rng: &mut R) -> bool
[src]
pub fn make_deterministic<R: Rng>(&mut self, rng: &mut R) -> bool
Make self
deterministic and restrict it to be so until further notice.
Return true
if self
was changed, otherwise false
.
pub fn make_nondeterministic(&mut self) -> bool
[src]
pub fn make_nondeterministic(&mut self) -> bool
Remove any determinism restriction self
might be under.
Return true
if self
was changed, otherwise false
.
pub fn is_deterministic(&self) -> bool
[src]
pub fn is_deterministic(&self) -> bool
Report whether self
is currently deterministic.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
The number of rules in the TRS.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Are there any rules in the TRS?
pub fn size(&self) -> usize
[src]
pub fn size(&self) -> usize
Return the number of total number of subterms across all rules.
pub fn display(&self, sig: &Signature) -> String
[src]
pub fn display(&self, sig: &Signature) -> String
A serialized representation of the TRS.
pub fn pretty(&self, sig: &Signature) -> String
[src]
pub fn pretty(&self, sig: &Signature) -> String
A human-readable serialization of the TRS.
pub fn clauses(&self) -> Vec<Rule>
[src]
pub fn clauses(&self) -> Vec<Rule>
All the clauses in the TRS.
pub fn operators(&self) -> Vec<Operator>
[src]
pub fn operators(&self) -> Vec<Operator>
All the operators in the TRS
pub fn unifies(trs1: TRS, trs2: TRS) -> bool
[src]
pub fn unifies(trs1: TRS, trs2: TRS) -> bool
Do two TRSs unify?
pub fn pmatches(trs1: TRS, trs2: TRS) -> bool
[src]
pub fn pmatches(trs1: TRS, trs2: TRS) -> bool
Does one TRS match another?
pub fn alphas(trs1: &TRS, trs2: &TRS) -> bool
[src]
pub fn alphas(trs1: &TRS, trs2: &TRS) -> bool
Are two TRSs alpha equivalent?
pub fn rewrite(&self, term: &Term) -> Option<Vec<Term>>
[src]
pub fn rewrite(&self, term: &Term) -> Option<Vec<Term>>
Perform a single rewrite step using a normal-order (leftmost-outermost) rewrite strategy.
pub fn get(&self, lhs: &Term) -> Option<(usize, Rule)>
[src]
pub fn get(&self, lhs: &Term) -> Option<(usize, Rule)>
pub fn get_idx(&self, idx: usize) -> Option<Rule>
[src]
pub fn get_idx(&self, idx: usize) -> Option<Rule>
pub fn get_clause(&self, rule: &Rule) -> Option<(usize, Rule)>
[src]
pub fn get_clause(&self, rule: &Rule) -> Option<(usize, Rule)>
Query a TRS
for specific Rule
clauses; return them if possible.
pub fn remove(&mut self, lhs: &Term) -> Result<Rule, TRSError>
[src]
pub fn remove(&mut self, lhs: &Term) -> Result<Rule, TRSError>
pub fn remove_idx(&mut self, idx: usize) -> Result<Rule, TRSError>
[src]
pub fn remove_idx(&mut self, idx: usize) -> Result<Rule, TRSError>
pub fn remove_clauses(&mut self, rule: &Rule) -> Result<Rule, TRSError>
[src]
pub fn remove_clauses(&mut self, rule: &Rule) -> Result<Rule, TRSError>
pub fn insert(&mut self, idx: usize, rule: Rule) -> Result<&mut TRS, TRSError>
[src]
pub fn insert(&mut self, idx: usize, rule: Rule) -> Result<&mut TRS, TRSError>
pub fn insert_idx(
&mut self,
idx: usize,
rule: Rule
) -> Result<&mut TRS, TRSError>
[src]
pub fn insert_idx(
&mut self,
idx: usize,
rule: Rule
) -> Result<&mut TRS, TRSError>
Insert a Rule
at index i
in the TRS
if possible.
pub fn insert_clauses(&mut self, rule: &Rule) -> Result<&mut TRS, TRSError>
[src]
pub fn insert_clauses(&mut self, rule: &Rule) -> Result<&mut TRS, TRSError>
pub fn push(&mut self, rule: Rule) -> Result<&mut TRS, TRSError>
[src]
pub fn push(&mut self, rule: Rule) -> Result<&mut TRS, TRSError>
Insert new Rule
clauses if possible and move the entire Rule
if
necessary to be the first in the TRS
.
pub fn pushes(&mut self, rules: Vec<Rule>) -> Result<&mut TRS, TRSError>
[src]
pub fn pushes(&mut self, rules: Vec<Rule>) -> Result<&mut TRS, TRSError>
a series of Rule
s at the beginning of the TRS
if possible.
pub fn move_rule(&mut self, i: usize, j: usize) -> Result<&mut TRS, TRSError>
[src]
pub fn move_rule(&mut self, i: usize, j: usize) -> Result<&mut TRS, TRSError>
Move a Rule
from index i
to j
if possible.
pub fn replace(
&mut self,
idx: usize,
rule1: &Rule,
rule2: Rule
) -> Result<&mut TRS, TRSError>
[src]
pub fn replace(
&mut self,
idx: usize,
rule1: &Rule,
rule2: Rule
) -> Result<&mut TRS, TRSError>
Trait Implementations
impl Debug for TRS
[src]
impl Debug for TRS
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for TRS
[src]
impl Hash for TRS
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for TRS
[src]
impl Clone for TRS
fn clone(&self) -> TRS
[src]
fn clone(&self) -> TRS
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for TRS
[src]
impl PartialEq for TRS
fn eq(&self, other: &TRS) -> bool
[src]
fn eq(&self, other: &TRS) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TRS) -> bool
[src]
fn ne(&self, other: &TRS) -> bool
This method tests for !=
.
impl Eq for TRS
[src]
impl Eq for TRS