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