src/HOL/Library/AList.thy
author bulwahn
Tue, 10 Jan 2012 15:48:10 +0100
changeset 46171 19f68d7671f0
parent 46167 25eba8a5d7d0
permissions -rw-r--r--
proper hiding of facts and constants in AList_Impl and AList theory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46167
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     1
(*  Title:      HOL/Library/AList.thy
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     2
    Author:     Lukas Bulwahn, TU Muenchen *)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     3
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     4
header {* Abstract type of association lists with unique keys *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     5
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     6
theory AList
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     7
imports AList_Impl
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     8
begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
     9
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    10
text {* This was based on some existing fragments in the AFP-Collection framework. *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    11
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    12
subsection {* Type @{text "('key, 'value) alist" } *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    13
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    14
typedef (open) ('key, 'value) alist = "{xs :: ('key \<times> 'value) list. distinct (map fst xs)}"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    15
morphisms impl_of Alist
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    16
by(rule exI[where x="[]"]) simp
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    17
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    18
lemma alist_ext: "impl_of xs = impl_of ys \<Longrightarrow> xs = ys"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    19
by(simp add: impl_of_inject)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    20
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    21
lemma alist_eq_iff: "xs = ys \<longleftrightarrow> impl_of xs = impl_of ys"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    22
by(simp add: impl_of_inject)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    23
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    24
lemma impl_of_distinct [simp, intro]: "distinct (map fst (impl_of xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    25
using impl_of[of xs] by simp
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    26
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    27
lemma Alist_impl_of [code abstype]: "Alist (impl_of xs) = xs"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    28
by(rule impl_of_inverse)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    29
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    30
subsection {* Primitive operations *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    31
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    32
definition lookup :: "('key, 'value) alist \<Rightarrow> 'key \<Rightarrow> 'value option"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    33
where [code]: "lookup xs = map_of (impl_of xs)" 
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    34
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    35
definition empty :: "('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    36
where [code del]: "empty = Alist []"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    37
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    38
definition update :: "'key \<Rightarrow> 'value \<Rightarrow> ('key, 'value) alist \<Rightarrow> ('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    39
where [code del]: "update k v xs = Alist (AList_Impl.update k v (impl_of xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    40
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    41
(* FIXME: we use an unoptimised delete operation. *)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    42
definition delete :: "'key \<Rightarrow> ('key, 'value) alist \<Rightarrow> ('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    43
where [code del]: "delete k xs = Alist (AList_Impl.delete k (impl_of xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    44
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    45
definition map_entry :: "'key \<Rightarrow> ('value \<Rightarrow> 'value) \<Rightarrow> ('key, 'value) alist \<Rightarrow> ('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    46
where [code del]: "map_entry k f xs = Alist (AList_Impl.map_entry k f (impl_of xs))" 
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    47
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    48
definition filter :: "('key \<times> 'value \<Rightarrow> bool) \<Rightarrow> ('key, 'value) alist \<Rightarrow> ('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    49
where [code del]: "filter P xs = Alist (List.filter P (impl_of xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    50
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    51
definition map_default :: "'key => 'value => ('value => 'value) => ('key, 'value) alist => ('key, 'value) alist"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    52
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    53
  "map_default k v f xs = Alist (AList_Impl.map_default k v f (impl_of xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    54
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    55
lemma impl_of_empty [code abstract]: "impl_of empty = []"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    56
by (simp add: empty_def Alist_inverse)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    57
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    58
lemma impl_of_update [code abstract]: "impl_of (update k v xs) = AList_Impl.update k v (impl_of xs)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    59
by (simp add: update_def Alist_inverse distinct_update)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    60
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    61
lemma impl_of_delete [code abstract]:
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    62
  "impl_of (delete k al) = AList_Impl.delete k (impl_of al)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    63
unfolding delete_def by (simp add: Alist_inverse distinct_delete)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    64
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    65
lemma impl_of_map_entry [code abstract]:
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    66
  "impl_of (map_entry k f xs) = AList_Impl.map_entry k f (impl_of xs)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    67
unfolding map_entry_def by (simp add: Alist_inverse distinct_map_entry)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    68
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    69
lemma distinct_map_fst_filter:
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    70
   "distinct (map fst xs) ==> distinct (map fst (List.filter P xs))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    71
by (induct xs) auto
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    72
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    73
lemma impl_of_filter [code abstract]:
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    74
  "impl_of (filter P xs) = List.filter P (impl_of xs)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    75
unfolding filter_def by (simp add: Alist_inverse distinct_map_fst_filter)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    76
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    77
lemma impl_of_map_default [code abstract]:
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    78
  "impl_of (map_default k v f xs) = AList_Impl.map_default k v f (impl_of xs)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    79
by (auto simp add: map_default_def Alist_inverse distinct_map_default)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    80
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    81
subsection {* Abstract operation properties *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    82
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    83
(* FIXME: to be completed *)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    84
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    85
lemma lookup_empty [simp]: "lookup empty k = None"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    86
by(simp add: empty_def lookup_def Alist_inverse)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    87
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    88
lemma lookup_delete [simp]: "lookup (delete k al) = (lookup al)(k := None)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    89
by (simp add: lookup_def delete_def Alist_inverse distinct_delete delete_conv')
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    90
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    91
subsection {* Further operations *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    92
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    93
subsubsection {* Equality *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    94
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    95
instantiation alist :: (equal, equal) equal begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    96
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    97
definition "HOL.equal (xs :: ('a, 'b) alist) ys == impl_of xs = impl_of ys"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    98
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
    99
instance
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   100
proof
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   101
qed (simp add: equal_alist_def impl_of_inject)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   102
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   103
end
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   104
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   105
subsubsection {* Size *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   106
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   107
instantiation alist :: (type, type) size begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   108
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   109
definition "size (al :: ('a, 'b) alist) = length (impl_of al)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   110
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   111
instance ..
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   112
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   113
end
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   114
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   115
subsection {* Quickcheck generators *}
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   116
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   117
notation fcomp (infixl "\<circ>>" 60)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   118
notation scomp (infixl "\<circ>\<rightarrow>" 60)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   119
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   120
definition (in term_syntax)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   121
  valterm_empty :: "('key :: typerep, 'value :: typerep) alist \<times> (unit \<Rightarrow> Code_Evaluation.term)"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   122
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   123
  "valterm_empty = Code_Evaluation.valtermify empty"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   124
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   125
definition (in term_syntax)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   126
  valterm_update :: "'key :: typerep \<times> (unit \<Rightarrow> Code_Evaluation.term) \<Rightarrow>
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   127
  'value :: typerep \<times> (unit \<Rightarrow> Code_Evaluation.term) \<Rightarrow>
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   128
  ('key, 'value) alist \<times> (unit \<Rightarrow> Code_Evaluation.term) \<Rightarrow>
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   129
  ('key, 'value) alist \<times> (unit \<Rightarrow> Code_Evaluation.term)" where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   130
  [code_unfold]: "valterm_update k v a = Code_Evaluation.valtermify update {\<cdot>} k {\<cdot>} v {\<cdot>}a"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   131
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   132
fun (in term_syntax) random_aux_alist 
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   133
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   134
  "random_aux_alist i j = (if i = 0 then Pair valterm_empty else Quickcheck.collapse (Random.select_weight [(i, Quickcheck.random j \<circ>\<rightarrow> (%k. Quickcheck.random j \<circ>\<rightarrow> (%v. random_aux_alist (i - 1) j \<circ>\<rightarrow> (%a. Pair (valterm_update k v a))))), (1, Pair valterm_empty)]))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   135
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   136
instantiation alist :: (random, random) random
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   137
begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   138
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   139
definition random_alist
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   140
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   141
  "random_alist i = random_aux_alist i i"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   142
 
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   143
instance ..
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   144
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   145
end
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   146
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   147
no_notation fcomp (infixl "\<circ>>" 60)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   148
no_notation scomp (infixl "\<circ>\<rightarrow>" 60)
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   149
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   150
instantiation alist :: (exhaustive, exhaustive) exhaustive
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   151
begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   152
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   153
fun exhaustive_alist :: "(('a, 'b) alist => (bool * term list) option) => code_numeral => (bool * term list) option"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   154
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   155
  "exhaustive_alist f i = (if i = 0 then None else case f empty of Some ts => Some ts | None =>
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   156
     exhaustive_alist (%a. Quickcheck_Exhaustive.exhaustive (%k. Quickcheck_Exhaustive.exhaustive (%v. f (update k v a)) (i - 1)) (i - 1)) (i - 1))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   157
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   158
instance ..
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   159
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   160
end
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   161
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   162
instantiation alist :: (full_exhaustive, full_exhaustive) full_exhaustive
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   163
begin
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   164
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   165
fun full_exhaustive_alist :: "(('a, 'b) alist * (unit => term) => (bool * term list) option) => code_numeral => (bool * term list) option"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   166
where
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   167
  "full_exhaustive_alist f i = (if i = 0 then None else case f valterm_empty of Some ts => Some ts | None =>
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   168
     full_exhaustive_alist (%a. Quickcheck_Exhaustive.full_exhaustive (%k. Quickcheck_Exhaustive.full_exhaustive (%v. f (valterm_update k v a)) (i - 1)) (i - 1)) (i - 1))"
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   169
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   170
instance ..
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   171
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   172
end
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   173
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   174
hide_const valterm_empty valterm_update random_aux_alist
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   175
46171
19f68d7671f0 proper hiding of facts and constants in AList_Impl and AList theory
bulwahn
parents: 46167
diff changeset
   176
hide_fact (open) lookup_def empty_def update_def delete_def map_entry_def filter_def map_default_def
46167
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   177
hide_const (open) impl_of lookup empty update delete map_entry filter map_default 
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   178
25eba8a5d7d0 adding theory association lists with invariant
bulwahn
parents:
diff changeset
   179
end