File: SetMap.v

package info (click to toggle)
coq-ext-lib 0.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 808 kB
  • sloc: makefile: 44; python: 31; sh: 4; lisp: 3
file content (29 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (4)
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
Require Import ExtLib.Structures.Maps.
Require Import ExtLib.Structures.Sets.

Set Implicit Arguments.
Set Strict Implicit.

(** Canonical instance, a set is the same as a map where the values
    are unit
 **)
(*
Section SetFromMap.
  Variable T : Type.
  Variable R : T -> T -> Prop.

  Variable m : Type -> Type.
  Variable Map_T : Map T m.

  Global Instance CSet_map : @DSet (m unit) T R :=
  { empty := Maps.empty
  ; contains := fun k m => match lookup k m with
                             | None => false
                             | Some _ => true
                           end
  ; add := fun k m => Maps.add k tt m
  ; remove := fun k m => Maps.remove k m
  ; singleton := fun v => Maps.add v tt Maps.empty
  }.
End SetFromMap.
*)