pub enum CoqTerm {
Show 17 variants
Var(String),
App(Box<CoqTerm>, Vec<CoqTerm>),
Lambda(Vec<(String, CoqTerm)>, Box<CoqTerm>),
Forall(Vec<(String, CoqTerm)>, Box<CoqTerm>),
Prod(Box<CoqTerm>, Box<CoqTerm>),
Let(String, Option<Box<CoqTerm>>, Box<CoqTerm>, Box<CoqTerm>),
Match(Box<CoqTerm>, Option<String>, Vec<CoqBranch>),
Fix(Vec<CoqFixPoint>),
Sort(CoqSort),
Hole,
Num(i64),
Str(String),
Cast(Box<CoqTerm>, Box<CoqTerm>),
Explicit(Box<CoqTerm>),
Tuple(Vec<CoqTerm>),
List(Vec<CoqTerm>),
IfThenElse(Box<CoqTerm>, Box<CoqTerm>, Box<CoqTerm>),
}Expand description
Gallina term AST.
Variants§
Var(String)
Variable or qualified name: nat, List.length, Nat.add
App(Box<CoqTerm>, Vec<CoqTerm>)
Application: f a b c
Lambda(Vec<(String, CoqTerm)>, Box<CoqTerm>)
Lambda abstraction: fun (x : T) (y : U) => body
Forall(Vec<(String, CoqTerm)>, Box<CoqTerm>)
Universal quantifier: forall (x : T), P x
Prod(Box<CoqTerm>, Box<CoqTerm>)
Non-dependent function type: T -> U
Let(String, Option<Box<CoqTerm>>, Box<CoqTerm>, Box<CoqTerm>)
Let binding: let x [: T] := rhs in body
Match(Box<CoqTerm>, Option<String>, Vec<CoqBranch>)
Pattern match: match scrutinee [as name] with | ... end
Fix(Vec<CoqFixPoint>)
(Mutual) fixpoint: fix f (n : nat) ... := body
Sort(CoqSort)
Universe sort: Prop, Set, Type
Hole
Hole / unification variable: _
Num(i64)
Integer literal: 0, 42, -1
Str(String)
String literal: "hello"
Cast(Box<CoqTerm>, Box<CoqTerm>)
Coercion / type ascription: (term : T)
Explicit(Box<CoqTerm>)
Implicit argument: @f (explicit application)
Tuple(Vec<CoqTerm>)
Tuple/pair: (a, b) (syntactic sugar for pair a b)
List(Vec<CoqTerm>)
List literal: [a; b; c]
IfThenElse(Box<CoqTerm>, Box<CoqTerm>, Box<CoqTerm>)
If-then-else: if b then t else f
Implementations§
Trait Implementations§
impl StructuralPartialEq for CoqTerm
Auto Trait Implementations§
impl Freeze for CoqTerm
impl RefUnwindSafe for CoqTerm
impl Send for CoqTerm
impl Sync for CoqTerm
impl Unpin for CoqTerm
impl UnsafeUnpin for CoqTerm
impl UnwindSafe for CoqTerm
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