src/ZF/ex/Prop.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/prop.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 propositional logic formulae and inductive definition
clasohm@0
     7
of the propositional tautologies.
clasohm@0
     8
*)
clasohm@0
     9
clasohm@0
    10
(*Example of a datatype with mixfix syntax for some constructors*)
clasohm@0
    11
structure Prop = Datatype_Fun
clasohm@0
    12
 (val thy = Univ.thy;
clasohm@0
    13
  val rec_specs = 
clasohm@0
    14
      [("prop", "univ(0)",
clasohm@0
    15
	  [(["Fls"],	"i"),
clasohm@0
    16
	   (["Var"],	"i=>i"),
clasohm@0
    17
	   (["op =>"],	"[i,i]=>i")])];
clasohm@0
    18
  val rec_styp = "i";
clasohm@0
    19
  val ext = Some (NewSext {
clasohm@0
    20
	     mixfix =
clasohm@0
    21
	      [Mixfix("#_", "i => i", "Var", [100], 100),
clasohm@0
    22
	       Infixr("=>", "[i,i] => i", 90)],
clasohm@0
    23
	     xrules = [],
clasohm@0
    24
	     parse_ast_translation = [],
clasohm@0
    25
	     parse_preproc = None,
clasohm@0
    26
	     parse_postproc = None,
clasohm@0
    27
	     parse_translation = [],
clasohm@0
    28
	     print_translation = [],
clasohm@0
    29
	     print_preproc = None,
clasohm@0
    30
	     print_postproc = None,
clasohm@0
    31
	     print_ast_translation = []});
clasohm@0
    32
  val sintrs = 
clasohm@0
    33
	  ["Fls : prop",
clasohm@0
    34
	   "n: nat ==> #n : prop",
clasohm@0
    35
	   "[| p: prop;  q: prop |] ==> p=>q : prop"];
clasohm@0
    36
  val monos = [];
clasohm@0
    37
  val type_intrs = data_typechecks;
clasohm@0
    38
  val type_elims = []);
clasohm@0
    39
clasohm@0
    40
val [FlsI,VarI,ImpI] = Prop.intrs;
clasohm@0
    41
clasohm@0
    42
clasohm@0
    43
(** Type-checking rules **)
clasohm@0
    44
clasohm@0
    45
val ImpE = Prop.mk_cases Prop.con_defs "p=>q : prop";
clasohm@0
    46
clasohm@0
    47
writeln"Reached end of file.";