pub struct InductiveType {
pub name: Name,
pub univ_params: Vec<Name>,
pub num_params: u32,
pub num_indices: u32,
pub ty: Expr,
pub intro_rules: Vec<IntroRule>,
pub recursor: Name,
pub is_nested: bool,
pub is_prop: bool,
}Expand description
An inductive type declaration.
Fields§
§name: NameType name
univ_params: Vec<Name>Universe parameters
num_params: u32Number of parameters (non-varying arguments)
num_indices: u32Number of indices (varying arguments)
ty: ExprType of the inductive type (Pi type over params and indices)
intro_rules: Vec<IntroRule>Introduction rules (constructors)
recursor: NameRecursor name (generated automatically)
is_nested: boolWhether this is a nested inductive type
is_prop: boolWhether this type is in Prop (proof-irrelevant)
Implementations§
Source§impl InductiveType
impl InductiveType
Sourcepub fn new(
name: Name,
univ_params: Vec<Name>,
num_params: u32,
num_indices: u32,
ty: Expr,
intro_rules: Vec<IntroRule>,
) -> Self
pub fn new( name: Name, univ_params: Vec<Name>, num_params: u32, num_indices: u32, ty: Expr, intro_rules: Vec<IntroRule>, ) -> Self
Create a new inductive type.
Sourcepub fn is_recursive(&self) -> bool
pub fn is_recursive(&self) -> bool
Check if this inductive type is recursive.
Sourcepub fn constructor_names(&self) -> Vec<&Name>
pub fn constructor_names(&self) -> Vec<&Name>
Return a vector of references to constructor names.
Sourcepub fn num_constructors(&self) -> usize
pub fn num_constructors(&self) -> usize
Return the number of constructors.
Sourcepub fn to_constant_infos(
&self,
) -> (ConstantInfo, Vec<ConstantInfo>, ConstantInfo)
pub fn to_constant_infos( &self, ) -> (ConstantInfo, Vec<ConstantInfo>, ConstantInfo)
Generate ConstantInfo declarations for this inductive type.
Returns: (InductiveVal, Vec<ConstructorVal>, RecursorVal)
Trait Implementations§
Source§impl Clone for InductiveType
impl Clone for InductiveType
Source§fn clone(&self) -> InductiveType
fn clone(&self) -> InductiveType
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 moreSource§impl Debug for InductiveType
impl Debug for InductiveType
Source§impl PartialEq for InductiveType
impl PartialEq for InductiveType
impl StructuralPartialEq for InductiveType
Auto Trait Implementations§
impl Freeze for InductiveType
impl RefUnwindSafe for InductiveType
impl Send for InductiveType
impl Sync for InductiveType
impl Unpin for InductiveType
impl UnsafeUnpin for InductiveType
impl UnwindSafe for InductiveType
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