File: finite_sets.ml

package info (click to toggle)
hol88 2.02.19940316-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 63,052 kB
  • ctags: 19,365
  • sloc: ml: 199,939; ansic: 9,300; sh: 7,118; makefile: 6,076; lisp: 2,747; yacc: 894; sed: 201; cpp: 87; awk: 5
file content (69 lines) | stat: -rw-r--r-- 2,993 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
% ===================================================================== %
% FILE		: finite_sets.ml					%
% DESCRIPTION   : loads the library "finite_sets" into hol.		%
%									%
% AUTHOR	: T. Melham						%
% DATE		: 92.02.15						%
% ===================================================================== %

% --------------------------------------------------------------------- %
% Put the pathname to the library finite_sets onto the search path.	%
% --------------------------------------------------------------------- %

let path = library_pathname() ^ `/finite_sets/` in
    tty_write `Updating search path`; 
    set_search_path (union (search_path()) [path]);;

% --------------------------------------------------------------------- %
% Add the help files to online help.					%
% --------------------------------------------------------------------- %

let path = library_pathname() ^ `/finite_sets/help/entries/` in
    print_newline();
    tty_write `Updating help search path`; 
    set_help_search_path (union [path] (help_search_path()));;

% --------------------------------------------------------------------- %
% Load (or attempt to load) the theory finite_sets			%
% --------------------------------------------------------------------- %

if draft_mode() 
   then (print_newline();
         print_string `Declaring theory finite_sets a new parent`;
         print_newline();
         new_parent `finite_sets`)
   else (print_newline();
         load_theory `finite_sets` ?
         (tty_write `Defining ML function load_finite_sets`;
          loadf `load_finite_sets`;
          print_newline()));;

% --------------------------------------------------------------------- %
% Activate parser/pretty-printer support for finite_sets (if possible).	%
% --------------------------------------------------------------------- %

if (draft_mode() or (current_theory() = `finite_sets`)) then
   (define_finite_set_syntax(`EMPTY`,`INSERT`);
    set_flag(`print_set`,true); ());;

% --------------------------------------------------------------------- %
% Load compiled code if possible					%
% --------------------------------------------------------------------- %

if (draft_mode() or (current_theory() = `finite_sets`)) then
   let path st = library_pathname() ^ `/finite_sets/` ^ st in
       load(path `set_ind`, get_flag_value `print_lib`);
       load(path `fset_conv`, get_flag_value `print_lib`);;

% --------------------------------------------------------------------- %
% Set up autoloading of definitions and theorems from finite_sets.th	%
% --------------------------------------------------------------------- %

if (draft_mode() or (current_theory() = `finite_sets`)) then
   let defs = map fst (definitions `finite_sets`) in
       map (\name. autoload_theory(`definition`,`finite_sets`,name)) defs;
   let thms = map fst (theorems `finite_sets`) in
       map (\name. autoload_theory(`theorem`,`finite_sets`,name)) thms; 
   delete_cache `finite_sets`; ();;