minigen: ensure that it is possible to run with only MSeq implemented

Reported-by: Neven Villani <neven.villani@crans.org>
This commit is contained in:
Gabriel Scherer 2024-01-07 22:30:05 +01:00
parent 1b02ba850c
commit 3cf46e36c2

View File

@ -37,16 +37,15 @@ let () =
| None -> Random.self_init () | None -> Random.self_init ()
| Some s -> Random.init s | Some s -> Random.init s
module RandGen = Generator.Make(MRand) let generate (module M : Utils.MonadPlus) =
module SeqGen = Generator.Make(MSeq) let module Gen = Generator.Make(M) in
M.run @@ Gen.typed ~depth:config.depth
let () = let () =
begin generate
if config.exhaustive then (if config.exhaustive
MSeq.run @@ SeqGen.typed ~depth:config.depth then (module MSeq)
else else (module MRand))
MRand.run @@ RandGen.typed ~depth:config.depth
end
|> Seq.take config.count |> Seq.take config.count
|> Seq.map STLCPrinter.print_term |> Seq.map STLCPrinter.print_term
|> List.of_seq |> List.of_seq