using the option "default" the function package allows one to give an explicit default value
authorChristian Urban <urbanc@in.tum.de>
Wed, 08 Jun 2011 08:44:01 +0100
changeset 2833 3503432262dc
parent 2827 394664816e24
child 2834 71382ce4d2ed
using the option "default" the function package allows one to give an explicit default value
Nominal/Ex/TypeSchemes.thy
--- a/Nominal/Ex/TypeSchemes.thy	Tue Jun 07 20:58:00 2011 +0100
+++ b/Nominal/Ex/TypeSchemes.thy	Wed Jun 08 08:44:01 2011 +0100
@@ -71,13 +71,28 @@
 using assms
 by blast
 
-nominal_primrec
+definition "MYUNDEFINED \<equiv> undefined"
+
+nominal_primrec (default "\<lambda>x. MYUNDEFINED")
     subst  :: "(name \<times> ty) list \<Rightarrow> ty \<Rightarrow> ty"
 and substs :: "(name \<times> ty) list \<Rightarrow> tys \<Rightarrow> tys"
 where
   "subst \<theta> (Var X) = lookup \<theta> X"
 | "subst \<theta> (Fun T1 T2) = Fun (subst \<theta> T1) (subst \<theta> T2)"
 | "fset (map_fset atom xs) \<sharp>* \<theta> \<Longrightarrow> substs \<theta> (All xs T) = All xs (subst \<theta> T)"
+thm subst_substs_graph_def
+thm subst_substs_sumC_def
+oops
+
+nominal_primrec 
+    subst  :: "(name \<times> ty) list \<Rightarrow> ty \<Rightarrow> ty"
+and substs :: "(name \<times> ty) list \<Rightarrow> tys \<Rightarrow> tys"
+where
+  "subst \<theta> (Var X) = lookup \<theta> X"
+| "subst \<theta> (Fun T1 T2) = Fun (subst \<theta> T1) (subst \<theta> T2)"
+| "fset (map_fset atom xs) \<sharp>* \<theta> \<Longrightarrow> substs \<theta> (All xs T) = All xs (subst \<theta> T)"
+thm subst_substs_graph_def
+thm subst_substs_sumC_def
 apply(subgoal_tac "\<And>p x r. subst_substs_graph x r \<Longrightarrow> subst_substs_graph (p \<bullet> x) (p \<bullet> r)")
 apply(simp add: eqvt_def)
 apply(rule allI)