pub struct StructInfo {
pub mk: String,
pub num_params: usize,
pub projections: Vec<String>,
pub params: Vec<(String, Term)>,
pub fields: Vec<(String, Term)>,
pub parents: Vec<String>,
pub out_params: Vec<usize>,
}Expand description
Metadata for a registered structure (record): its single constructor, how many leading type PARAMETERS it takes, the projection function names in field order, and the declaration shape the elaborator needs — the parameter and field telescopes, the parents recovered from a flattened field prefix, and which parameters are OUTPUTS.
Fields§
§mk: StringThe constructor name (e.g. Prod_mk).
num_params: usizeNumber of leading type parameters (e.g. 2 for Prod A B).
projections: Vec<String>Projection definition names, in field order (e.g. [Prod_fst, Prod_snd]).
params: Vec<(String, Term)>The parameter telescope, (name, type) in order — [(A, Type 0), (B, Type 0)]
for Prod. Kept so a later declaration can be compared against this one.
fields: Vec<(String, Term)>The field telescope, (name, type) in order. A field type may mention the
parameters and any EARLIER field by name.
parents: Vec<String>Structures this one EXTENDS, recovered from its flattened field list: a previously
declared structure over the identical parameter telescope whose whole field list is
a strict prefix of this one’s. See Context::add_structure.
out_params: Vec<usize>Parameter positions that are OUTPUTS — determined BY a resolved instance rather than
matched against (Lean’s outParam). Inferred at declaration; overridable with
Context::set_out_params.
Trait Implementations§
Source§impl Clone for StructInfo
impl Clone for StructInfo
Source§fn clone(&self) -> StructInfo
fn clone(&self) -> StructInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more