src/ZF/ex/comb.ML
author clasohm
Thu, 16 Sep 1993 12:20:38 +0200
changeset 0 a5a9c433f639
child 16 0b033d50ca1c
permissions -rw-r--r--
Initial revision
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	ZF/ex/comb.ML
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Datatype definition of combinators S and K
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
J. Camilleri and T. F. Melham.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
Reasoning with Inductively Defined Relations in the HOL Theorem Prover.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
Report 265, University of Cambridge Computer Laboratory, 1992.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
(*Example of a datatype with mixfix syntax for some constructors*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
structure Comb = Datatype_Fun
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
 (val thy = Univ.thy;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
  val rec_specs = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
      [("comb", "univ(0)",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
	  [(["K","S"],	"i"),
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
	   (["op #"],	"[i,i]=>i")])];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
  val rec_styp = "i";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
  val ext = Some (NewSext {
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
	     mixfix =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
	      [Infixl("#", "[i,i] => i", 90)],
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
	     xrules = [],
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
	     parse_ast_translation = [],
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
	     parse_preproc = None,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
	     parse_postproc = None,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
	     parse_translation = [],
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
	     print_translation = [],
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
	     print_preproc = None,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
	     print_postproc = None,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
	     print_ast_translation = []});
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
  val sintrs = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
	  ["K : comb",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
	   "S : comb",
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
	   "[| p: comb;  q: comb |] ==> p#q : comb"];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
  val monos = [];
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
  val type_intrs = data_typechecks;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
  val type_elims = []);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
val [K_comb,S_comb,Ap_comb] = Comb.intrs;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
val Ap_E = Comb.mk_cases Comb.con_defs "p#q : comb";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45