aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/classes.ml
diff options
context:
space:
mode:
authorGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-08-22 18:22:33 +0000
committerGravatar msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-08-22 18:22:33 +0000
commit7e3160a5b94c86d7c9ba7beae9a9464b5ddf9019 (patch)
tree62ac5b8b1016d1cc0cd4627a88716c0c393856aa /toplevel/classes.ml
parentef9f42afe284dae1794acd2f27d6e82f8c941c7b (diff)
- New auto hints for transparency/opacity control, not bound to
syntax yet. Doesn't change the auto/eauto behavior either. - Typeclass resolution now considers everything transparent by default and does it consistently for "open" and closed terms. - Correctly declare singleton classes definition as opaque for proof search. - Add a few initial declarations to make iff, id, compose... opaque - Add definition of dependent signatures for dependent function types and remove corresponding exception code in class_tactics. The instance requires higher-order unification and is not really usable yet. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11333 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/classes.ml')
-rw-r--r--toplevel/classes.ml9
1 files changed, 7 insertions, 2 deletions
diff --git a/toplevel/classes.ml b/toplevel/classes.ml
index 9f3b3343c..288574882 100644
--- a/toplevel/classes.ml
+++ b/toplevel/classes.ml
@@ -32,16 +32,20 @@ open Topconstr
open Decl_kinds
open Entries
-let hint_db = "typeclass_instances"
+let typeclasses_db = "typeclass_instances"
let qualid_of_con c =
Qualid (dummy_loc, shortest_qualid_of_global Idset.empty (ConstRef c))
+let set_rigid c =
+ Auto.add_hints false [typeclasses_db]
+ (Vernacexpr.HintsTransparency ([qualid_of_con c], false))
+
let _ =
Typeclasses.register_add_instance_hint
(fun inst pri ->
Flags.silently (fun () ->
- Auto.add_hints false [hint_db]
+ Auto.add_hints false [typeclasses_db]
(Vernacexpr.HintsResolve
[pri, CAppExpl (dummy_loc, (None, qualid_of_con inst), [])])) ())
@@ -228,6 +232,7 @@ let new_class id par ar sup props =
let cref = ConstRef cst in
Impargs.declare_manual_implicits false cref (Impargs.is_implicit_args()) arity_imps;
Impargs.declare_manual_implicits false (ConstRef proj_cst) (Impargs.is_implicit_args()) (List.hd fieldimpls);
+ set_rigid cst;
cref, [proj_name, proj_cst]
| _ ->
let idb = id_of_string ("Build_" ^ (string_of_id (snd id))) in