@ -31,8 +31,8 @@ let load_from_cache serializer zip_path cache_dir zip_library =
DB . filename_from_string to_path
DB . filename_from_string to_path
in
in
match deserialize ( extract absolute_path ) with
match deserialize ( extract absolute_path ) with
| Some data ->
| Some _ as data ->
Some data
data
| None ->
| None ->
None
None
| exception Caml . Not_found ->
| exception Caml . Not_found ->
@ -69,26 +69,27 @@ let zip_libraries =
{ models ; zip_filename ; zip_channel = lazy ( Zip . open_in zip_filename ) }
{ models ; zip_filename ; zip_channel = lazy ( Zip . open_in zip_filename ) }
in
in
let zip_libs =
let zip_libs =
if Config . use_jar_cache && Config. infer_cach e < > Non e then []
if Config . use_jar_cache && Option. is_some Config. infer_cach e then []
else
else
(* Order matters, jar files should appear in the order in which they should be searched for
let load_zip fname =
specs files . Config . specs_library is in reverse order of appearance on command line . * )
let add_zip zip_libs fname =
if Filename . check_suffix fname " .jar " then
if Filename . check_suffix fname " .jar " then
(* fname is a zip of specs *)
(* fname is a zip of specs *)
mk_zip_lib false fname :: zip_libs
Some ( mk_zip_lib false fname )
else (* fname is a dir of specs *)
else (* fname is a dir of specs *)
zip_libs
None
in
in
List . fold ~ f : add_zip ~ init : [] Config . specs_library
(* Order matters: jar files should appear in the order in which they should be searched for
specs files . [ Config . specs_library ] is in reverse order of appearance on the command
line . * )
List . rev_filter_map Config . specs_library ~ f : load_zip
in
in
if Config . biabduction && not Config . models_mode && Sys . file_exists Config . models_jar = ` Yes
if Config . biabduction && not Config . models_mode && Sys . file_exists Config . models_jar = ` Yes
then mk_zip_lib true Config . models_jar :: zip_libs
then mk_zip_lib true Config . models_jar :: zip_libs
else zip_libs )
else zip_libs )
(* Search path in the list of zip libraries and use a cache directory to save already
(* * Search path in the list of zip libraries and use a cache directory to save already deserialized
deserialized data * )
data * )
let load serializer path =
let load serializer path =
let rec loop = function
let rec loop = function
| [] ->
| [] ->