refactor: move TransparencyMode to its own file
This commit is contained in:
parent
e000fcaeda
commit
5b23b5302f
2 changed files with 40 additions and 29 deletions
|
|
@ -12,6 +12,7 @@ import Lean.Util.RecDepth
|
|||
import Lean.Util.Closure
|
||||
import Lean.Compiler.InlineAttrs
|
||||
import Lean.Meta.Exception
|
||||
import Lean.Meta.TransparencyMode
|
||||
import Lean.Meta.DiscrTreeTypes
|
||||
import Lean.Eval
|
||||
import Lean.CoreM
|
||||
|
|
@ -29,35 +30,6 @@ They are packed into the MetaM monad.
|
|||
namespace Lean
|
||||
namespace Meta
|
||||
|
||||
inductive TransparencyMode
|
||||
| all | default | reducible
|
||||
|
||||
namespace TransparencyMode
|
||||
instance : Inhabited TransparencyMode := ⟨TransparencyMode.default⟩
|
||||
|
||||
def beq : TransparencyMode → TransparencyMode → Bool
|
||||
| all, all => true
|
||||
| default, default => true
|
||||
| reducible, reducible => true
|
||||
| _, _ => false
|
||||
|
||||
instance : HasBeq TransparencyMode := ⟨beq⟩
|
||||
|
||||
def hash : TransparencyMode → USize
|
||||
| all => 7
|
||||
| default => 11
|
||||
| reducible => 13
|
||||
|
||||
instance : Hashable TransparencyMode := ⟨hash⟩
|
||||
|
||||
def lt : TransparencyMode → TransparencyMode → Bool
|
||||
| reducible, default => true
|
||||
| reducible, all => true
|
||||
| default, all => true
|
||||
| _, _ => false
|
||||
|
||||
end TransparencyMode
|
||||
|
||||
structure Config :=
|
||||
(foApprox : Bool := false)
|
||||
(ctxApprox : Bool := false)
|
||||
|
|
|
|||
39
src/Lean/Meta/TransparencyMode.lean
Normal file
39
src/Lean/Meta/TransparencyMode.lean
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/-
|
||||
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
namespace Lean
|
||||
namespace Meta
|
||||
|
||||
inductive TransparencyMode
|
||||
| all | default | reducible
|
||||
|
||||
namespace TransparencyMode
|
||||
instance : Inhabited TransparencyMode := ⟨TransparencyMode.default⟩
|
||||
|
||||
def beq : TransparencyMode → TransparencyMode → Bool
|
||||
| all, all => true
|
||||
| default, default => true
|
||||
| reducible, reducible => true
|
||||
| _, _ => false
|
||||
|
||||
instance : HasBeq TransparencyMode := ⟨beq⟩
|
||||
|
||||
def hash : TransparencyMode → USize
|
||||
| all => 7
|
||||
| default => 11
|
||||
| reducible => 13
|
||||
|
||||
instance : Hashable TransparencyMode := ⟨hash⟩
|
||||
|
||||
def lt : TransparencyMode → TransparencyMode → Bool
|
||||
| reducible, default => true
|
||||
| reducible, all => true
|
||||
| default, all => true
|
||||
| _, _ => false
|
||||
|
||||
end TransparencyMode
|
||||
|
||||
end Meta
|
||||
end Lean
|
||||
Loading…
Add table
Reference in a new issue