take out 'x = C' of the simplifier for unit types
authorblanchet
Wed, 03 Sep 2014 00:06:23 +0200
changeset 58151 414deb2ef328
parent 58150 2bf3ed0f62cf
child 58152 6fe60a9a5bad
take out 'x = C' of the simplifier for unit types
src/Doc/Datatypes/Datatypes.thy
src/HOL/Tools/Ctr_Sugar/ctr_sugar.ML
--- a/src/Doc/Datatypes/Datatypes.thy	Wed Sep 03 00:06:22 2014 +0200
+++ b/src/Doc/Datatypes/Datatypes.thy	Wed Sep 03 00:06:23 2014 +0200
@@ -807,7 +807,10 @@
 
 \item[@{text "t."}\hthm{collapse} @{text "[simp]"}\rm:] ~ \\
 @{thm list.collapse(1)[no_vars]} \\
-@{thm list.collapse(2)[no_vars]}
+@{thm list.collapse(2)[no_vars]} \\
+(The @{text "[simp]"} attribute is exceptionally omitted for datatypes equipped
+with a single nullary constructor, because a property of the form
+@{prop "x = C"} is not suitable as a simplification rule.)
 
 \item[@{text "t."}\hthm{distinct_disc} @{text "[dest]"}\rm:] ~ \\
 These properties are missing for @{typ "'a list"} because there is only one
@@ -840,8 +843,8 @@
 \end{indentblock}
 
 \noindent
-In addition, equational versions of @{text t.disc} are registered with the @{text "[code]"}
-attribute.
+In addition, equational versions of @{text t.disc} are registered with the
+@{text "[code]"} attribute.
 *}
 
 
--- a/src/HOL/Tools/Ctr_Sugar/ctr_sugar.ML	Wed Sep 03 00:06:22 2014 +0200
+++ b/src/HOL/Tools/Ctr_Sugar/ctr_sugar.ML	Wed Sep 03 00:06:23 2014 +0200
@@ -983,7 +983,7 @@
            (case_congN, [case_cong_thm], []),
            (case_cong_weak_thmsN, [case_cong_weak_thm], cong_attrs),
            (case_eq_ifN, case_eq_if_thms, []),
-           (collapseN, safe_collapse_thms, simp_attrs),
+           (collapseN, safe_collapse_thms, if ms = [0] then [] else simp_attrs),
            (discN, flat nontriv_disc_thmss, simp_attrs),
            (discIN, nontriv_discI_thms, []),
            (distinctN, distinct_thms, simp_attrs @ inductsimp_attrs),