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

Method try_proof_irrel

crates/kernel/src/def_eq.rs:800–817  ·  view source on GitHub ↗

Proof irrelevance: if both are proofs of propositions (types in Prop), they're def-eq. We check type(type(a)) = Sort(0), meaning type(a) : Prop. The "is `a_ty` propositional?" question is delegated to [`Self::is_prop_type`], which caches by the type's content hash so a repeat probe on the same proposition skips the recursive `infer ∘ whnf` chain entirely. Without that cache, every successful proo

(
    &mut self,
    a: &KExpr<M>,
    b: &KExpr<M>,
  )

Source from the content-addressed store, hash-verified

798 if matches!(a.data(), ExprData::Str(..))
799 || matches!(b.data(), ExprData::Str(..))
800 {
801 if self.try_string_lit_expansion(a, b)? {
802 return Ok(true);
803 }
804 if self.try_string_lit_expansion(b, a)? {
805 return Ok(true);
806 }
807 }
808
809 // Struct eta + unit-like + proof irrelevance fallback
810 if self.try_eta_struct(a, b)? {
811 return Ok(true);
812 }
813 if self.try_eta_struct(b, a)? {
814 return Ok(true);
815 }
816 if self.try_def_eq_unit(a, b)? {
817 return Ok(true);
818 }
819 self.try_proof_irrel(a, b)
820 }

Callers 2

is_def_eq_innerMethod · 0.80
is_def_eq_whnfMethod · 0.80

Calls 4

with_infer_onlyMethod · 0.80
inferMethod · 0.80
is_prop_typeMethod · 0.80
is_def_eqMethod · 0.45

Tested by

no test coverage detected