@@ -42,6 +42,35 @@ proof goal_cases
4242qed ( auto simp : eqvt_def head_ctor_graph_aux_def )
4343nominal_termination ( eqvt ) by lexicographic_order
4444
45+ nominal_function head_data :: "\<tau> \<Rightarrow> data_name option" where
46+ "head_data (TyVar _) = None"
47+ | "head_data (TyData T) = Some T"
48+ | "head_data TyArrow = None"
49+ | "head_data (TyApp (TyData T) _) = Some T"
50+ | "head_data (TyApp (TyVar _) _) = None"
51+ | "head_data (TyApp TyArrow _) = None"
52+ | "head_data (TyApp (TyApp _ _) _) = None"
53+ | "head_data (TyApp (TyForall _ _ _) _) = None"
54+ | "head_data (TyForall _ _ _) = None"
55+ proof goal_cases
56+ case ( 3 P x )
57+ then show ?case
58+ proof ( cases x rule : \<tau>.exhaust )
59+ case ( TyApp \<tau>1 \<tau>2 )
60+ then show ?thesis using 3 by ( cases \<tau>1 rule : \<tau>.exhaust ) auto
61+ qed
62+ qed ( auto simp : eqvt_def head_data_graph_aux_def )
63+ nominal_termination ( eqvt ) by lexicographic_order
64+
65+ nominal_function set_alt_list :: "alt_list \<Rightarrow> alt set" where
66+ "set_alt_list ANil = {}"
67+ | "set_alt_list (ACons alt alts) = insert alt (set_alt_list alts)"
68+ proof goal_cases
69+ case ( 3 P x )
70+ then show ?case by ( cases x rule : term_alt_list_alt.exhaust ( 2 ))
71+ qed ( auto simp : eqvt_def set_alt_list_graph_aux_def )
72+ nominal_termination ( eqvt ) by lexicographic_order
73+
4574nominal_function ctor_data_app :: "\<tau> \<Rightarrow> (data_name * tyvar list) option" where
4675 "ctor_data_app (TyVar _) = None"
4776| "ctor_data_app (TyData T) = Some (T, [])"
@@ -163,6 +192,14 @@ next
163192qed auto
164193nominal_termination ( eqvt ) by lexicographic_order
165194
195+ abbreviation exhaustive :: "alt_list \<Rightarrow> \<Delta> \<Rightarrow> data_name \<Rightarrow> bool" where
196+ "exhaustive alts \<Delta> T \<equiv>
197+ (\<nexists>x e. MatchVar x e \<in> set_alt_list alts) \<longrightarrow>
198+ (\<forall>D \<tau>.
199+ (AxCtor D \<tau> \<in> set \<Delta> \<and> ctor_type \<tau> = Some T) \<longrightarrow>
200+ (\<exists>tys vals e. MatchCtor D tys vals e \<in> set_alt_list alts)
201+ )"
202+
166203nominal_function is_value :: "term => bool" where
167204 "is_value (Var x) = False"
168205| "is_value (\<lambda> x : \<tau> . e) = True"
0 commit comments