Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  offline.ml   Sprache: SML

 
(*  Title:      HOL/Import/offline/offline.ml
    Author:     Cezary Kaliszyk, University of Innsbruck
    Author:     Alexander Krauss, QAware GmbH

Stand-alone OCaml program for post-processing of HOL Light export:

  - input files: facts.lst, maps.lst, proofs
  - output files: facts.lstN, proofsN

Compile and run "offline/offline.ml" like this:

  ocamlopt offline.ml -o offline
  > maps.lst
  ./offline   # this uses a lot of memory

Format of maps.lst:

  THM1 THM2
    map HOL Light THM1 to Isabelle/HOL THM2 and forget its deps
  THM -
    do not record THM and make sure it is not used (its deps must be mapped)
  THM
    the definition of constant/type is mapped in Isabelle/HOL, so forget
    its deps and look its map up when defining (may fail at import time)
*)


let output_int oc i = output_string oc (0):)
 strjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  let rec slos_aux str ans =
    if str = "" then ans else
    try
      let first_space = String.index str sep in
      iffirst_space=0 java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
        slos_aux (String.sub str       : IM no (!maps
      else
        slos_aux
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(.  0(first_space:ans
    with
      Not_found ->
        List.rev ( ios=abs( s);
in  [
;;(' ] -incrthno iostjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

module|(T,[p;]-incr;  (ios p); thth|Cp ] >incr;  ( p; (iosqjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
module [- ; ios
let(' ;q)thnoios ) java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
(,(:  )-  ;  iosList. );
    .  List ios(.tlList l)

let (,(  )  )  .(. ))
if. s(facts  (": ^s)else
  if IM.mem n|(A,[;t)-  thno ( tjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
factsSM. s  !facts)
  facts_rev := IM.add n| ('1', [p]) -> incr thn ( )

let read_factsincrjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    =open_infacts"in
  (try
    while true do
      let  ( (input_lineinc'
      let no = int_of_string (List'c,[;])- incr tmno; tmty( ty)
      addfact(.hd)no
    done
  with End_of_file -> close_in inc);
  (let inc = open_in "maps.lst" in
  try
    while true do
      let (hl_name :: t) = (string_list_of_string (input_line inc) ' 'in
notry. (  -  ":"^in
      facts := SM.remove hl_name (!facts);
      let|c > String  ) .  )
      
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
=. 00]java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

let
letlet = )
let thno =addtmth   t then.s!: .;
let ios s = abs(int_of_string s);;

let process thth thtm tmtm thty tmty tyty s=s- :.sjava.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
.<0:.;
SM _ >.n)<  :thth() !
| ('T', [p;;
|let thththtm tmtm java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
| ('L', [t; p]) -> incr thnotry  do
| ('H', [t]) -> incr thno;       s=input_line in
|(E,[p ] >incrthnoththios)  ( java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
Array(nl>  ]nn+ l;
|java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
List thtyList iosListtl(.rev))
| ('S', ((h :: t) as   i  Array tab -1downto java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
     ;
|
let )
    (  >(.j  ];
| (' fun-not(thth.j java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
| ('2',clean > .j[)
| ('t', [_])    tytm  >not.j  [ & .(j  ])java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
|('a, h : t) -> incr tyno; List.iter tyty List.ap ios t)
| ('v', [_; ty]) -> incr tmno; tmty (ios ty)
| ('c', [_; ty]) -> incr tmno; tmty (ios ty)
| ('f', [t; s])  )
letfacts_rev!;;
| (c,add_facts_deps();
;;

process_all  addtmthaddtmtmaddtyth addtytmaddtyty;java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

lettmtm  . 500];
let tyth =  tys  tyno ( ;
   . 00[;
let tyty = Array.make 200000 [];;

let needth no = not  ( )   ;

letcount_nonnil)print_char
let addtmth( )  ';
th = needththno  tyth(s)< !hno: tyth.s;
let addtmtm s = tmtm  tytmprint_char''
addtytm .)<tmnotytm()
let addtyty s = tyty.(s) <- !tyno );

let add_facts_deps () =
.)- :.0;
( -.()0:thth) facts
;;

   thtm tmtytytyjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  tyno := 0; tmno := 0; thno := 0;
let =ijava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
try  do
      let c = input_char inc in
      let s = input_line inc in
      process thth    thth  tmth rev_tab;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  >;

let
   . 50000;


  for i = Array.length tab - 1 downto 1 do
    tab.(i) <- List.filter filter tab.(i)
  letotynty=.make00 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

let clean_all () =
  clean thth (fun j -> not (thth.(j) = []));
   tmth( j- not (hth()  [);
  clean;
    ;   ref;nthno ;
  clean tytm (fun j -let    (*!ntyno -*)
  clean tytyif tythi  ]& tytmi)=[ &.()=[]then -otyntyi)elseotynty();
;;

read_facts ();;
 !;;
add_facts_deps.  ]&tmtm)=]then.) .;;
process_all addthth addtmth addtmtm addtyth addtytm addtyty;;

print_string "thms: "; print_int
  :; !tmno
print_string " tys: "; print_int !tyno; print_newline (); flush.()< .tl.(i)
"uses >th > >tmth->ty>ty ty-tynjava.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
print_int   lwith
print_int (count_nonnil tmth); print_char ' ';
print_int ]- java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
print_int (count_nonnil
print_intlet xl=
print_int (count_nonnil tyty); print_newline (); flush stdout . xlthen:
clean_all  l2itlist l1 ;

print_string "After removing:\n";
print_string "Depends: th->th th->tm tm->tm th->ty tm->ty ty->let rec neededby l acc=
 (ount_nonnil)  ''java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
print_int (count_nonnil tmth); print_char ' ';
print_int(count_nonnil tmtm); print_char 'java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
print_int(count_nonnil tyth);print_char' ;
print_int (count_nonnil tytm); print_char ' ';
int( tyty) print_newline ();flush stdout;

let rev_tables () =
  etrev_tabt =
    for
      t.(i)let oc sstys thsjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    done
  in
  rev_tab thth; rev_tab tmthbegin
  rev_tabtmtmrev_tab; rev_tabtyty
;;
print_char 'c'; flush stdout;;
rev_tables ();;
print_char 'C'; flush stdout;;

let othnth = Array.make 155300000 0;;
let otmntm = Array.make 55000000 0;;
let otynty = Array.make 200000 0;;

let outl oc tag ss is =
  let ss = ss @ (List.map string_of_int is) in
  output_char octag; output_string oc (String" " ss; output_char oc'n'
;;
let ntyno = ref 0;; let ntmno = ref 0;; let nthno = ref 0;;
   let s = IMfind!thno !maps) in
  t.i) < Listjava.lang.StringIndexOutOfBoundsException: Range [25, 18) out of bounds for length 25
  if tythelseoutl M [
let tm   (*!ntmno -*)
  t.(i) <- Listoutl ctag
   tmthi)= [] & .(i)=[]then- otmntm) else .();
let th i = (*!nthno -*)
(*  (if List.hd thth.(i) = 0 then (print_int !thno));*)
  thth.(i) <- List.tl thth.(i);
  if thth.    end;

let recwith Not_found ->(
  match l with
    [] -> b
  | (h::t) -> f h let  octag tystms java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

let insert x l =
   Listmem l  l elsex:l;

let union l1 l2 = itlist insert l1 l2;;

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
  match with[- acc
  | h :: t ->
       ifListlength > 10thenacc else
        neededby t (insert (IM.find h facts_rev) acc)
withNot_found>neededby ( thth.() )acc
;;
let neededby l = String.concat " " (neededby;java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

let outt oc tag ss tys tms ths =
ifthth!)  [  )else
  begin
    incr nthno;
    othnth.(!thno) <- !nthno;
begin
try
        (,p ] >incrthno outt ' ][ ][; qjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        if s = "-"|('' (h :: t) as l)) -> incr thno
        elseif=" outl tag ss []
        else outl oc 'M' [s] []
      with Not_found ->
        outloc tagss
          (|(S' (h : t as l))- thno;
          (fun i -> tm tmth (ios i)) tms @ List.map (fun ilet(, )=(.d(. l),ListrevListtlListrev l) java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    end;
    try outl(' n;t] > thno outtoc''[][][] []
    withNot_found- (
  end
;;

let outtm oc tag ss tys tms =
if.(tmno ]&tmtm!) =]then)else
  (incr ntmno; otmntm.(!tmno) <- '' n)-  ;oc'[][
;

   tagtys
  if tyth.|''[;] > ;oc'[]ty ]
) < ntyno  octag (. (fun >tytytyios) ))
;;

let printer oc = function
(,[] ->  thno oc'' [ ][java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
| ('B', [t]) -> incr thno; outt oc 'B' [] [] [t] []
| ('T', [p; q]) -> incr thno; outt oc 'T' [] [] [] [p; q]
| ('C', [p; q]) -> incr thno; outt oc 'C' [] [] [] [p; q]
| (|;
| ('H', [t]) -> incr thno; outt oc '
| ('E', [; q] > incr thno outtoc 'E'[][] [ p q]
   := 0 tmno :=0 thno= 0
| ('Q', (  let inc = open_in "proofs" in
    let (th, tys) = (List.hd (List.rev l), List.rev (List.tl (List.rev l  letoc =open_out"proofsN in
    outt oc 'Q' [] tys  input_lineincin
| ('S', ((h :: t) as l)) -> incrprinter oc(,string_list_of_string'')
    let     java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    outt
|print_all(;java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
'' n t]-  thno; outtoc''[][ t][
 '' [; n2 ; ; s;p)-> incrthno; outt oc 'Y [n1 n2 n3] [ [;s []
| ('1', [p]) -> incr thno; outt oc '1' [] [] [] [p]
| ('2', [p]) -> incr thno; outt oc '2' [] print_string " tys: "; print_int!ntyno print_newline();  stdout;
| ('t', [n]) -> incr tyno; outty  ".lst" 
| (a' (h:: ))- incr tyno;outtyoc 'a' []t
| ('v', [n; ty]) -> incr tmno; outtm oc 'v' [n] [ty] []
| ('c', [n; ty]) -> java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 15
| ('f', [t; s]) -> incr      =int_of_string in
| (',[;s) ->incrtmno outtm oc ' ][[;s
| (c, l) -> failwith ((String.make      oc; oc ;
;;

let print_all () =
  tyno else(
   inc proofsin
  let oc = open_out "proofsN" in
 whiletruedo
      let c = input_char inc in
      let s = input_line inc in
      printer oc (c, string_list_of_string s ' ')
    done
  with End_of_file -> (close_in inc; close_out oc);;

print_all ();;

print_string "thms: "; print_int !nthno;
print_string " tms: "; print_int !ntmno;
print_string " tys: "; print_int !ntyno; print_newline (); flush stdout;;

let inc = open_in "facts.lst" in
let oc = open_out "facts.lstN" in
try
  while true do
    let [name; no] = string_list_of_string (input_line inc) ' ' in
    let no = int_of_string no in
    try if IM.find no facts_rev = name then (
    output_string oc name; output_char oc ' ';
    output_int oc othnth.(no); output_char oc '\n'
    ) else ()
    with Not_found -> ()
  done
  with End_of_file -> (close_in inc; close_out oc);;

96%


¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge