lean4-htt/src/Lean/Data/Occurrences.lean
2020-12-13 16:30:07 -08:00

23 lines
544 B
Text

/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
-/
namespace Lean
inductive Occurrences where
| all
| pos (idxs : List Nat)
| neg (idxs : List Nat)
deriving Inhabited, BEq
def Occurrences.contains : Occurrences → Nat → Bool
| all, _ => true
| pos idxs, idx => idxs.contains idx
| neg idxs, idx => !idxs.contains idx
def Occurrences.isAll : Occurrences → Bool
| all => true
| _ => false
end Lean