| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Membership predicate for fresh lists |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Relation.Binary.Bundles using (Setoid) |
| 10 |
|
| 11 |
module Data.List.Fresh.Membership.Setoid {c ℓ} (S : Setoid c ℓ) where |
| 12 |
|
| 13 |
open import Level using (Level; _⊔_) |
| 14 |
open import Data.List.Fresh using (List#) |
| 15 |
open import Data.List.Fresh.Relation.Unary.Any as Any using (Any) |
| 16 |
open import Relation.Binary.Core using (Rel) |
| 17 |
open import Relation.Nullary.Negation.Core using (¬_) |
| 18 |
|
| 19 |
open Setoid S renaming (Carrier to A) |
| 20 |
|
| 21 |
infix 4 _∈_ _∉_ |
| 22 |
|
| 23 |
private |
| 24 |
variable |
| 25 |
r : Level |
| 26 |
|
| 27 |
_∈_ : {R : Rel A r} → A → List# A R → Set _ |
| 28 |
x ∈ xs = Any (x ≈_) xs |
| 29 |
|
| 30 |
_∉_ : {R : Rel A r} → A → List# A R → Set _ |
| 31 |
x ∉ xs = ¬ (x ∈ xs) |