src/HOL/Import/offline/offline.ml
author wenzelm
Wed, 12 Mar 2025 11:39:00 +0100
changeset 82265 4b875a4c83b0
parent 81933 cb05f8d3fd05
permissions -rw-r--r--
update for release;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
81933
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     1
(*  Title:      HOL/Import/offline/offline.ml
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     2
    Author:     Cezary Kaliszyk, University of Innsbruck
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     3
    Author:     Alexander Krauss, QAware GmbH
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     4
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     5
Stand-alone OCaml program for post-processing of HOL Light export:
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     6
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     7
  - input files: facts.lst, maps.lst, proofs
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     8
  - output files: facts.lstN, proofsN
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
     9
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    10
Compile and run "offline/offline.ml" like this:
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    11
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    12
  ocamlopt offline.ml -o offline
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    13
  > maps.lst
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    14
  ./offline   # this uses a lot of memory
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    15
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    16
Format of maps.lst:
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    17
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    18
  THM1 THM2
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    19
    map HOL Light THM1 to Isabelle/HOL THM2 and forget its deps
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    20
  THM -
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    21
    do not record THM and make sure it is not used (its deps must be mapped)
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    22
  THM
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    23
    the definition of constant/type is mapped in Isabelle/HOL, so forget
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    24
    its deps and look its map up when defining (may fail at import time)
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    25
*)
cb05f8d3fd05 more comments;
wenzelm
parents: 81915
diff changeset
    26
81914
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    27
let output_int oc i = output_string oc (string_of_int i);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    28
let string_list_of_string str sep =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    29
  let rec slos_aux str ans =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    30
    if str = "" then ans else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    31
    try
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    32
      let first_space = String.index str sep in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    33
      if first_space = 0 then
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    34
        slos_aux (String.sub str 1 (String.length str - 1)) ans
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    35
      else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    36
        slos_aux
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    37
          (String.sub str (first_space + 1)(String.length str - 1 - first_space))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    38
          ((String.sub str 0 (first_space)) :: ans)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    39
    with
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    40
      Not_found ->
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    41
        List.rev (str :: ans)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    42
  in slos_aux str []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    43
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    44
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    45
module SM = Map.Make(struct type t = string let compare = compare end);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    46
module IM = Map.Make(struct type t = int let compare = compare end);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    47
let facts = ref SM.empty;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    48
let maps = ref IM.empty;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    49
let facts_rev = ref IM.empty;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    50
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    51
let rec addfact s n =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    52
  if SM.mem s (!facts) then failwith ("addfact:" ^ s) else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    53
  if IM.mem n (!facts_rev) then () else (
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    54
  facts := SM.add s n (!facts);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    55
  facts_rev := IM.add n s (!facts_rev));;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    56
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    57
let read_facts () =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    58
  let inc = open_in "facts.lst" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    59
  (try
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    60
    while true do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    61
      let l = (string_list_of_string (input_line inc) ' ') in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    62
      let no = int_of_string (List.nth l 1) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    63
      addfact (List.hd l) no
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    64
    done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    65
  with End_of_file -> close_in inc);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    66
  (let inc = open_in "maps.lst" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    67
  try
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    68
    while true do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    69
      let (hl_name :: t) = (string_list_of_string (input_line inc) ' ') in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    70
      let no = try SM.find hl_name (!facts) with Not_found -> failwith ("read facts: " ^ hl_name) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    71
      facts := SM.remove hl_name (!facts);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    72
      let isa_name = if t = [] then "" else List.hd t in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    73
      maps := IM.add no isa_name (!maps);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    74
    done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    75
  with End_of_file -> close_in inc);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    76
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    77
let tyno = ref 0;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    78
let tmno = ref 0;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    79
let thno = ref 0;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    80
let ios s = abs(int_of_string s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    81
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    82
let process thth thtm tmtm thty tmty tyty = function
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    83
  ('R', [t]) -> incr thno; thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    84
| ('B', [t]) -> incr thno; thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    85
| ('T', [p; q]) -> incr thno; thth (ios p); thth (ios q)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    86
| ('C', [p; q]) -> incr thno; thth (ios p); thth (ios q)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    87
| ('L', [t; p]) -> incr thno; thth (ios p); thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    88
| ('H', [t]) -> incr thno; thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    89
| ('E', [p; q]) -> incr thno; thth (ios p); thth (ios q)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    90
| ('D', [p; q]) -> incr thno; thth (ios p); thth (ios q)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    91
| ('Q', ((h :: t) as l)) -> incr thno; thth (ios (List.hd (List.rev l)));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    92
    List.iter thty (List.map ios (List.tl (List.rev l)))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    93
| ('S', ((h :: t) as l)) -> incr thno; thth (ios (List.hd (List.rev l)));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    94
    List.iter thtm (List.map ios (List.tl (List.rev l)))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    95
| ('A', [_; t]) -> incr thno; thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    96
| ('F', [_; t]) -> incr thno; thtm (ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    97
| ('Y', [_; _; _; t; s; p]) -> incr thno; thth (ios p); thtm (ios t); thtm (ios s)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    98
| ('1', [p]) -> incr thno; thth (ios p)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
    99
| ('2', [p]) -> incr thno; thth (ios p)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   100
| ('t', [_]) -> incr tyno
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   101
| ('a', (h :: t)) -> incr tyno; List.iter tyty (List.map ios t)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   102
| ('v', [_; ty]) -> incr tmno; tmty (ios ty)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   103
| ('c', [_; ty]) -> incr tmno; tmty (ios ty)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   104
| ('f', [t; s]) -> incr tmno; tmtm (ios t); tmtm (ios s)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   105
| ('l', [t; s]) -> incr tmno; tmtm (ios t); tmtm (ios s)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   106
| (c, l) -> failwith ((String.make 1 c) ^ (String.concat " " l))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   107
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   108
81915
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   109
let thth = Array.make 155097624 [];;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   110
let tmth = Array.make 55000000 [];;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   111
let tmtm = Array.make 55000000 [];;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   112
let tyth = Array.make 200000 [];;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   113
let tytm = Array.make 200000 [];;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   114
let tyty = Array.make 200000 [];;
81914
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   115
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   116
let needth no = not (IM.mem no !maps);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   117
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   118
let addthth s = if needth !thno then thth.(s) <- !thno :: thth.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   119
let addtmth s = if needth !thno then tmth.(s) <- !thno :: tmth.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   120
let addtyth s = if needth !thno then tyth.(s) <- !thno :: tyth.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   121
let addtmtm s = tmtm.(s) <- !tmno :: tmtm.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   122
let addtytm s = tytm.(s) <- !tmno :: tytm.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   123
let addtyty s = tyty.(s) <- !tyno :: tyty.(s);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   124
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   125
let add_facts_deps () =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   126
  thth.(0) <- 0 :: thth.(0);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   127
  SM.iter (fun _ n -> thth.(n) <- 0 :: thth.(n)) !facts
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   128
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   129
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   130
let process_all thth thtm tmtm thty tmty tyty =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   131
  tyno := 0; tmno := 0; thno := 0;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   132
  let inc = open_in "proofs" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   133
  try while true do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   134
      let c = input_char inc in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   135
      let s = input_line inc in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   136
      process thth thtm tmtm thty tmty tyty (c, (string_list_of_string s ' '))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   137
    done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   138
  with End_of_file -> close_in inc;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   139
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   140
let count_nonnil l =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   141
  Array.fold_left (fun n l -> if l = [] then n else n + 1) 0 l;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   142
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   143
let clean tab filter =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   144
  for i = Array.length tab - 1 downto 1 do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   145
    tab.(i) <- List.filter filter tab.(i)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   146
  done;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   147
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   148
let clean_all () =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   149
  clean thth (fun j -> not (thth.(j) = []));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   150
  clean tmth (fun j -> not (thth.(j) = []));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   151
  clean tmtm (fun j -> not (tmth.(j) = [] && tmtm.(j) = []));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   152
  clean tyth (fun j -> not (thth.(j) = []));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   153
  clean tytm (fun j -> not (tmth.(j) = [] && tmtm.(j) = []));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   154
  clean tyty (fun j -> not (tyth.(j) = [] && tytm.(j) = [] && tyty.(j) = []))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   155
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   156
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   157
read_facts ();;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   158
let facts_rev = !facts_rev;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   159
add_facts_deps ();;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   160
process_all addthth addtmth addtmtm addtyth addtytm addtyty;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   161
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   162
print_string "thms: "; print_int !thno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   163
print_string " tms: "; print_int !tmno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   164
print_string " tys: "; print_int !tyno; print_newline (); flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   165
print_string "Direct uses: th->th th->tm tm->tm th->ty tm->ty ty->ty: \n";
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   166
print_int (count_nonnil thth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   167
print_int (count_nonnil tmth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   168
print_int (count_nonnil tmtm); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   169
print_int (count_nonnil tyth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   170
print_int (count_nonnil tytm); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   171
print_int (count_nonnil tyty); print_newline (); flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   172
clean_all ();;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   173
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   174
print_string "After removing:\n";
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   175
print_string "Depends: th->th th->tm tm->tm th->ty tm->ty ty->ty: \n";
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   176
print_int (count_nonnil thth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   177
print_int (count_nonnil tmth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   178
print_int (count_nonnil tmtm); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   179
print_int (count_nonnil tyth); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   180
print_int (count_nonnil tytm); print_char ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   181
print_int (count_nonnil tyty); print_newline (); flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   182
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   183
let rev_tables () =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   184
  let rev_tab t =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   185
    for i = 0 to Array.length t - 1 do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   186
      t.(i) <- List.rev (t.(i));
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   187
    done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   188
  in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   189
  rev_tab thth; rev_tab tmth; rev_tab tyth;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   190
  rev_tab tmtm; rev_tab tytm; rev_tab tyty
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   191
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   192
print_char 'c'; flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   193
rev_tables ();;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   194
print_char 'C'; flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   195
81915
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   196
let othnth = Array.make 155300000 0;;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   197
let otmntm = Array.make 55000000 0;;
02e107686442 move material from https://gitlab.inria.fr/hol-light-isabelle/hol-light 72b2b702eadb and https://gitlab.inria.fr/hol-light-isabelle/import ce58755b0232 into Isabelle repository: results from running "isabelle component_hol_light_import" of previous version;
wenzelm
parents: 81914
diff changeset
   198
let otynty = Array.make 200000 0;;
81914
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   199
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   200
let outl oc tag ss is =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   201
  let ss = ss @ (List.map string_of_int is) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   202
  output_char oc tag; output_string oc (String.concat " " ss); output_char oc '\n'
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   203
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   204
let ntyno = ref 0;; let ntmno = ref 0;; let nthno = ref 0;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   205
let ty t i = (*!ntyno -*)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   206
  t.(i) <- List.tl t.(i);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   207
  if tyth.(i) = [] && tytm.(i) = [] && tyty.(i) = [] then (- otynty.(i)) else otynty.(i);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   208
let tm t i = (*!ntmno -*)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   209
  t.(i) <- List.tl t.(i);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   210
  if tmth.(i) = [] && tmtm.(i) = [] then (- otmntm.(i)) else otmntm.(i);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   211
let th i = (*!nthno -*)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   212
(*  (if List.hd thth.(i) = 0 then (print_int !thno));*)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   213
  thth.(i) <- List.tl thth.(i);
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   214
  if thth.(i) = [] then (- othnth.(i)) else othnth.(i);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   215
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   216
let rec itlist f l b =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   217
  match l with
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   218
    [] -> b
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   219
  | (h::t) -> f h (itlist f t b);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   220
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   221
let insert x l =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   222
  if List.mem x l then l else x::l;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   223
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   224
let union l1 l2 = itlist insert l1 l2;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   225
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   226
let rec neededby l acc =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   227
  match l with [] -> acc
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   228
  | h :: t ->
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   229
      try if List.length acc > 10 then acc else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   230
        neededby t (insert (IM.find h facts_rev) acc)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   231
      with Not_found -> neededby (union thth.(h) t) acc
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   232
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   233
let neededby l = String.concat " " (neededby l [])
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   234
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   235
let outt oc tag ss tys tms ths =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   236
  if thth.(!thno) = [] then () else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   237
  begin
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   238
    incr nthno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   239
    othnth.(!thno) <- !nthno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   240
    begin
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   241
      try
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   242
        let s = IM.find (!thno) (!maps) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   243
        if s = "-" then failwith ("removed thm:" ^ IM.find !thno facts_rev ^ " around:" ^ neededby (thth.(!thno)))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   244
        else if s = "" then outl oc tag ss []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   245
        else outl oc 'M' [s] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   246
      with Not_found ->
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   247
        outl oc tag ss
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   248
          (List.map (fun i -> ty tyth (ios i)) tys @ List.map
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   249
          (fun i -> tm tmth (ios i)) tms @ List.map (fun i -> th (ios i)) ths)
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   250
    end;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   251
    try outl oc '+' [IM.find (!thno) facts_rev] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   252
    with Not_found -> ()
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   253
  end
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   254
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   255
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   256
let outtm oc tag ss tys tms =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   257
  if tmth.(!tmno) = [] && tmtm.(!tmno) = [] then () else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   258
  (incr ntmno; otmntm.(!tmno) <- !ntmno; outl oc tag ss (List.map (fun i -> ty tytm (ios i)) tys @ List.map (fun i -> tm tmtm (ios i)) tms))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   259
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   260
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   261
let outty oc tag ss tys =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   262
  if tyth.(!tyno) = [] && tytm.(!tyno) = [] && tyty.(!tyno) = [] then () else
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   263
  (incr ntyno; otynty.(!tyno) <- !ntyno; outl oc tag ss (List.map (fun i -> ty tyty (ios i)) tys))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   264
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   265
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   266
let printer oc = function
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   267
  ('R', [t]) -> incr thno; outt oc 'R' [] [] [t] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   268
| ('B', [t]) -> incr thno; outt oc 'B' [] [] [t] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   269
| ('T', [p; q]) -> incr thno; outt oc 'T' [] [] [] [p; q]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   270
| ('C', [p; q]) -> incr thno; outt oc 'C' [] [] [] [p; q]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   271
| ('L', [t; p]) -> incr thno; outt oc 'L' [] [] [t] [p]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   272
| ('H', [t]) -> incr thno; outt oc 'H' [] [] [t] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   273
| ('E', [p; q]) -> incr thno; outt oc 'E' [] [] [] [p; q]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   274
| ('D', [p; q]) -> incr thno; outt oc 'D' [] [] [] [p; q]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   275
| ('Q', ((h :: t) as l)) -> incr thno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   276
    let (th, tys) = (List.hd (List.rev l), List.rev (List.tl (List.rev l))) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   277
    outt oc 'Q' [] tys [] [th]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   278
| ('S', ((h :: t) as l)) -> incr thno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   279
    let (th, tms) = (List.hd (List.rev l), List.rev (List.tl (List.rev l))) in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   280
    outt oc 'S' [] [] tms [th]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   281
| ('A', [n; t]) -> incr thno; outt oc 'A' [n] [] [t] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   282
| ('F', [n; t]) -> incr thno; outt oc 'F' [n] [] [t] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   283
| ('Y', [n1; n2; n3; t; s; p]) -> incr thno; outt oc 'Y' [n1; n2; n3] [] [t; s] [p]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   284
| ('1', [p]) -> incr thno; outt oc '1' [] [] [] [p]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   285
| ('2', [p]) -> incr thno; outt oc '2' [] [] [] [p]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   286
| ('t', [n]) -> incr tyno; outty oc 't' [n] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   287
| ('a', (h :: t)) -> incr tyno; outty oc 'a' [h] t
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   288
| ('v', [n; ty]) -> incr tmno; outtm oc 'v' [n] [ty] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   289
| ('c', [n; ty]) -> incr tmno; outtm oc 'c' [n] [ty] []
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   290
| ('f', [t; s]) -> incr tmno; outtm oc 'f' [] [] [t; s]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   291
| ('l', [t; s]) -> incr tmno; outtm oc 'l' [] [] [t; s]
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   292
| (c, l) -> failwith ((String.make 1 c) ^ (String.concat " " l))
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   293
;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   294
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   295
let print_all () =
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   296
  tyno := 0; tmno := 0; thno := 0;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   297
  let inc = open_in "proofs" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   298
  let oc = open_out "proofsN" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   299
  try while true do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   300
      let c = input_char inc in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   301
      let s = input_line inc in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   302
      printer oc (c, string_list_of_string s ' ')
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   303
    done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   304
  with End_of_file -> (close_in inc; close_out oc);;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   305
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   306
print_all ();;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   307
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   308
print_string "thms: "; print_int !nthno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   309
print_string " tms: "; print_int !ntmno;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   310
print_string " tys: "; print_int !ntyno; print_newline (); flush stdout;;
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   311
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   312
let inc = open_in "facts.lst" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   313
let oc = open_out "facts.lstN" in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   314
try
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   315
  while true do
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   316
    let [name; no] = string_list_of_string (input_line inc) ' ' in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   317
    let no = int_of_string no in
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   318
    try if IM.find no facts_rev = name then (
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   319
    output_string oc name; output_char oc ' ';
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   320
    output_int oc othnth.(no); output_char oc '\n'
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   321
    ) else ()
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   322
    with Not_found -> ()
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   323
  done
b520eb5c8223 original HOL Light "offline" material by Cezary Kaliszyk and Alexander Krauss, from http://cl-informatik.uibk.ac.at/users/cek/import/holimport.tgz 27-Nov-2013 (37372 bytes);
wenzelm
parents:
diff changeset
   324
  with End_of_file -> (close_in inc; close_out oc);;