pub type OTerm<'t, C> = Offset<&'t Term<C, usize>>;Expand description
Offset term.
Aliased Type§
pub struct OTerm<'t, C> { /* private fields */ }Implementations§
Source§impl<'t, C> OTerm<'t, C>
impl<'t, C> OTerm<'t, C>
Sourcepub fn whnf(self, sub: &Sub<'t, C>) -> Self
pub fn whnf(self, sub: &Sub<'t, C>) -> Self
Substitute the head of the term until a fix point is reached.
let mut sub: Sub<&str> = Sub::default();
sub.set_dom_max(3);
let tm0: Term<&str, _> = Term::V(0);
let tm1: Term<&str, _> = Term::V(1);
let ot0 = OTerm::new(2, &tm0);
let ot1 = OTerm::new(0, &tm1);
sub.insert(2, ot1);
// 0+2 should be substituted to 1+0 and terminate there
assert!(ot0.whnf(&sub).ptr_eq(ot1))