src/ZF/ex/Term.thy
author lcp
Tue Aug 16 18:58:42 1994 +0200 (1994-08-16)
changeset 532 851df239ac8b
parent 515 abcc438e7c27
child 740 281881c08397
permissions -rw-r--r--
ZF/Makefile,ROOT.ML, ZF/ex/Integ.thy: updated for EquivClass
lcp@515
     1
(*  Title: 	ZF/ex/Term.thy
lcp@515
     2
    ID:         $Id$
lcp@515
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
lcp@515
     4
    Copyright   1994  University of Cambridge
lcp@515
     5
lcp@515
     6
Terms over an alphabet.
lcp@515
     7
Illustrates the list functor (essentially the same type as in Trees & Forests)
lcp@515
     8
*)
lcp@515
     9
lcp@515
    10
Term = List +
lcp@515
    11
consts
lcp@515
    12
  term_rec  :: "[i, [i,i,i]=>i] => i"
lcp@515
    13
  term_map  :: "[i=>i, i] => i"
lcp@515
    14
  term_size :: "i=>i"
lcp@515
    15
  reflect   :: "i=>i"
lcp@515
    16
  preorder  :: "i=>i"
lcp@515
    17
lcp@515
    18
  term      :: "i=>i"
lcp@515
    19
lcp@515
    20
datatype
lcp@515
    21
  "term(A)" = Apply ("a: A", "l: list(term(A))")
lcp@515
    22
  monos	      "[list_mono]"
lcp@515
    23
  type_intrs  "[list_univ RS subsetD]"
lcp@515
    24
lcp@515
    25
rules
lcp@515
    26
  term_rec_def
lcp@515
    27
   "term_rec(t,d) == \
lcp@515
    28
\   Vrec(t, %t g. term_case(%x zs. d(x, zs, map(%z.g`z, zs)), t))"
lcp@515
    29
lcp@515
    30
  term_map_def	"term_map(f,t) == term_rec(t, %x zs rs. Apply(f(x), rs))"
lcp@515
    31
lcp@515
    32
  term_size_def	"term_size(t) == term_rec(t, %x zs rs. succ(list_add(rs)))"
lcp@515
    33
lcp@515
    34
  reflect_def	"reflect(t) == term_rec(t, %x zs rs. Apply(x, rev(rs)))"
lcp@515
    35
lcp@515
    36
  preorder_def	"preorder(t) == term_rec(t, %x zs rs. Cons(x, flat(rs)))"
lcp@515
    37
lcp@515
    38
end