pub enum Term {
Show 17 variants
Var(String),
Unit,
Pair(Box<Term>, Box<Term>),
LetPair(String, String, Box<Term>, Box<Term>),
Abs(String, Box<Term>),
App(Box<Term>, Box<Term>),
Inl(Box<Term>),
Inr(Box<Term>),
Case(Box<Term>, String, Box<Term>, String, Box<Term>),
Trivial,
Fst(Box<Term>),
Snd(Box<Term>),
Abort(Box<Term>),
Promote(Box<Term>),
Derelict(Box<Term>),
Discard(Box<Term>, Box<Term>),
Copy(Box<Term>, String, String, Box<Term>),
}Expand description
Linear λ-terms extracted from proofs.
These terms correspond to the computational content of linear logic proofs via the Curry-Howard correspondence.
Variants§
Var(String)
Variable reference
Unit
Unit value ()
Pair(Box<Term>, Box<Term>)
Pair (a, b)
LetPair(String, String, Box<Term>, Box<Term>)
Let pair: let (x, y) = e in e’
Abs(String, Box<Term>)
Abstraction: λx. e
App(Box<Term>, Box<Term>)
Application: e e’
Inl(Box<Term>)
Left injection: inl e
Inr(Box<Term>)
Right injection: inr e
Case(Box<Term>, String, Box<Term>, String, Box<Term>)
Case analysis: case e of inl x => e1 | inr y => e2
Trivial
Trivial value (unit for &)
Fst(Box<Term>)
First projection: fst e
Snd(Box<Term>)
Second projection: snd e
Abort(Box<Term>)
Abort (for 0): absurd e
Promote(Box<Term>)
Promote: !e (mark as copyable)
Derelict(Box<Term>)
Derelict: use !e as regular e
Discard(Box<Term>, Box<Term>)
Discard: discard e in e’
Copy(Box<Term>, String, String, Box<Term>)
Copy: copy e as (x, y) in e’
Implementations§
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
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