diff -r 9dad8095bd43 -r b73a6b72f706 src/HOL/Library/SCT_Definition.thy --- a/src/HOL/Library/SCT_Definition.thy Tue Jun 19 00:02:16 2007 +0200 +++ b/src/HOL/Library/SCT_Definition.thy Tue Jun 19 18:00:49 2007 +0200 @@ -3,7 +3,7 @@ Author: Alexander Krauss, TU Muenchen *) -header "" (* FIXME proper header *) +header {* The Size-Change Principle (Definition) *} theory SCT_Definition imports Graphs Infinite_Set @@ -32,7 +32,10 @@ lemma sedge_UNIV: "UNIV = { LESS, LEQ }" - by auto (case_tac x, auto) (*FIXME*) +proof (intro equalityI subsetI) + fix x show "x \ { LESS, LEQ }" + by (cases x) auto +qed auto instance sedge :: finite proof @@ -43,8 +46,8 @@ lemmas [code func] = sedge_UNIV -types scg = "(nat, sedge) graph" -types acg = "(nat, scg) graph" +types 'a scg = "('a, sedge) graph" +types 'a acg = "('a, 'a scg) graph" subsection {* Size-Change Termination *} @@ -59,46 +62,46 @@ "eq G i j \ has_edge G i LEQ j" abbreviation - eql :: "scg \ nat \ nat \ bool" + eql :: "'a scg \ 'a \ 'a \ bool" ("_ \ _ \ _") where "eql G i j \ has_edge G i LESS j \ has_edge G i LEQ j" -abbreviation (input) descat :: "(nat, scg) ipath \ nat sequence \ nat \ bool" +abbreviation (input) descat :: "('a, 'a scg) ipath \ 'a sequence \ nat \ bool" where "descat p \ i \ has_edge (snd (p i)) (\ i) LESS (\ (Suc i))" -abbreviation (input) eqat :: "(nat, scg) ipath \ nat sequence \ nat \ bool" +abbreviation (input) eqat :: "('a, 'a scg) ipath \ 'a sequence \ nat \ bool" where "eqat p \ i \ has_edge (snd (p i)) (\ i) LEQ (\ (Suc i))" -abbreviation eqlat :: "(nat, scg) ipath \ nat sequence \ nat \ bool" +abbreviation (input) eqlat :: "('a, 'a scg) ipath \ 'a sequence \ nat \ bool" where "eqlat p \ i \ (has_edge (snd (p i)) (\ i) LESS (\ (Suc i)) \ has_edge (snd (p i)) (\ i) LEQ (\ (Suc i)))" -definition is_desc_thread :: "nat sequence \ (nat, scg) ipath \ bool" +definition is_desc_thread :: "'a sequence \ ('a, 'a scg) ipath \ bool" where "is_desc_thread \ p = ((\n.\i\n. eqlat p \ i) \ (\\<^sub>\i. descat p \ i))" -definition SCT :: "acg \ bool" +definition SCT :: "'a acg \ bool" where "SCT \ = (\p. has_ipath \ p \ (\\. is_desc_thread \ p))" -definition no_bad_graphs :: "acg \ bool" +definition no_bad_graphs :: "'a acg \ bool" where "no_bad_graphs A = (\n G. has_edge A n G n \ G * G = G \ (\p. has_edge G p LESS p))" -definition SCT' :: "acg \ bool" +definition SCT' :: "'a acg \ bool" where "SCT' A = no_bad_graphs (tcl A)"