src/ZF/ex/comb.ML
 author lcp Tue Aug 16 18:58:42 1994 +0200 (1994-08-16) changeset 532 851df239ac8b parent 71 729fe026c5f3 permissions -rw-r--r--
ZF/Makefile,ROOT.ML, ZF/ex/Integ.thy: updated for EquivClass
```     1 (*  Title: 	ZF/ex/comb.ML
```
```     2     ID:         \$Id\$
```
```     3     Author: 	Lawrence C Paulson
```
```     4     Copyright   1993  University of Cambridge
```
```     5
```
```     6 Datatype definition of combinators S and K
```
```     7
```
```     8 J. Camilleri and T. F. Melham.
```
```     9 Reasoning with Inductively Defined Relations in the HOL Theorem Prover.
```
```    10 Report 265, University of Cambridge Computer Laboratory, 1992.
```
```    11 *)
```
```    12
```
```    13
```
```    14 (*Example of a datatype with mixfix syntax for some constructors*)
```
```    15 structure Comb = Datatype_Fun
```
```    16  (val thy = Univ.thy;
```
```    17   val rec_specs =
```
```    18       [("comb", "univ(0)",
```
```    19 	  [(["K","S"],	"i"),
```
```    20 	   (["op #"],	"[i,i]=>i")])];
```
```    21   val rec_styp = "i";
```
```    22   val ext = Some (Syntax.simple_sext [Infixl("#", "[i,i] => i", 90)]);
```
```    23   val sintrs =
```
```    24 	  ["K : comb",
```
```    25 	   "S : comb",
```
```    26 	   "[| p: comb;  q: comb |] ==> p#q : comb"];
```
```    27   val monos = [];
```
```    28   val type_intrs = datatype_intrs;
```
```    29   val type_elims = []);
```
```    30
```
```    31 val [K_comb,S_comb,Ap_comb] = Comb.intrs;
```
```    32
```
```    33 val Ap_E = Comb.mk_cases Comb.con_defs "p#q : comb";
```
```    34
```