MCPcopy Create free account
hub / github.com/argumentcomputer/ix / classify_aux_gen

Function classify_aux_gen

crates/compile/src/decompile.rs:1924–1985  ·  view source on GitHub ↗

Classify an aux_gen constant by suffix, returning (kind, root_inductive). The root inductive is the base inductive the auxiliary is derived from.

(name: &Name)

Source from the content-addressed store, hash-verified

1922
1923 let ctor_result =
1924 decompile_constructor(ctor, &ctor_meta, name.clone(), cache, stt, dstt);
1925
1926 cache.meta_sharing = saved_meta_sharing;
1927 cache.univ_patches = saved_univ_patches;
1928 cache.refs.truncate(refs_len);
1929 cache.univ_table = saved_univ_table;
1930
1931 let ctor_val = ctor_result?;
1932 ctor_names.push(ctor_val.cnst.name.clone());
1933 ctors.push(ctor_val);
1934 }
1935
1936 let cnst = ConstantVal { name, level_params, typ };
1937
1938 let ind_val = InductiveVal {
1939 cnst,
1940 num_params: Nat::from(ind.params),
1941 num_indices: Nat::from(ind.indices),
1942 all,
1943 ctors: ctor_names,
1944 num_nested: Nat::from(0u64),
1945 is_rec: false,
1946 is_reflexive: false,
1947 is_unsafe: ind.is_unsafe,
1948 };
1949
1950 Ok((ind_val, ctors))
1951}
1952
1953/// Decompile an Axiom.
1954fn decompile_axiom(
1955 ax: &Axiom,
1956 meta: &ConstantMeta,
1957 cache: &mut BlockCache,
1958 stt: &CompileState,
1959 dstt: &DecompileState,
1960) -> Result<LeanConstantInfo, DecompileError> {
1961 let cnst = decompile_const_val(&ax.typ, meta, cache, stt, dstt)?;
1962 Ok(LeanConstantInfo::AxiomInfo(AxiomVal { cnst, is_unsafe: ax.is_unsafe }))
1963}
1964
1965/// Decompile a Quotient.
1966fn decompile_quotient(
1967 quot: &Quotient,
1968 meta: &ConstantMeta,
1969 cache: &mut BlockCache,
1970 stt: &CompileState,
1971 dstt: &DecompileState,
1972) -> Result<LeanConstantInfo, DecompileError> {
1973 let cnst = decompile_const_val(&quot.typ, meta, cache, stt, dstt)?;
1974 Ok(LeanConstantInfo::QuotInfo(QuotVal { cnst, kind: quot.kind }))
1975}
1976
1977// ===========================================================================
1978// Mutual block decompilation
1979// ===========================================================================
1980
1981/// Decompile a mutual block (Vec<MutConst>).

Callers 2

is_aux_gen_suffixFunction · 0.85
decompile_envFunction · 0.85

Calls 3

last_strMethod · 0.80
as_dataMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected