fix: ReducibilityHints.lt (#3964)
This commit is contained in:
parent
62cdb51ed5
commit
69202d9b73
1 changed files with 14 additions and 1 deletions
|
|
@ -49,13 +49,26 @@ def ReducibilityHints.getHeightEx (h : ReducibilityHints) : UInt32 :=
|
|||
|
||||
namespace ReducibilityHints
|
||||
|
||||
-- Recall that if `lt h₁ h₂`, we want to reduce declaration associated with `h₁`.
|
||||
def lt : ReducibilityHints → ReducibilityHints → Bool
|
||||
| .abbrev, .abbrev => false
|
||||
| .abbrev, _ => true
|
||||
| .regular d₁, .regular d₂ => d₁ < d₂
|
||||
| .regular d₁, .regular d₂ => d₁ > d₂
|
||||
| .regular _, .opaque => true
|
||||
| _, _ => false
|
||||
|
||||
protected def compare : ReducibilityHints → ReducibilityHints → Ordering
|
||||
| .abbrev, .abbrev => .eq
|
||||
| .abbrev, _ => .lt
|
||||
| .regular _, .abbrev => .gt
|
||||
| .regular d₁, .regular d₂ => Ord.compare d₂ d₁
|
||||
| .regular _, .opaque => .lt
|
||||
| .opaque, .opaque => .eq
|
||||
| .opaque, _ => .gt
|
||||
|
||||
instance : Ord ReducibilityHints where
|
||||
compare := ReducibilityHints.compare
|
||||
|
||||
def isAbbrev : ReducibilityHints → Bool
|
||||
| .abbrev => true
|
||||
| _ => false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue