Skip to content
Snippets Groups Projects
Commit 0c5212a8 authored by Kilyan Le Gallic's avatar Kilyan Le Gallic
Browse files

[wp] PoC for opening module from command lines arguments

parent f3c64e98
No related branches found
No related tags found
No related merge requests found
...@@ -21,22 +21,50 @@ ...@@ -21,22 +21,50 @@
(**************************************************************************) (**************************************************************************)
module L = Wp_parameters module L = Wp_parameters
module P = Why3.Pmodule
module F = Filepath.Normalized
module W = Why3
module WConf = Why3.Whyconf
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
let create_why3_env =
begin fun () ->
W.Env.create_env (WConf.loadpath (WConf.get_main (WConf.read_config None)))
end
let () = let () =
Boot.Main.extend Boot.Main.extend
begin fun () -> begin fun () ->
let libs = L.Library.get () in let libs = L.Library.get () in
List.iter List.iter
(fun dir -> (fun dir ->
L.debug ~level:0 " + LIB %a@." Filepath.Normalized.pretty dir L.debug ~level:0 " + LIBS %s@." dir
) libs ; ) (F.to_string_list libs) ;
let thys = L.Import.get () in let thys = L.Import.get () in
List.iter List.iter
(fun thy -> (fun thy ->
L.debug ~level:0 " + THY %s@." thy L.debug ~level:0 " + THY %s@." thy
) thys ; ) thys ;
let libs = L.Library.get () in
let thys = L.Import.get () in
let env = create_why3_env () in
List.iter
(fun thy ->
let ns = (P.read_module env (F.to_string_list libs) thy).mod_export in
let _t = List.map (fun (ity : W.Ity.itysymbol) -> ity.its_ts) (W.Wstdlib.Mstr.values (ns.ns_ts)) in
List.iter (
fun _ty ->
match W.Ty.ts_hash _ty with
| 1 -> L.debug "NoDef %s@." thy
| _ -> L.debug "Otr %s@." thy
) _t;
) thys ;
(* let _ns = (P.read_module env (F.to_string_list libs) (List.hd thys)).mod_export in
L.debug ""; *)
end end
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment