diff --git a/CHANGES.md b/CHANGES.md index 947ac9e4..489fdc95 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ # 0.3.0 +- Read also `.gospel` files + [\#196](https://github.com/ocaml-gospel/ortac/pull/196) - Read an optional `cleanup` function from configuration module [\#226](https://github.com/ocaml-gospel/ortac/pull/226) - Fix field access translation diff --git a/bin/registration.ml b/bin/registration.ml index e52a7ee1..e790ffea 100644 --- a/bin/registration.ml +++ b/bin/registration.ml @@ -1,5 +1,8 @@ type plugins = unit Cmdliner.Cmd.t Queue.t +type input_file = MLI of string | GOSPEL of string +let unwrap = function MLI s | GOSPEL s -> s +let pp_input_file ppf x = Fmt.(pf ppf "%s" (unwrap x)) let plugins = Queue.create () let register cmd = Queue.add cmd plugins let fold = Queue.fold @@ -35,16 +38,19 @@ let output_file = let quiet = Arg.(value & flag & info [ "q"; "quiet" ] ~doc:"Don't print any warnings.") -let ocaml_file = +let input_file = let parse s = - match Sys.file_exists s with - | true -> - if Sys.is_directory s || Filename.extension s <> ".mli" then - `Error (Fmt.str "Error: `%s' is not an OCaml interface file" s) - else `Ok s - | false -> `Error (Fmt.str "Error: `%s' not found" s) + if not (Sys.file_exists s) then `Error (Fmt.str "Error: `%s' not found" s) + else + match Filename.extension s with + | ".mli" -> `Ok (MLI s) + | ".gospel" -> `Ok (GOSPEL s) + | _ -> `Error "Error, expecting .mli or .gospel file." in Arg.( required - & pos 0 (some (parse, Fmt.string)) None - & info [] ~docv:"FILE" ~doc:"Read Gospel specifications in FILE.") + & pos 0 (some (parse, pp_input_file)) None + & info [] ~docv:"FILE" + ~doc: + "Read Gospel specifications in FILE. FILE can be an OCaml interface \ + or a .gospel file") diff --git a/bin/registration.mli b/bin/registration.mli index fbc7e8ee..98a0ad94 100644 --- a/bin/registration.mli +++ b/bin/registration.mli @@ -1,5 +1,7 @@ type plugins +type input_file = MLI of string | GOSPEL of string +val unwrap : input_file -> string val plugins : plugins val register : unit Cmdliner.Cmd.t -> unit val fold : ('a -> unit Cmdliner.Cmd.t -> 'a) -> 'a -> plugins -> 'a @@ -7,5 +9,5 @@ val get_out_formatter : string option -> Format.formatter val setup_log : unit Cmdliner.Term.t val include_ : string option Cmdliner.Term.t val output_file : string option Cmdliner.Term.t -val ocaml_file : string Cmdliner.Term.t +val input_file : input_file Cmdliner.Term.t val quiet : bool Cmdliner.Term.t diff --git a/plugins/monolith/src/ortac_monolith.ml b/plugins/monolith/src/ortac_monolith.ml index f6289d31..59a021e9 100644 --- a/plugins/monolith/src/ortac_monolith.ml +++ b/plugins/monolith/src/ortac_monolith.ml @@ -132,12 +132,9 @@ let standalone module_name env s = :: specs let generate path fmt = - let module_name = Ortac_core.Utils.module_name_of_path path in - Gospel.Parser_frontend.parse_ocaml_gospel path - |> Ortac_core.Utils.type_check [] path - |> fun (env, sigs) -> - assert (List.length env = 1); - standalone module_name (List.hd env) sigs + let open Ortac_core.Utils in + let { module_name; namespace; ast } = check path in + standalone module_name namespace ast |> Fmt.pf fmt "%a@." Ppxlib_ast.Pprintast.structure; W.report () @@ -159,7 +156,7 @@ end = struct Cmd.info "monolith" ~doc:"Generate Monolith test file according to Gospel specifications." - let term = Term.(const main $ ocaml_file $ output_file $ setup_log) + let term = Term.(const main $ input_file $ output_file $ setup_log) let cmd = Cmd.v info term end diff --git a/plugins/monolith/src/ortac_monolith.mli b/plugins/monolith/src/ortac_monolith.mli index 87a254ac..9ae1caac 100644 --- a/plugins/monolith/src/ortac_monolith.mli +++ b/plugins/monolith/src/ortac_monolith.mli @@ -1,4 +1,4 @@ -val generate : string -> Format.formatter -> unit +val generate : Registration.input_file -> Format.formatter -> unit (** [generate path output] generate the code of the tests corresponding to the specifications present in [path] in the monolith configuration and print it on the [output] channel *) diff --git a/plugins/qcheck-stm/src/config.ml b/plugins/qcheck-stm/src/config.ml index 46c001d9..e5b338e2 100644 --- a/plugins/qcheck-stm/src/config.ml +++ b/plugins/qcheck-stm/src/config.ml @@ -220,11 +220,8 @@ let scan_config cfg_uc config_mod = let init gospel config_module = let open Reserr in try - let module_name = Utils.module_name_of_path gospel in - Parser_frontend.parse_ocaml_gospel gospel |> Utils.type_check [] gospel - |> fun (env, sigs) -> - assert (List.length env = 1); - let namespace = List.hd env in + let open Utils in + let { module_name; namespace; ast } = Utils.check gospel in let context = Context.init module_name namespace in let add ctx s = (* we add to the context the pure OCaml values and the functions and @@ -237,10 +234,10 @@ let init gospel config_module = Context.add_function fun_ls fun_ls.ls_name.id_str ctx | _ -> ctx in - let context = List.fold_left add context sigs in + let context = List.fold_left add context ast in let* config = scan_config config_under_construction config_module >>= mk_config context in - ok (sigs, config) + ok (ast, config) with Gospel.Warnings.Error (l, k) -> error (Ortac_core.Warnings.GospelError k, l) diff --git a/plugins/qcheck-stm/src/ortac_qcheck_stm.ml b/plugins/qcheck-stm/src/ortac_qcheck_stm.ml index 991dc530..a3e2a45f 100644 --- a/plugins/qcheck-stm/src/ortac_qcheck_stm.ml +++ b/plugins/qcheck-stm/src/ortac_qcheck_stm.ml @@ -34,7 +34,7 @@ end = struct let term = let open Registration in - Term.(const main $ ocaml_file $ config $ output_file $ quiet $ setup_log) + Term.(const main $ input_file $ config $ output_file $ quiet $ setup_log) let cmd = Cmd.v info term end diff --git a/plugins/qcheck-stm/test/dune.inc b/plugins/qcheck-stm/test/dune.inc index e654496b..861035ab 100644 --- a/plugins/qcheck-stm/test/dune.inc +++ b/plugins/qcheck-stm/test/dune.inc @@ -2,6 +2,14 @@ (name array) (modules array)) +(rule + (target array.gospel) + (action + (run + gospel + check + %{dep:array.mli}))) + (rule (target array_stm_tests.ml) (package ortac-qcheck-stm) @@ -17,7 +25,7 @@ (run ortac qcheck-stm - %{dep:array.mli} + %{dep:array.gospel} %{dep:array_config.ml} -o %{target}))))) @@ -55,6 +63,14 @@ (name hashtbl) (modules hashtbl)) +(rule + (target hashtbl.gospel) + (action + (run + gospel + check + %{dep:hashtbl.mli}))) + (rule (target hashtbl_stm_tests.ml) (package ortac-qcheck-stm) @@ -70,7 +86,7 @@ (run ortac qcheck-stm - %{dep:hashtbl.mli} + %{dep:hashtbl.gospel} %{dep:hashtbl_config.ml} -o %{target}))))) @@ -108,6 +124,14 @@ (name record) (modules record)) +(rule + (target record.gospel) + (action + (run + gospel + check + %{dep:record.mli}))) + (rule (target record_stm_tests.ml) (package ortac-qcheck-stm) @@ -123,7 +147,7 @@ (run ortac qcheck-stm - %{dep:record.mli} + %{dep:record.gospel} %{dep:record_config.ml} -o %{target}))))) @@ -161,6 +185,14 @@ (name ref) (modules ref)) +(rule + (target ref.gospel) + (action + (run + gospel + check + %{dep:ref.mli}))) + (rule (target ref_stm_tests.ml) (package ortac-qcheck-stm) @@ -176,7 +208,7 @@ (run ortac qcheck-stm - %{dep:ref.mli} + %{dep:ref.gospel} %{dep:ref_config.ml} -o %{target}))))) @@ -214,6 +246,14 @@ (name conjunctive_clauses) (modules conjunctive_clauses)) +(rule + (target conjunctive_clauses.gospel) + (action + (run + gospel + check + %{dep:conjunctive_clauses.mli}))) + (rule (target conjunctive_clauses_stm_tests.ml) (package ortac-qcheck-stm) @@ -229,7 +269,7 @@ (run ortac qcheck-stm - %{dep:conjunctive_clauses.mli} + %{dep:conjunctive_clauses.gospel} %{dep:conjunctive_clauses_config.ml} -o %{target}))))) @@ -267,6 +307,14 @@ (name sequence_model) (modules sequence_model)) +(rule + (target sequence_model.gospel) + (action + (run + gospel + check + %{dep:sequence_model.mli}))) + (rule (target sequence_model_stm_tests.ml) (package ortac-qcheck-stm) @@ -282,7 +330,7 @@ (run ortac qcheck-stm - %{dep:sequence_model.mli} + %{dep:sequence_model.gospel} %{dep:sequence_model_config.ml} -o %{target}))))) @@ -320,6 +368,14 @@ (name invariants) (modules invariants)) +(rule + (target invariants.gospel) + (action + (run + gospel + check + %{dep:invariants.mli}))) + (rule (target invariants_stm_tests.ml) (package ortac-qcheck-stm) @@ -335,7 +391,7 @@ (run ortac qcheck-stm - %{dep:invariants.mli} + %{dep:invariants.gospel} %{dep:invariants_config.ml} -o %{target}))))) @@ -373,6 +429,14 @@ (name integer_in_model) (modules integer_in_model)) +(rule + (target integer_in_model.gospel) + (action + (run + gospel + check + %{dep:integer_in_model.mli}))) + (rule (target integer_in_model_stm_tests.ml) (package ortac-qcheck-stm) @@ -388,7 +452,7 @@ (run ortac qcheck-stm - %{dep:integer_in_model.mli} + %{dep:integer_in_model.gospel} %{dep:integer_in_model_config.ml} -o %{target}))))) @@ -426,6 +490,14 @@ (name ghost_as_model) (modules ghost_as_model)) +(rule + (target ghost_as_model.gospel) + (action + (run + gospel + check + %{dep:ghost_as_model.mli}))) + (rule (target ghost_as_model_stm_tests.ml) (package ortac-qcheck-stm) @@ -441,7 +513,7 @@ (run ortac qcheck-stm - %{dep:ghost_as_model.mli} + %{dep:ghost_as_model.gospel} %{dep:ghost_as_model_config.ml} -o %{target}))))) @@ -479,6 +551,14 @@ (name custom_config) (modules custom_config)) +(rule + (target custom_config.gospel) + (action + (run + gospel + check + %{dep:custom_config.mli}))) + (rule (target custom_config_stm_tests.ml) (package ortac-qcheck-stm) @@ -494,7 +574,7 @@ (run ortac qcheck-stm - %{dep:custom_config.mli} + %{dep:custom_config.gospel} %{dep:custom_config_config.ml} -o %{target}))))) @@ -532,6 +612,14 @@ (name test_without_sut) (modules test_without_sut)) +(rule + (target test_without_sut.gospel) + (action + (run + gospel + check + %{dep:test_without_sut.mli}))) + (rule (target test_without_sut_stm_tests.ml) (package ortac-qcheck-stm) @@ -547,7 +635,7 @@ (run ortac qcheck-stm - %{dep:test_without_sut.mli} + %{dep:test_without_sut.gospel} %{dep:test_without_sut_config.ml} -o %{target}))))) @@ -585,6 +673,14 @@ (name tuples) (modules tuples)) +(rule + (target tuples.gospel) + (action + (run + gospel + check + %{dep:tuples.mli}))) + (rule (target tuples_stm_tests.ml) (package ortac-qcheck-stm) @@ -600,7 +696,7 @@ (run ortac qcheck-stm - %{dep:tuples.mli} + %{dep:tuples.gospel} %{dep:tuples_config.ml} -o %{target}))))) @@ -638,6 +734,14 @@ (name functional_model) (modules functional_model)) +(rule + (target functional_model.gospel) + (action + (run + gospel + check + %{dep:functional_model.mli}))) + (rule (target functional_model_stm_tests.ml) (package ortac-qcheck-stm) @@ -653,7 +757,7 @@ (run ortac qcheck-stm - %{dep:functional_model.mli} + %{dep:functional_model.gospel} %{dep:functional_model_config.ml} -o %{target}))))) @@ -691,6 +795,14 @@ (name test_cleanup) (modules test_cleanup)) +(rule + (target test_cleanup.gospel) + (action + (run + gospel + check + %{dep:test_cleanup.mli}))) + (rule (target test_cleanup_stm_tests.ml) (package ortac-qcheck-stm) @@ -706,7 +818,7 @@ (run ortac qcheck-stm - %{dep:test_cleanup.mli} + %{dep:test_cleanup.gospel} %{dep:test_cleanup_config.ml} -o %{target}))))) diff --git a/plugins/qcheck-stm/test/dune_gen.ml b/plugins/qcheck-stm/test/dune_gen.ml index ee613352..b64b0668 100644 --- a/plugins/qcheck-stm/test/dune_gen.ml +++ b/plugins/qcheck-stm/test/dune_gen.ml @@ -16,6 +16,14 @@ let rec print_rules pos = (name %s) (modules %s)) +(rule + (target %s.gospel) + (action + (run + gospel + check + %%{dep:%s.mli}))) + (rule (target %s_stm_tests.ml) (package ortac-qcheck-stm) @@ -31,7 +39,7 @@ let rec print_rules pos = (run ortac qcheck-stm - %%{dep:%s.mli} + %%{dep:%s.gospel} %%{dep:%s.ml} -o %%{target}))))) @@ -66,7 +74,7 @@ let rec print_rules pos = (run %%{dep:%s_stm_tests.exe} -v))) |} - m m m m m config m m m m m m m m m; + m m m m m m m config m m m m m m m m m; print_rules (pos + 2)) let () = diff --git a/plugins/qcheck-stm/test/hashtbl_stm_tests.expected.ml b/plugins/qcheck-stm/test/hashtbl_stm_tests.expected.ml index fc36e6e9..3981ed70 100644 --- a/plugins/qcheck-stm/test/hashtbl_stm_tests.expected.ml +++ b/plugins/qcheck-stm/test/hashtbl_stm_tests.expected.ml @@ -6,8 +6,8 @@ module Ortac_runtime = Ortac_runtime_qcheck_stm let rec remove_first x xs_1 = try match xs_1 with - | (a_1, b_1)::xs -> - if a_1 = x then xs else (a_1, b_1) :: (remove_first x xs) + | (tuple2_1 (a_1, b_1))::xs -> + if a_1 = x then xs else (tuple2 (a_1, b_1)) :: (remove_first x xs) | [] -> [] with | e -> @@ -71,7 +71,7 @@ module Spec = (Util.Pp.pp_int true) b_3 | Length -> Format.asprintf "%s sut" "length" type nonrec state = { - contents: (char * int) list } + contents: (char, int) tuple2 list } let init_state = let random = false and size = 16 in @@ -176,7 +176,7 @@ module Spec = | Add (a_2, b_2) -> { contents = - ((try (a_2, b_2) :: state__003_.contents + ((try (tuple2 (a_2, b_2)) :: state__003_.contents with | e -> raise @@ -232,7 +232,9 @@ module Spec = | Replace (a_8, b_3) -> { contents = - ((try (a_8, b_3) :: (remove_first a_8 state__003_.contents) + ((try + (tuple2 (a_8, b_3)) :: + (remove_first a_8 state__003_.contents) with | e -> raise @@ -298,7 +300,7 @@ let ortac_postcond cmd__004_ state__005_ res__006_ = | Ok b_4 -> if (try - Ortac_runtime.Gospelstdlib.List.mem (a_3, b_4) + Ortac_runtime.Gospelstdlib.List.mem (tuple2 (a_3, b_4)) (Lazy.force new_state__007_).contents with | e -> @@ -343,7 +345,7 @@ let ortac_postcond cmd__004_ state__005_ res__006_ = pos_cnum = 1398 } })]) - | Error (Not_found) -> + | Error (Not_found (tuple0)) -> if (try not @@ -410,7 +412,7 @@ let ortac_postcond cmd__004_ state__005_ res__006_ = else false | Some b_5 -> if - Ortac_runtime.Gospelstdlib.List.mem (a_4, b_5) + Ortac_runtime.Gospelstdlib.List.mem (tuple2 (a_4, b_5)) (Lazy.force new_state__007_).contents then true else false) @@ -463,7 +465,8 @@ let ortac_postcond cmd__004_ state__005_ res__006_ = (try (Ortac_runtime.Gospelstdlib.List.to_seq bs) = (Ortac_runtime.Gospelstdlib.Sequence.filter_map - (fun (x_1, y) -> if x_1 = a_5 then Some y else None) + (fun (tuple2_1 (x_1, y)) -> + if x_1 = a_5 then Some y else None) (Ortac_runtime.Gospelstdlib.List.to_seq (Lazy.force new_state__007_).contents)) with diff --git a/plugins/qcheck-stm/test/tuples_stm_tests.expected.ml b/plugins/qcheck-stm/test/tuples_stm_tests.expected.ml index fbd8dde8..ca6bfb83 100644 --- a/plugins/qcheck-stm/test/tuples_stm_tests.expected.ml +++ b/plugins/qcheck-stm/test/tuples_stm_tests.expected.ml @@ -51,7 +51,7 @@ module Spec = | Size_tup -> Format.asprintf "%s sut" "size_tup" | Size_tup' -> Format.asprintf "%s sut" "size_tup'" type nonrec state = { - contents: (char * int) list } + contents: (char, int) tuple2 list } let init_state = let () = () in { @@ -126,7 +126,8 @@ module Spec = contents = ((try match tup with - | (a_1, b_1) -> (a_1, b_1) :: state__003_.contents + | tuple2_1 (a_1, b_1) -> + (tuple2 (a_1, b_1)) :: state__003_.contents with | e -> raise @@ -154,9 +155,9 @@ module Spec = contents = ((try match tup_1 with - | (c, a_2, b_2) -> + | tuple3 (c, a_2, b_2) -> if c = true - then (a_2, b_2) :: state__003_.contents + then (tuple2 (a_2, b_2)) :: state__003_.contents else state__003_.contents with | e -> @@ -185,9 +186,9 @@ module Spec = contents = ((try match tup_2 with - | (c_1, (a_3, b_3)) -> + | tuple2_1 (c_1, tuple2_1 (a_3, b_3)) -> if c_1 = true - then (a_3, b_3) :: state__003_.contents + then (tuple2 (a_3, b_3)) :: state__003_.contents else state__003_.contents with | e -> diff --git a/plugins/wrapper/src/generate.ml b/plugins/wrapper/src/generate.ml index e69af497..43c4a12f 100644 --- a/plugins/wrapper/src/generate.ml +++ b/plugins/wrapper/src/generate.ml @@ -236,10 +236,7 @@ let signature ~runtime ~module_name namespace s = structure runtime (Context.module_name context) ir let generate path fmt = - let module_name = Ortac_core.Utils.module_name_of_path path in - Gospel.Parser_frontend.parse_ocaml_gospel path - |> Ortac_core.Utils.type_check [] path - |> fun (env, sigs) -> - assert (List.length env = 1); - signature ~runtime:"Ortac_runtime" ~module_name (List.hd env) sigs + let open Ortac_core.Utils in + let { module_name; namespace; ast } = check path in + signature ~runtime:"Ortac_runtime" ~module_name namespace ast |> Fmt.pf fmt "%a@." Ppxlib_ast.Pprintast.structure diff --git a/plugins/wrapper/src/generate.mli b/plugins/wrapper/src/generate.mli index fdbe8141..685bbc2f 100644 --- a/plugins/wrapper/src/generate.mli +++ b/plugins/wrapper/src/generate.mli @@ -5,7 +5,7 @@ val signature : Gospel.Tast.signature_item list -> Ppxlib.structure -val generate : string -> Format.formatter -> unit +val generate : Registration.input_file -> Format.formatter -> unit (** [generate path out] generate the code of the tests corresponding to the specifications present in [path] in the default configuration and print it on the [out] channel *) diff --git a/plugins/wrapper/src/ortac_wrapper.ml b/plugins/wrapper/src/ortac_wrapper.ml index 78bafa04..d13dfcbc 100644 --- a/plugins/wrapper/src/ortac_wrapper.ml +++ b/plugins/wrapper/src/ortac_wrapper.ml @@ -19,7 +19,7 @@ end = struct ~doc: "Wrap module functions with assertions to check their specifications." - let term = Term.(const main $ ocaml_file $ output_file $ setup_log) + let term = Term.(const main $ input_file $ output_file $ setup_log) let cmd = Cmd.v info term end diff --git a/plugins/wrapper/test/suite/translation.ml b/plugins/wrapper/test/suite/translation.ml index e5632240..b91b0c26 100644 --- a/plugins/wrapper/test/suite/translation.ml +++ b/plugins/wrapper/test/suite/translation.ml @@ -2,12 +2,10 @@ module Ir = Ortac_wrapper__Ir module Utils = Ortac_core__Utils let translate path = - let module_name = Utils.module_name_of_path path in - Gospel.Parser_frontend.parse_ocaml_gospel path |> Utils.type_check [] path - |> fun (env, sigs) -> - assert (List.length env = 1); - let context = Ortac_core.Context.init module_name (List.hd env) in - Ortac_wrapper__Ir_of_gospel.signature ~context sigs + let open Utils in + let { module_name; namespace; ast } = check (Registration.MLI path) in + let context = Ortac_core.Context.init module_name namespace in + Ortac_wrapper__Ir_of_gospel.signature ~context ast let mutability = let open Ir in diff --git a/src/core/dune b/src/core/dune index 5f709714..ff9d1d42 100644 --- a/src/core/dune +++ b/src/core/dune @@ -3,7 +3,7 @@ (public_name ortac-core) (preprocess (pps ppxlib.metaquot)) - (libraries fmt gospel ppxlib.ast)) + (libraries fmt registration gospel ppxlib.ast)) (rule (enabled_if diff --git a/src/core/utils.ml b/src/core/utils.ml index d3d99cdf..08ee29ea 100644 --- a/src/core/utils.ml +++ b/src/core/utils.ml @@ -12,11 +12,36 @@ let module_name_of_path p = let filename = Filename.basename p in String.index filename '.' |> String.sub filename 0 |> String.capitalize_ascii -let type_check load_path name sigs = - let md = Tmodule.init_muc name in - let penv = +open Gospel + +type checked = { + module_name : string; + namespace : Tmodule.namespace; + ast : Tast.signature; +} + +let type_check load_path name = + let sigs = Parser_frontend.parse_ocaml_gospel name + and md = Tmodule.init_muc name + and penv = module_name_of_path name |> Utils.Sstr.singleton |> Typing.penv load_path in let gfile = List.fold_left (Typing.type_sig_item penv) md sigs in let sigs = Tmodule.wrap_up_muc gfile |> fun file -> file.fl_sigs in (gfile.muc_import, sigs) + +let read_gospel_file filename = + let open Tmodule in + let gfile : module_uc = read_gospel_file filename in + let sigs = Tmodule.wrap_up_muc gfile |> fun file -> file.fl_sigs in + (gfile.muc_import, sigs) + +let check filename = + let open Registration in + let module_name = module_name_of_path (unwrap filename) + and env, ast = + match filename with + | MLI filename -> type_check [] filename + | GOSPEL filename -> read_gospel_file filename + in + { module_name; namespace = List.hd env; ast } diff --git a/src/core/utils.mli b/src/core/utils.mli index bd62989c..7e7ebbae 100644 --- a/src/core/utils.mli +++ b/src/core/utils.mli @@ -4,14 +4,13 @@ val term_printer : string -> Ppxlib.Location.t -> Gospel.Tterm.term -> string specification's location. Fall back on the Gospel term pretty printer if something goes wrong when extracting the substring. *) -val module_name_of_path : string -> string -(** [module_name_of_path p] turn the path to an OCaml file [p] into the - corresponding OCaml module identifier *) +type checked = { + module_name : string; + namespace : Gospel.Tmodule.namespace; + ast : Gospel.Tast.signature; +} -val type_check : - string list -> - string -> - Gospel.Uast.s_signature_item list -> - Gospel.Tmodule.namespace list * Gospel.Tast.signature -(** [type_check load_path name sigs] call the Gospel typechecker on the file - [name] *) +val check : Registration.input_file -> checked +(** [check filename] calls the Gospel type checker on [filename] with an empty + load path if it is an interface and read its content if it is a [.gospel] + file *)