Interpretation equations may have name and/or attribute.
authorballarin
Fri, 19 Oct 2007 12:21:32 +0200
changeset 25094 ba43514068fd
parent 25093 41ec22a00c41
child 25095 ea8307dac208
Interpretation equations may have name and/or attribute.
doc-src/IsarRef/generic.tex
src/Pure/Isar/class.ML
src/Pure/Isar/spec_parse.ML
--- a/doc-src/IsarRef/generic.tex	Fri Oct 19 10:44:45 2007 +0200
+++ b/doc-src/IsarRef/generic.tex	Fri Oct 19 12:21:32 2007 +0200
@@ -394,8 +394,10 @@
   ;
   printinterps '!'? name
   ;
-  interp: thmdecl? \\ (contextexpr ('[' (inst+) ']')? |
-    name ('[' (inst+) ']')? 'where' (prop + 'and'))
+  instantiation: ('[' (inst+) ']')?
+  ;
+  interp: thmdecl? \\ (contextexpr instantiation |
+    name instantiation 'where' (thmdecl? prop + 'and'))
   ;
 \end{rail}
 
--- a/src/Pure/Isar/class.ML	Fri Oct 19 10:44:45 2007 +0200
+++ b/src/Pure/Isar/class.ML	Fri Oct 19 12:21:32 2007 +0200
@@ -520,7 +520,8 @@
   in
     thy
     |> fold_map (get_remove_global_constraint o fst o snd) params
-    ||> prove_interpretation tac ((false, prfx), []) (Locale.Locale class) (inst, defs)
+    ||> prove_interpretation tac ((false, prfx), []) (Locale.Locale class)
+          (inst, map (fn def => (("", []), def)) defs)
     |-> (fn cs => fold (Sign.add_const_constraint o apsnd SOME) cs)
   end;
 
--- a/src/Pure/Isar/spec_parse.ML	Fri Oct 19 10:44:45 2007 +0200
+++ b/src/Pure/Isar/spec_parse.ML	Fri Oct 19 12:21:32 2007 +0200
@@ -23,7 +23,8 @@
     ((bstring * Attrib.src list) * (thmref * Attrib.src list) list) list * token list
   val locale_mixfix: token list -> mixfix * token list
   val locale_fixes: token list -> (string * string option * mixfix) list * token list
-  val locale_insts: token list -> (string option list * string list) * token list
+  val locale_insts: token list ->
+    (string option list * ((bstring * Attrib.src list) * string) list) * token list
   val class_expr: token list -> string list * token list
   val locale_expr: token list -> Locale.expr * token list
   val locale_keyword: token list -> string * token list
@@ -88,7 +89,7 @@
 
 val locale_insts =
   Scan.optional (P.$$$ "[" |-- P.!!! (Scan.repeat1 (P.maybe P.term) --| P.$$$ "]")) []
-  -- Scan.optional (P.$$$ "where" |-- P.and_list1 P.term) [];
+  -- Scan.optional (P.$$$ "where" |-- P.and_list1 (opt_thm_name ":" -- P.prop)) [];
 
 local