pub enum ReductionStrategy {
WHNF,
NF,
OneStep,
CBV,
CBN,
HeadOnly,
}Expand description
Reduction strategy for expression simplification.
Different strategies trade off between completeness and efficiency.
Most use cases should use ReductionStrategy::WHNF or
ReductionStrategy::NF.
Variants§
WHNF
Reduce to weak head normal form.
Only reduces the outermost redex; sub-expressions may remain unreduced. Efficient for most type-checking purposes.
NF
Reduce to normal form.
Fully reduces all sub-expressions. More expensive than WHNF.
OneStep
Reduce exactly one step.
Finds and reduces the outermost leftmost redex.
CBV
Call-by-value reduction.
Evaluates arguments before applying functions (strict evaluation).
CBN
Call-by-name reduction.
Applies functions before evaluating arguments (lazy evaluation).
HeadOnly
Head reduction only.
Like OneStep but restricted to the head position.
Implementations§
Source§impl ReductionStrategy
impl ReductionStrategy
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if this strategy reduces to a complete normal form.
Trait Implementations§
Source§impl Clone for ReductionStrategy
impl Clone for ReductionStrategy
Source§fn clone(&self) -> ReductionStrategy
fn clone(&self) -> ReductionStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more