pub enum ProofTerm {
Unit,
Pair(Box<ProofTerm>, Box<ProofTerm>),
Fst(Box<ProofTerm>),
Snd(Box<ProofTerm>),
Inl(Box<ProofTerm>),
Inr(Box<ProofTerm>),
Lambda(String, Box<ProofTerm>),
App(Box<ProofTerm>, Box<ProofTerm>),
Pack(String, Box<ProofTerm>),
Unpack {
witness: String,
proof_var: String,
packed: Box<ProofTerm>,
body: Box<ProofTerm>,
},
Absurd(Box<ProofTerm>),
Var(String),
}Expand description
A proof term in the Curry-Howard correspondence. Each term witnesses a constructive proof of some proposition.
Variants§
Unit
Witness for ⊤ (unit).
Pair(Box<ProofTerm>, Box<ProofTerm>)
Witness for P ∧ Q (pair of proofs).
Fst(Box<ProofTerm>)
First projection of a pair (proof of P from proof of P ∧ Q).
Snd(Box<ProofTerm>)
Second projection of a pair (proof of Q from proof of P ∧ Q).
Inl(Box<ProofTerm>)
Left injection into a disjunction (proof of P ∨ Q from proof of P).
Inr(Box<ProofTerm>)
Right injection into a disjunction (proof of P ∨ Q from proof of Q).
Lambda(String, Box<ProofTerm>)
Lambda abstraction (proof of P → Q).
App(Box<ProofTerm>, Box<ProofTerm>)
Function application (modus ponens).
Pack(String, Box<ProofTerm>)
Existential witness packing (pack a witness with a proof).
Unpack
Existential witness unpacking.
Fields
Absurd(Box<ProofTerm>)
Proof by contradiction / ex falso quodlibet from ⊥.
Var(String)
Variable reference.
Trait Implementations§
impl Eq for ProofTerm
impl StructuralPartialEq for ProofTerm
Auto Trait Implementations§
impl Freeze for ProofTerm
impl RefUnwindSafe for ProofTerm
impl Send for ProofTerm
impl Sync for ProofTerm
impl Unpin for ProofTerm
impl UnsafeUnpin for ProofTerm
impl UnwindSafe for ProofTerm
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