aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/FSets/FSetInterface.v
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2007-02-28 21:34:53 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2007-02-28 21:34:53 +0000
commit10121a63ed037371194b04f706b157cb1877fad8 (patch)
treed8acbc8261c8174e58b1433eff000dbb80ee2057 /theories/FSets/FSetInterface.v
parent1dc68aafe1dbf186cb6b851eaba95174ec636841 (diff)
FSetInterface: new item choose_equal in the spec S (request of P. Casteran)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9684 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/FSets/FSetInterface.v')
-rw-r--r--theories/FSets/FSetInterface.v17
1 files changed, 15 insertions, 2 deletions
diff --git a/theories/FSets/FSetInterface.v b/theories/FSets/FSetInterface.v
index 9d5f2ad76..50e6fb539 100644
--- a/theories/FSets/FSetInterface.v
+++ b/theories/FSets/FSetInterface.v
@@ -274,8 +274,12 @@ Module Type S.
(** Specification of [choose] *)
Parameter choose_1 : choose s = Some x -> In x s.
Parameter choose_2 : choose s = None -> Empty s.
-(* Parameter choose_equal:
- (equal s s')=true -> E.eq (choose s) (choose s'). *)
+ Parameter choose_equal: (equal s s')=true ->
+ match choose s, choose s' with
+ | Some x, Some x' => E.eq x x'
+ | None, None => True
+ | _, _ => False
+ end.
End Spec.
@@ -418,4 +422,13 @@ Module Type Sdep.
Parameter choose : forall s : t, {x : elt | In x s} + {Empty s}.
+ (** The [choose_equal] specification of [S] cannot be packed
+ in the dependent version of [choose], so we leave it separate. *)
+ Parameter choose_equal : forall s s', Equal s s' ->
+ match choose s, choose s' with
+ | inleft (exist x _), inleft (exist x' _) => E.eq x x'
+ | inright _, inright _ => True
+ | _, _ => False
+ end.
+
End Sdep.