| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Membership relation for AVL sets |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Relation.Binary.Bundles using (StrictTotalOrder) |
| 10 |
|
| 11 |
module Data.Tree.AVL.Sets.Membership |
| 12 |
{a ℓ₁ ℓ₂} (strictTotalOrder : StrictTotalOrder a ℓ₁ ℓ₂) |
| 13 |
where |
| 14 |
|
| 15 |
open import Data.Bool.Base using (true; false) |
| 16 |
open import Data.Product.Base as Product using (_,_; proj₁; proj₂) |
| 17 |
open import Data.Sum.Base as Sum using (_⊎_) |
| 18 |
open import Data.Unit.Base using (tt) |
| 19 |
open import Function.Base using (_∘_; _∘′_; const) |
| 20 |
|
| 21 |
open import Relation.Nullary using (¬_; yes; no; Reflects) |
| 22 |
open import Relation.Nullary.Reflects using (fromEquivalence) |
| 23 |
|
| 24 |
open StrictTotalOrder strictTotalOrder renaming (Carrier to A) |
| 25 |
open import Data.Tree.AVL.Sets strictTotalOrder |
| 26 |
open import Data.Tree.AVL.Map.Relation.Unary.Any strictTotalOrder as Mapₚ |
| 27 |
|
| 28 |
------------------------------------------------------------------------ |
| 29 |
-- ∈ |
| 30 |
|
| 31 |
infix 4 _∈_ _∉_ |
| 32 |
|
| 33 |
_∈_ : A → ⟨Set⟩ → Set _ |
| 34 |
x ∈ s = Any ((x ≈_) ∘ proj₁) s |
| 35 |
|
| 36 |
_∉_ : A → ⟨Set⟩ → Set _ |
| 37 |
x ∉ s = ¬ x ∈ s |