src/ZF/ex/bin.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
clasohm@0
     1
(*  Title: 	ZF/ex/bin.ML
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Datatype of binary integers
clasohm@0
     7
*)
clasohm@0
     8
clasohm@0
     9
(*Example of a datatype with an infix constructor*)
clasohm@0
    10
structure Bin = Datatype_Fun
clasohm@0
    11
 (val thy = Univ.thy;
clasohm@0
    12
  val rec_specs = 
clasohm@0
    13
      [("bin", "univ(0)",
clasohm@0
    14
	  [(["Plus", "Minus"],	"i"),
clasohm@0
    15
	   (["op $$"],		"[i,i]=>i")])];
clasohm@0
    16
  val rec_styp = "i";
lcp@16
    17
  val ext = Some (Syntax.simple_sext [Infixl("$$", "[i,i] => i", 60)]);
clasohm@0
    18
  val sintrs = 
clasohm@0
    19
	  ["Plus : bin",
clasohm@0
    20
	   "Minus : bin",
clasohm@0
    21
	   "[| w: bin;  b: bool |] ==> w$$b : bin"];
clasohm@0
    22
  val monos = [];
lcp@71
    23
  val type_intrs = datatype_intrs @ [bool_into_univ];
clasohm@0
    24
  val type_elims = []);
clasohm@0
    25
clasohm@0
    26
(*Perform induction on l, then prove the major premise using prems. *)
clasohm@0
    27
fun bin_ind_tac a prems i = 
clasohm@0
    28
    EVERY [res_inst_tac [("x",a)] Bin.induct i,
clasohm@0
    29
	   rename_last_tac a ["1"] (i+3),
clasohm@0
    30
	   ares_tac prems i];
clasohm@0
    31