src/HOL/Data_Structures/Base_FDS.thy
author nipkow
Wed, 23 Aug 2017 20:41:15 +0200
changeset 66491 78a009ac91d2
child 66499 8367a4f25781
permissions -rw-r--r--
reorg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66491
nipkow
parents:
diff changeset
     1
theory Base_FDS
nipkow
parents:
diff changeset
     2
imports "../Library/Pattern_Aliases"
nipkow
parents:
diff changeset
     3
begin
nipkow
parents:
diff changeset
     4
nipkow
parents:
diff changeset
     5
declare Let_def [simp]
nipkow
parents:
diff changeset
     6
nipkow
parents:
diff changeset
     7
text \<open>Lemma \<open>size_prod_measure\<close>, when declared with the \<open>measure_function\<close> attribute,
nipkow
parents:
diff changeset
     8
enables \<open>fun\<close> to prove termination of a larger class of functions automatically.
nipkow
parents:
diff changeset
     9
By default, \<open>fun\<close> only tries lexicographic combinations of the sizes of the parameters.
nipkow
parents:
diff changeset
    10
With \<open>size_prod_measure\<close> enabled it also tries measures based on the sum of the sizes
nipkow
parents:
diff changeset
    11
of different parameters.
nipkow
parents:
diff changeset
    12
nipkow
parents:
diff changeset
    13
To alert the reader whenever such a more subtle termination proof is taking place
nipkow
parents:
diff changeset
    14
the lemma is not enabled all the time but only locally in a \<open>context\<close> block
nipkow
parents:
diff changeset
    15
around such function definitions.
nipkow
parents:
diff changeset
    16
\<close>
nipkow
parents:
diff changeset
    17
nipkow
parents:
diff changeset
    18
lemma size_prod_measure: 
nipkow
parents:
diff changeset
    19
  "is_measure f \<Longrightarrow> is_measure g \<Longrightarrow> is_measure (size_prod f g)"
nipkow
parents:
diff changeset
    20
by (rule is_measure_trivial)
nipkow
parents:
diff changeset
    21
nipkow
parents:
diff changeset
    22
end