pub struct InductiveMember {
pub name: String,
pub params: Vec<(String, Term)>,
pub sort: Term,
pub constructors: Vec<(String, Term)>,
pub full_constructors: bool,
}Expand description
One member of an Command::InductiveBlock.
The shape is the legacy Command::Inductive’s: the parameters are split out and bound by
name, and sort is the DECLARED arity after the parameters — its binders are the indices and
its final sort is the universe the type lives in; it refers to a parameter as the global of
that name.
A constructor is written one of two ways, the same for every constructor of a member:
full_constructors == false—C : T, whereTomits the parameter prefix and refers to a parameter as the global of its name; the registration puts the member’s parameters back;full_constructors == true—C (p₁ : T₁) … (pₙ : Tₙ) : T, the constructor RESTATING its parameter telescope, andconstructorsholds each FULL type, parameters bound as ordinary binders. The restated types may spell a parameter differently from the member (Lean’sHAdd.mkbindsγ : outParam (Type w)whereHAdd’s arity saysType w); the kernel’s block door checks them and registers the constructor exactly as written. A member with no parameters has one form only, and the flag isfalse.
Fields§
§name: String§params: Vec<(String, Term)>§sort: Term§constructors: Vec<(String, Term)>§full_constructors: boolTrait Implementations§
Source§impl Clone for InductiveMember
impl Clone for InductiveMember
Source§fn clone(&self) -> InductiveMember
fn clone(&self) -> InductiveMember
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InductiveMember
impl RefUnwindSafe for InductiveMember
impl Send for InductiveMember
impl Sync for InductiveMember
impl Unpin for InductiveMember
impl UnsafeUnpin for InductiveMember
impl UnwindSafe for InductiveMember
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