pub struct Reducer { /* private fields */ }Expand description
Reduction context with caching.
Implementations§
Source§impl Reducer
impl Reducer
Sourcepub fn with_max_depth(max_depth: u32) -> Self
pub fn with_max_depth(max_depth: u32) -> Self
Create a reducer with custom max depth.
Sourcepub fn set_transparency(&mut self, mode: TransparencyMode)
pub fn set_transparency(&mut self, mode: TransparencyMode)
Set the transparency mode.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache (call between declarations).
Sourcepub fn whnf(&mut self, expr: &Expr) -> Expr
pub fn whnf(&mut self, expr: &Expr) -> Expr
Reduce an expression to Weak Head Normal Form.
This implements all reduction rules except delta (which needs environment).
Sourcepub fn whnf_delta<F>(&mut self, expr: &Expr, lookup: &F) -> Expr
pub fn whnf_delta<F>(&mut self, expr: &Expr, lookup: &F) -> Expr
Reduce to WHNF with delta-reduction (constant unfolding).
This requires environment access to look up definitions.
Sourcepub fn whnf_env(&mut self, expr: &Expr, env: &Environment) -> Expr
pub fn whnf_env(&mut self, expr: &Expr, env: &Environment) -> Expr
Full WHNF with environment-aware reductions.
Performs: beta, zeta, delta, iota (recursor), projection, nat/string ops.
Sourcepub fn is_alpha_equiv(e1: &Expr, e2: &Expr) -> bool
pub fn is_alpha_equiv(e1: &Expr, e2: &Expr) -> bool
Check if two expressions are alpha-equivalent (syntactically equal).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reducer
impl RefUnwindSafe for Reducer
impl Send for Reducer
impl Sync for Reducer
impl Unpin for Reducer
impl UnsafeUnpin for Reducer
impl UnwindSafe for Reducer
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