have the same no-update semantics for 'case' as for 'Ctr_Sugar' and BNF data (this might not be the final word on the matter, but using a consistent policy seems like a good idea)
authorblanchet
Wed, 12 Feb 2014 08:35:56 +0100
changeset 55392 20f282bb8371
parent 55391 eae296b5ef33
child 55393 ce5cebfaedda
have the same no-update semantics for 'case' as for 'Ctr_Sugar' and BNF data (this might not be the final word on the matter, but using a consistent policy seems like a good idea)
src/HOL/Tools/Ctr_Sugar/case_translation.ML
--- a/src/HOL/Tools/Ctr_Sugar/case_translation.ML	Tue Feb 11 12:08:44 2014 +0100
+++ b/src/HOL/Tools/Ctr_Sugar/case_translation.ML	Wed Feb 12 08:35:56 2014 +0100
@@ -221,8 +221,9 @@
     val constr_keys = map (fst o dest_Const) constrs;
     val data = (case_comb, constrs);
     val Tname = Tname_of_data data;
-    val update_constrs = fold (fn key => Symtab.cons_list (key, (Tname, data))) constr_keys;
-    val update_cases = Symtab.update (case_key, data);
+    val update_constrs =
+      fold (fn key => Symtab.insert_list (eq_fst (op =)) (key, (Tname, data))) constr_keys;
+    val update_cases = Symtab.default (case_key, data);
   in
     context
     |> map_constrs update_constrs