File: pred_sets.ml

package info (click to toggle)
hol88 2.02.19940316-8
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 63,120 kB
  • ctags: 19,367
  • sloc: ml: 199,939; ansic: 9,300; sh: 7,118; makefile: 6,074; lisp: 2,747; yacc: 894; sed: 201; cpp: 87; awk: 5
file content (71 lines) | stat: -rw-r--r-- 3,048 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
70
71
% ===================================================================== %
% FILE		: pred_sets.ml						%
% DESCRIPTION   : loads the library "pred_sets" into hol.		%
%									%
% AUTHOR	: T. Melham						%
% DATE		: 92.02.08						%
% ===================================================================== %

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

let path = library_pathname() ^ `/pred_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() ^ `/pred_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 pred_sets			%
% --------------------------------------------------------------------- %

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

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

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

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

if (draft_mode() or (current_theory() = `pred_sets`)) then
   let path st = library_pathname() ^ `/pred_sets/` ^ st in
       load(path `gspec`, get_flag_value `print_lib`);
       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 pred_sets.th	%
% --------------------------------------------------------------------- %

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