From 07ffd30a82ebfe35811ca43d71aeacdb86f4cc87 Mon Sep 17 00:00:00 2001 From: msozeau Date: Thu, 6 Mar 2008 14:56:08 +0000 Subject: Syntax changes in typeclasses, remove "?" for usual implicit arguments binding, add "!" syntax for the new binders which require parameters and not superclasses. Change backquotes for curly braces for user-given implicit arguments, following tradition. This requires a hack a la lpar-id-coloneq. Change ident to global for typeclass names in class binders. Also requires a similar hack to distinguish between [ C t1 tn ] and [ c : C t1 tn ]. Update affected theories. While hacking the parsing of { wf }, factorized the two versions of fix annotation parsing that were present in g_constr and g_vernac. Add the possibility of the user optionaly giving the priority for resolve and exact hints (used by type classes). Syntax not fixed yet: a natural after the list of lemmas in "Hint Resolve" syntax, a natural after a "|" after the instance constraint in Instance declarations (ex in Morphisms.v). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10628 85f007b7-540e-0410-9357-904b9bb8a0f7 --- contrib/interface/blast.ml | 1 + contrib/interface/xlate.ml | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'contrib/interface') diff --git a/contrib/interface/blast.ml b/contrib/interface/blast.ml index 82fbe9c691..7cc43e4ce8 100644 --- a/contrib/interface/blast.ml +++ b/contrib/interface/blast.ml @@ -467,6 +467,7 @@ let rec search_gen decomp n db_list local_db extra_sign goal = try [make_apply_entry (pf_env g') (project g') (true,false) + None (mkVar hid,htyp)] with Failure _ -> [] in diff --git a/contrib/interface/xlate.ml b/contrib/interface/xlate.ml index db8963554b..4d28a22a98 100644 --- a/contrib/interface/xlate.ml +++ b/contrib/interface/xlate.ml @@ -1727,7 +1727,7 @@ let rec xlate_vernac = CT_id_ne_list(n1, names), dblist) | HintsExtern (n, c, t) -> CT_hint_extern(CT_int n, xlate_formula c, xlate_tactic t, dblist) - | HintsResolve l | HintsImmediate l -> + | HintsImmediate l -> let f1, formulas = match List.map xlate_formula l with a :: tl -> a, tl | _ -> failwith "" in @@ -1744,6 +1744,23 @@ let rec xlate_vernac = HintsResolve _ -> CT_hints_resolve(l', dblist) | HintsImmediate _ -> CT_hints_immediate(l', dblist) | _ -> assert false) + | HintsResolve l -> + let f1, formulas = match List.map xlate_formula (List.map snd l) with + a :: tl -> a, tl + | _ -> failwith "" in + let l' = CT_formula_ne_list(f1, formulas) in + if local then + (match h with + HintsResolve _ -> + CT_local_hints_resolve(l', dblist) + | HintsImmediate _ -> + CT_local_hints_immediate(l', dblist) + | _ -> assert false) + else + (match h with + HintsResolve _ -> CT_hints_resolve(l', dblist) + | HintsImmediate _ -> CT_hints_immediate(l', dblist) + | _ -> assert false) | HintsUnfold l -> let n1, names = match List.map loc_qualid_to_ct_ID l with n1 :: names -> n1, names @@ -2083,7 +2100,7 @@ let rec xlate_vernac = (* TypeClasses *) | VernacDeclareInstance _|VernacContext _| - VernacInstance (_, _, _)|VernacClass (_, _, _, _, _) -> + VernacInstance (_, _, _, _)|VernacClass (_, _, _, _, _) -> xlate_error "TODO: Type Classes commands" | VernacResetName id -> CT_reset (xlate_ident (snd id)) -- cgit v1.2.3