Struct weresocool_ast::operations::NormalForm
source · pub struct NormalForm {
pub operations: Vec<Vec<PointOp>>,
pub length_ratio: Rational64,
}
Expand description
All operations in the language take a NormalForm as an import and return a NormalForm.
Fields§
§operations: Vec<Vec<PointOp>>
§length_ratio: Rational64
Implementations§
source§impl NormalForm
impl NormalForm
sourcepub fn init() -> NormalForm
pub fn init() -> NormalForm
Creates a NormalForm with a single PointOp in the operations and sets the appropriate length_ratio.
sourcepub fn init_empty() -> NormalForm
pub fn init_empty() -> NormalForm
Creates a NormalForm with empty operations and set the length_ratio to zero.
sourcepub fn fmap_mut(&mut self, f: impl Fn(&mut PointOp))
pub fn fmap_mut(&mut self, f: impl Fn(&mut PointOp))
Applys function ‘f’ to every PointOp in the NormalForm
sourcepub fn fmap_with_state(&self, f: impl FnMut(&PointOp))
pub fn fmap_with_state(&self, f: impl FnMut(&PointOp))
Applys function ‘f’ to every PointOp in the NormalForm with an impl FnMut allows a mutable function to be passed in.
sourcepub fn solo_ops_by_name(&mut self, name: &str)
pub fn solo_ops_by_name(&mut self, name: &str)
Given a name, solos that name by calling op.silence() on every op that doesn’t have that name in their NameSet.
pub fn partition(&self, name: String) -> (NormalForm, NormalForm)
Trait Implementations§
source§impl Clone for NormalForm
impl Clone for NormalForm
source§fn clone(&self) -> NormalForm
fn clone(&self) -> NormalForm
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NormalForm
impl Debug for NormalForm
source§impl GetLengthRatio<Term> for NormalForm
impl GetLengthRatio<Term> for NormalForm
fn get_length_ratio( &self, _normal_form: &NormalForm, _defs: &mut Defs<Term> ) -> Result<Rational64, Error>
source§impl Hash for NormalForm
impl Hash for NormalForm
source§impl Mul<NormalForm> for NormalForm
impl Mul<NormalForm> for NormalForm
§type Output = NormalForm
type Output = NormalForm
The resulting type after applying the
*
operator.source§fn mul(self, other: NormalForm) -> NormalForm
fn mul(self, other: NormalForm) -> NormalForm
Performs the
*
operation. Read moresource§impl MulAssign<&NormalForm> for NormalForm
impl MulAssign<&NormalForm> for NormalForm
source§fn mul_assign(&mut self, other: &NormalForm)
fn mul_assign(&mut self, other: &NormalForm)
Performs the
*=
operation. Read moresource§impl Normalize<Term> for NormalForm
impl Normalize<Term> for NormalForm
fn apply_to_normal_form( &self, input: &mut NormalForm, _defs: &mut Defs<Term> ) -> Result<(), Error>
source§impl PartialEq<NormalForm> for NormalForm
impl PartialEq<NormalForm> for NormalForm
source§fn eq(&self, other: &NormalForm) -> bool
fn eq(&self, other: &NormalForm) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Substitute<Term> for NormalForm
impl Substitute<Term> for NormalForm
fn substitute( &self, _normal_form: &mut NormalForm, _defs: &mut Defs<Term> ) -> Result<Term, Error>
impl Eq for NormalForm
impl StructuralEq for NormalForm
impl StructuralPartialEq for NormalForm
Auto Trait Implementations§
impl RefUnwindSafe for NormalForm
impl Send for NormalForm
impl Sync for NormalForm
impl Unpin for NormalForm
impl UnwindSafe for NormalForm
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.