diff -r ca4e9eb8d576 -r 7c89d3f6923e thys/Lexer.thy --- a/thys/Lexer.thy Tue Jun 27 08:59:11 2017 +0100 +++ b/thys/Lexer.thy Tue Jun 27 13:15:55 2017 +0100 @@ -256,6 +256,18 @@ using assms by(induct vs) (auto intro: Prf.intros) +lemma Prf_Stars_append: + assumes "\ Stars vs1 : STAR r" "\ Stars vs2 : STAR r" + shows "\ Stars (vs1 @ vs2) : STAR r" +using assms +apply(induct vs1 arbitrary: vs2) +apply(auto intro: Prf.intros) +apply(erule Prf.cases) +apply(simp_all) +apply(auto intro: Prf.intros) +done + + lemma Star_string: assumes "s \ A\" shows "\ss. concat ss = s \ (\s \ set ss. s \ A)" @@ -268,7 +280,6 @@ apply(simp) done - lemma Star_val: assumes "\s\set ss. \v. s = flat v \ \ v : r" shows "\vs. concat (map flat vs) = concat ss \ (\v\set vs. \ v : r)" @@ -278,6 +289,7 @@ apply (metis empty_iff list.set(1)) by (metis concat.simps(2) list.simps(9) set_ConsD) + lemma L_flat_Prf1: assumes "\ v : r" shows "flat v \ L r" using assms @@ -306,6 +318,16 @@ "L(r) = {flat v | v. \ v : r}" using L_flat_Prf1 L_flat_Prf2 by blast +lemma Star_values_exists: + assumes "s \ (L r)\" + shows "\vs. concat (map flat vs) = s \ \ Stars vs : STAR r" +using assms +apply(drule_tac Star_string) +apply(auto) + +by (metis L_flat_Prf2 Prf_Stars Star_val) + + section {* Sulzmann and Lu functions *}