| author | lcp | 
| Wed, 03 May 1995 13:55:05 +0200 | |
| changeset 1091 | f55f54a032ce | 
| parent 477 | 53fc8ad84b33 | 
| permissions | -rw-r--r-- | 
| 0 | 1 | (* Title: ZF/ex/prop.ML | 
| 2 | ID: $Id$ | |
| 3 | Author: Lawrence C Paulson | |
| 4 | Copyright 1993 University of Cambridge | |
| 5 | ||
| 6 | Datatype definition of propositional logic formulae and inductive definition | |
| 7 | of the propositional tautologies. | |
| 8 | *) | |
| 9 | ||
| 10 | (*Example of a datatype with mixfix syntax for some constructors*) | |
| 11 | structure Prop = Datatype_Fun | |
| 12 | (val thy = Univ.thy; | |
| 477 | 13 | val thy_name = "Prop"; | 
| 0 | 14 | val rec_specs = | 
| 15 |       [("prop", "univ(0)",
 | |
| 445 | 16 | [(["Fls"], "i",NoSyn), | 
| 17 | 	   (["Var"],	"i=>i", Mixfix ("#_", [100], 100)),
 | |
| 18 | (["=>"], "[i,i]=>i", Infixr 90)])]; | |
| 0 | 19 | val rec_styp = "i"; | 
| 20 | val sintrs = | |
| 21 | ["Fls : prop", | |
| 22 | "n: nat ==> #n : prop", | |
| 23 | "[| p: prop; q: prop |] ==> p=>q : prop"]; | |
| 24 | val monos = []; | |
| 71 
729fe026c5f3
sample datatype defs now use datatype_intrs, datatype_elims
 lcp parents: 
16diff
changeset | 25 | val type_intrs = datatype_intrs; | 
| 0 | 26 | val type_elims = []); | 
| 27 | ||
| 28 | val [FlsI,VarI,ImpI] = Prop.intrs; | |
| 29 | ||
| 30 | ||
| 31 | (** Type-checking rules **) | |
| 32 | ||
| 33 | val ImpE = Prop.mk_cases Prop.con_defs "p=>q : prop"; | |
| 34 | ||
| 35 | writeln"Reached end of file."; |