pub struct ProofNormalizer;Expand description
A minimal proof normalizer that applies beta reduction to proof terms.
In the kernel, proof terms are normalised before definitional equality checks to avoid spurious inequality due to un-reduced redexes.
Implementations§
Source§impl ProofNormalizer
impl ProofNormalizer
Sourcepub fn beta_reduce(term: &Expr) -> Expr
pub fn beta_reduce(term: &Expr) -> Expr
Beta-reduce a proof term to its normal form.
This is a simple structural pass that eliminates (fun x => body) arg
redexes by substituting arg for bound variable 0 in body.
Sourcepub fn subst_bvar(term: Expr, depth: u32, replacement: &Expr) -> Expr
pub fn subst_bvar(term: Expr, depth: u32, replacement: &Expr) -> Expr
Substitute replacement for bound variable depth in term.
This implements the standard capture-avoiding substitution for de Bruijn terms.
Sourcepub fn count_redexes(term: &Expr) -> usize
pub fn count_redexes(term: &Expr) -> usize
Count the number of beta-redexes remaining in a term.
Sourcepub fn is_beta_normal(term: &Expr) -> bool
pub fn is_beta_normal(term: &Expr) -> bool
Returns true if the term is already in beta-normal form (no redexes).
Auto Trait Implementations§
impl Freeze for ProofNormalizer
impl RefUnwindSafe for ProofNormalizer
impl Send for ProofNormalizer
impl Sync for ProofNormalizer
impl Unpin for ProofNormalizer
impl UnsafeUnpin for ProofNormalizer
impl UnwindSafe for ProofNormalizer
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