pub struct RecursorVal {
pub common: ConstantVal,
pub all: Vec<Name>,
pub num_params: u32,
pub num_indices: u32,
pub num_motives: u32,
pub num_minors: u32,
pub rules: Vec<RecursorRule>,
pub k: bool,
pub is_unsafe: bool,
}Expand description
Recursor (eliminator) declaration value.
Fields§
§common: ConstantValCommon fields.
all: Vec<Name>All inductive types in mutual declaration.
num_params: u32Number of parameters.
num_indices: u32Number of indices.
num_motives: u32Number of motive arguments.
num_minors: u32Number of minor premises (one per constructor).
rules: Vec<RecursorRule>Reduction rules (one per constructor).
k: boolWhether this supports K-like reduction.
is_unsafe: boolWhether this is unsafe.
Implementations§
Source§impl RecursorVal
impl RecursorVal
Sourcepub fn get_major_idx(&self) -> u32
pub fn get_major_idx(&self) -> u32
Get the index of the major premise in the recursor’s arguments.
The major premise is the argument being eliminated. Position: nparams + nmotives + nminors + nindices
Sourcepub fn get_first_index_idx(&self) -> u32
pub fn get_first_index_idx(&self) -> u32
Get the total number of arguments before the major premise.
Sourcepub fn get_rule(&self, ctor: &Name) -> Option<&RecursorRule>
pub fn get_rule(&self, ctor: &Name) -> Option<&RecursorRule>
Find the reduction rule for a given constructor.
Trait Implementations§
Source§impl Clone for RecursorVal
impl Clone for RecursorVal
Source§fn clone(&self) -> RecursorVal
fn clone(&self) -> RecursorVal
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 RecursorVal
impl Debug for RecursorVal
Source§impl PartialEq for RecursorVal
impl PartialEq for RecursorVal
impl StructuralPartialEq for RecursorVal
Auto Trait Implementations§
impl Freeze for RecursorVal
impl RefUnwindSafe for RecursorVal
impl Send for RecursorVal
impl Sync for RecursorVal
impl Unpin for RecursorVal
impl UnsafeUnpin for RecursorVal
impl UnwindSafe for RecursorVal
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