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