--- /dev/null
+UTILITIES = create_environment parse_library list_uris
+UTILITIES_OPT = $(patsubst %,%.opt,$(UTILITIES))
+LINKOPTS = -linkpkg -thread
+LIBS = helm-cic_proof_checking
+OCAMLC = ocamlfind ocamlc $(LINKOPTS) -package $(LIBS)
+OCAMLOPT = ocamlfind opt $(LINKOPTS) -package $(LIBS)
+all: $(UTILITIES)
+opt: $(UTILITIES_OPT)
+%: %.ml
+ $(OCAMLC) -o $@ $<
+%.opt: %.ml
+ $(OCAMLOPT) -o $@ $<
+clean:
+ rm -f $(UTILITIES) $(UTILITIES_OPT) *.cm[iox] *.o
+
--- /dev/null
+
+let trust = true
+
+let outfname =
+ match Sys.argv.(1) with
+ | "-help" | "--help" | "-h" | "--h" ->
+ print_endline
+ ("Usage: create_environment <dumpfile> <uri_index>\n" ^
+ " <dumpfile> is the file where environment will be dumped\n" ^
+ " <uri_index> is the file containing the URIs, one per line,\n" ^
+ " that will be typechecked. Could be \"-\" for\n" ^
+ " standard input");
+ flush stdout;
+ exit 0
+ | f -> f
+let _ =
+ CicEnvironment.set_trust (fun _ -> trust);
+ Helm_registry.set "getter.mode" "remote";
+ Helm_registry.set "getter.url" "http://mowgli.cs.unibo.it:58081/";
+ Sys.catch_break true;
+ if Sys.file_exists outfname then begin
+ let ic = open_in outfname in
+ CicEnvironment.restore_from_channel ic;
+ close_in ic
+ end
+let urifname =
+ try
+ Sys.argv.(2)
+ with Invalid_argument _ -> "-"
+let ic =
+ match urifname with
+ | "-" -> stdin
+ | fname -> open_in fname
+let _ =
+ try
+ while true do
+(* try *)
+ let uri = input_line ic in
+ print_endline uri;
+ flush stdout;
+ let uri = UriManager.uri_of_string uri in
+ ignore (CicTypeChecker.typecheck uri CicUniv.empty_ugraph)
+(* with Sys.Break -> () *)
+ done
+ with End_of_file | Sys.Break ->
+ let oc = open_out outfname in
+ CicEnvironment.dump_to_channel oc;
+ close_out oc
+
--- /dev/null
+let ic = open_in Sys.argv.(1) in
+CicEnvironment.restore_from_channel ic;
+List.iter
+ (fun uri -> print_endline (UriManager.string_of_uri uri))
+ (CicEnvironment.list_uri ())
--- /dev/null
+
+let trust = true
+
+let _ =
+ CicEnvironment.set_trust (fun _ -> trust);
+ Helm_registry.set "getter.mode" "remote";
+ Helm_registry.set "getter.url" "http://mowgli.cs.unibo.it:58081/"
+let urifname =
+ try
+ Sys.argv.(1)
+ with Invalid_argument _ -> "-"
+let ic =
+ match urifname with
+ | "-" -> stdin
+ | fname -> open_in fname
+let _ =
+ try
+ while true do
+ try
+ let uri = input_line ic in
+ prerr_endline uri;
+ let uri = UriManager.uri_of_string uri in
+ ignore (CicEnvironment.get_obj CicUniv.empty_ugraph uri)
+(* with Sys.Break -> () *)
+ with
+ | End_of_file -> raise End_of_file
+ | exn -> ()
+ done
+ with End_of_file -> Unix.sleep max_int
+