doc-src/Tutorial/Datatype/update
author paulson
Thu, 26 Sep 2002 15:21:38 +0200
changeset 13588 07b66a557487
parent 5851 15ce4c1c8313
permissions -rw-r--r--
Renamed Integ/int.ML to Integ/Int_lemmas.ML to prevent confusion with Int.ML (which is automatically loaded with Int.thy) on case-insensitive filesystems.

consts update :: ('a,'v)trie => 'a list => 'v => ('a,'v)trie

primrec
  "update t []     v = Trie (Some v) (alist t)"
  "update t (a#as) v = (let tt = (case assoc (alist t) a of
                                    None => Trie None [] | Some at => at)
                        in Trie (value t) ((a,update tt as v)#alist t))"