src/ZF/ROOT.ML
author lcp
Fri, 17 Sep 1993 12:53:53 +0200
changeset 5 75e163863e16
parent 0 a5a9c433f639
child 6 8ce8c4d13d4d
permissions -rw-r--r--
test commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	ZF/ROOT
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
Adds Zermelo-Fraenkel Set Theory to a database containing First-Order Logic.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
This theory is the work of Martin Coen, Philippe Noel and Lawrence Paulson.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
val banner = "ZF Set Theory (in FOL)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
writeln banner;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
(*For Pure/drule??  Multiple resolution infixes*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
infix 0 MRS MRL;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
(*Resolve a list of rules against bottom_rl from right to left*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
fun rls MRS bottom_rl = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
  let fun rs_aux i [] = bottom_rl
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
	| rs_aux i (rl::rls) = rl RSN (i, rs_aux (i+1) rls)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
  in  rs_aux 1 rls  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
fun rlss MRL bottom_rls = 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
  let fun rs_aux i [] = bottom_rls
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
	| rs_aux i (rls::rlss) = rls RLN (i, rs_aux (i+1) rlss)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
  in  rs_aux 1 rlss  end;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
5
75e163863e16 test commit
lcp
parents: 0
diff changeset
    27
fun CHECK_SOLVED (Tactic tf) = 
75e163863e16 test commit
lcp
parents: 0
diff changeset
    28
  Tactic (fn state => 
75e163863e16 test commit
lcp
parents: 0
diff changeset
    29
    case Sequence.pull (tf state) of
75e163863e16 test commit
lcp
parents: 0
diff changeset
    30
	None => error"DO_GOAL: tactic list failed"
75e163863e16 test commit
lcp
parents: 0
diff changeset
    31
      | Some(x,_) => 
75e163863e16 test commit
lcp
parents: 0
diff changeset
    32
		if has_fewer_prems 1 x then
75e163863e16 test commit
lcp
parents: 0
diff changeset
    33
		    Sequence.cons(x, Sequence.null)
75e163863e16 test commit
lcp
parents: 0
diff changeset
    34
		else (writeln"DO_GOAL: unsolved goals!!";
75e163863e16 test commit
lcp
parents: 0
diff changeset
    35
		      writeln"Final proof state was ...";
75e163863e16 test commit
lcp
parents: 0
diff changeset
    36
		      print_goals (!goals_limit) x;
75e163863e16 test commit
lcp
parents: 0
diff changeset
    37
		      raise ERROR));
75e163863e16 test commit
lcp
parents: 0
diff changeset
    38
75e163863e16 test commit
lcp
parents: 0
diff changeset
    39
fun DO_GOAL tfs = SELECT_GOAL (CHECK_SOLVED (EVERY1 tfs));
75e163863e16 test commit
lcp
parents: 0
diff changeset
    40
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
print_depth 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
use_thy "zf";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
use     "upair.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
use     "subset.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
use     "pair.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
use     "domrange.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
use     "func.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
use     "equalities.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
use     "simpdata.ML";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
(*further development*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
use_thy "bool";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
use_thy "sum";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
use_thy "qpair";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
use     "mono.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
use_thy "fixedpt";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
(*Inductive/co-inductive definitions*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
use     "ind-syntax.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
use     "intr-elim.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
use     "indrule.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
use     "inductive.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
use     "co-inductive.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
use_thy "perm";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
use_thy "trancl";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
use_thy "wf";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
use_thy "ordinal";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
use_thy "nat";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
use_thy "epsilon";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
use_thy "arith";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
(*Datatype/co-datatype definitions*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
use_thy "univ";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
use_thy "quniv";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
use     "constructor.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
use     "datatype.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
use     "fin.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
use     "list.ML";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
use_thy "list-fn";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
(*printing functions are inherited from FOL*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
print_depth 8;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
val ZF_build_completed = ();	(*indicate successful build*)