let main () =
Message.set_verbosity Message.Default;
Stats.reset ();
Options.buildOptionsDatabase ();
if (Options.getValueOfBool "interactive" = true) then
interactive ()
else begin
let reachLabel = (Options.getValueOfString "L")
and source_files = (Options.getSourceFiles ()) in
if(reachLabel = "") then
begin
Printf.printf "No error label specified!\n" ;
exit 1
end
else
() ;
if (source_files == [])
then
begin
Message.msg_string Message.Error ("Error: no input source file specified") ;
exit 1
end ;
Message.msg_string Message.Normal ("Parsing files: " ^ (Misc.strList source_files)) ;
Stats.time "Parse:" C_System_Descr.initialize source_files ;
AliasAnalyzer.constructAliasDatabase () ;
if (Options.getValueOfBool "test") then
begin
testModelCheck 0 ;
exit 1
end
else () ;
let error_location =
match (C_System_Descr.get_locations_at_label reachLabel) with
[l] -> Some l
| [] when Options.getValueOfBool "checkRace" -> None
| [] ->
Message.msg_string Message.Error ("Error: label '" ^ reachLabel ^
"' was not found in the source file(s)") ;
exit 1
| _ ->
Message.msg_string Message.Error ("Error: label '" ^ reachLabel ^
"' appears multiple times in the source file(s)") ;
exit 1
in
Message.msg_string Message.Debug "\n\n\n\n\nPrinting System Description\n\n" ;
Message.msg_printer Message.Debug C_System_Descr.print_system () ;
Stats.time "modelCheck" modelCheck error_location ;
end;
let memstats = Gc.stat () in
Message.msg_string Message.Normal ("Minor Words : "^(string_of_float memstats.Gc.minor_words)) ;
Message.msg_string Message.Normal ("Major Words : "^(string_of_float memstats.Gc.major_words)) ;
Message.msg_string Message.Normal ("Total size of heap in words : "^(string_of_int memstats.Gc.heap_words)) ;
Stats.print stderr "Timings:\n"