aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/classes.mli
diff options
context:
space:
mode:
authorGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-19 17:58:43 +0000
committerGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-19 17:58:43 +0000
commit1f31ca099259fbea08a7fef56e1989283aec040a (patch)
tree90064d4985a02321746c63027a8045fff9f2cb62 /toplevel/classes.mli
parente5ca537c17ad96529b4b39c7dbff0f25cd53b3a6 (diff)
Do another pass on the typeclasses code. Correct globalization of class
names, gives the ability to specify qualified classes in instance declarations. Use that in the class_tactics code. Refine the implementation of classes. For singleton classes the implementation of the class becomes a regular definition (into Type or Prop). The single method becomes a 'trivial' projection that allows to launch typeclass resolution. Each instance is just a definition as usual. Examples in theories/Classes/RelationClasses. This permits to define [Class reflexive A (R : relation A) := refl : forall x, R x x.]. The definition of [reflexive] that is generated is the same as the original one. We just need a way to declare arbitrary lemmas as instances of a particular class to retrofit existing reflexivity lemmas as typeclass instances of the [reflexive] class. Also debug rewriting under binders in setoid_rewrite to allow rewriting with lemmas which capture the bound variables when applied (works only with setoid_rewrite, as rewrite first matches the lemma with the entire, closed term). One can rewrite with [H : forall x, R (f x) (g x)] in the goal [exists x, P (f x)]. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10697 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/classes.mli')
-rw-r--r--toplevel/classes.mli8
1 files changed, 6 insertions, 2 deletions
diff --git a/toplevel/classes.mli b/toplevel/classes.mli
index 248ed8c95..6671eed72 100644
--- a/toplevel/classes.mli
+++ b/toplevel/classes.mli
@@ -29,10 +29,10 @@ type binder_def_list = (identifier located * identifier located list * constr_ex
val binders_of_lidents : identifier located list -> local_binder list
val declare_implicit_proj : typeclass -> constant -> Impargs.manual_explicitation list -> bool -> unit
-
+(*
val infer_super_instances : env -> constr list ->
named_context -> named_context -> types list * identifier list * named_context
-
+*)
val new_class : identifier located ->
local_binder list ->
Vernacexpr.sort_expr located ->
@@ -46,6 +46,9 @@ val new_instance :
int option ->
(constant -> unit) ->
identifier
+
+(* For generation on names based on classes only *)
+val id_of_class : typeclass -> identifier
val context : ?hook:(Libnames.global_reference -> unit) -> typeclass_context -> unit
@@ -76,3 +79,4 @@ val push_named_context : named_context -> env -> env
val name_typeclass_binders : Idset.t ->
Topconstr.local_binder list ->
Topconstr.local_binder list * Idset.t
+