AStat/analyzer.ml

33 lines
869 B
OCaml

(*
Cours "Sémantique et Application à la Vérification de programmes"
Antoine Miné 2015
Marc Chevalier 2018
Josselin Giet 2021
Ecole normale supérieure, Paris, France / CNRS / INRIA
*)
open Iterator
(* parse filename *)
let doit filename = begin
let prog = File_parser.parse_file filename in
let cfg = Tree_to_cfg.prog prog in
if !Options.verbose then
Format.printf "%a" Cfg_printer.print_cfg cfg;
Cfg_printer.output_dot !Options.cfg_out cfg;
let f = match !Options.domain with
| "signs" -> SignIterator.iterate cfg
| "interval" -> IntervalIterator.iterate cfg
| "constants" -> ConstIterator.iterate cfg
| _ -> ConstIterator.iterate cfg in
Format.printf "@[<v 0>Failed asserts :@ %a@]" pp_asserts f end
(* parses arguments to get filename *)
let main () =
let _ = Options.init () in
doit !Options.file
let _ = main ();