66491
|
1 |
theory Base_FDS
|
|
2 |
imports "../Library/Pattern_Aliases"
|
|
3 |
begin
|
|
4 |
|
|
5 |
declare Let_def [simp]
|
|
6 |
|
|
7 |
text \<open>Lemma \<open>size_prod_measure\<close>, when declared with the \<open>measure_function\<close> attribute,
|
|
8 |
enables \<open>fun\<close> to prove termination of a larger class of functions automatically.
|
|
9 |
By default, \<open>fun\<close> only tries lexicographic combinations of the sizes of the parameters.
|
|
10 |
With \<open>size_prod_measure\<close> enabled it also tries measures based on the sum of the sizes
|
|
11 |
of different parameters.
|
|
12 |
|
|
13 |
To alert the reader whenever such a more subtle termination proof is taking place
|
|
14 |
the lemma is not enabled all the time but only locally in a \<open>context\<close> block
|
|
15 |
around such function definitions.
|
|
16 |
\<close>
|
|
17 |
|
|
18 |
lemma size_prod_measure:
|
|
19 |
"is_measure f \<Longrightarrow> is_measure g \<Longrightarrow> is_measure (size_prod f g)"
|
|
20 |
by (rule is_measure_trivial)
|
|
21 |
|
|
22 |
end |