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

Function decode_env

crates/ffi/src/lean_env.rs:1074–1109  ·  view source on GitHub ↗

Decode a Lean environment in parallel with hybrid caching.

(list: LeanList<LeanBorrowed<'_>>)

Source from the content-addressed store, hash-verified

1072 cnst: constant_val,
1073 induct,
1074 cidx,
1075 num_params,
1076 num_fields,
1077 is_unsafe,
1078 })
1079 },
1080 7 => {
1081 let inner = LeanIxRecursorVal::from_ctor(inner_obj.as_ctor());
1082 let constant_val = decode_constant_val(inner.get_obj(0), cache);
1083 let all: Vec<_> = collect_list_borrowed(inner.get_obj(1).as_list())
1084 .into_iter()
1085 .map(|o| decode_name(o, cache.global))
1086 .collect();
1087 let num_params = LeanNat::to_nat(&inner.get_obj(2));
1088 let num_indices = LeanNat::to_nat(&inner.get_obj(3));
1089 let num_motives = LeanNat::to_nat(&inner.get_obj(4));
1090 let num_minors = LeanNat::to_nat(&inner.get_obj(5));
1091 let rules: Vec<_> = collect_list_borrowed(inner.get_obj(6).as_list())
1092 .into_iter()
1093 .map(|o| decode_recursor_rule(o, cache))
1094 .collect();
1095 let k = inner.get_num_8(0) != 0;
1096 let is_unsafe = inner.get_num_8(1) != 0;
1097 ConstantInfo::RecInfo(RecursorVal {
1098 cnst: constant_val,
1099 all,
1100 num_params,
1101 num_indices,
1102 num_motives,
1103 num_minors,
1104 rules,
1105 k,
1106 is_unsafe,
1107 })
1108 },
1109 tag => unreachable!("Invalid Lean.ConstantInfo tag: {tag}"),
1110 }
1111}
1112

Callers 15

rs_build_ref_graphFunction · 0.85
rs_compute_sccsFunction · 0.85
rs_tmp_decode_const_mapFunction · 0.85
rs_compile_validate_auxFunction · 0.85
rs_compile_env_fullFunction · 0.85
rs_compile_envFunction · 0.85
rs_compile_phasesFunction · 0.85
rs_compile_env_to_ixonFunction · 0.85
rs_leon_hashesFunction · 0.85
rs_kernel_check_constsFunction · 0.85

Calls 4

collect_list_sharedFunction · 0.85
lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected