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>,
)
| 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 | } |
no test coverage detected