Zulip Chat Archive

Stream: lean4

Topic: Simp theorems with type


Marcus Rossel (Nov 28 2023 at 12:44):

Is there some way to efficiently obtain all simp theorems whose equality matches a given type? So for example, simpThmsMatchingType (mkConst `Nat) would return all simp theorems of the form ∀ xs..., t₁ = t₂ where t₁ and t₂ are of type Nat.
I have very little understanding of how the discrimination tree for simp theorems works, so I'm not sure if this question even makes sense.

#xy

Timo Carlin-Burns (Nov 28 2023 at 15:01):

I don't think the discrimination tree structure provides much help here unless you know ahead of time all of the constants of type Nat. E.g. the LHS of a simp lemma fib 2 = 1 will be keyed by the path [.const `fib, .lit 2]


Last updated: Dec 20 2023 at 11:08 UTC