method execution (fileName : string) (outText : Widget.text Widget.widget) : unit = (
let out_name_if = get_output_if fileName in
let out_name_satmc = (temp_dir^(Filename.basename fileName)^".satmc") in
let error_if_file = (out_name_if^".error") in
let error_satmc_file = (out_name_satmc^".error") in
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_satmc) then ignore(Sys.remove out_name_satmc);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_satmc_file) then ignore(Sys.remove error_satmc_file);
let select = match (Listbox.curselection lst)
with [(`Num num)] -> num
| _ -> -1 in
let algo = match select
with 0 -> " --solver=chaff "
| 1 -> " --solver=sim "
| 2 -> " --solver=sato "
| _ -> "" in
let depthString = if (Entry.get depthEntry)="" then "" else (" --max="^(Entry.get depthEntry)) in
ignore(Sys.command(hlpsl2if^" --stdout "^esc^fileName^esc^" >"^esc^out_name_if^esc^" 2>"^esc^error_if_file^esc));
ignore(Sys.command(satmc^" "^esc^out_name_if^esc^" "^compoundString^" --output="^(Filename.dirname fileName)^abstractionString^optimizedString^depthString^algo^" > "^esc^out_name_satmc^esc^" 2>"^esc^error_satmc_file^esc));
Text.delete outText ~start:(`Linechar(0, 0),[`Linestart]) ~stop:(`End,[]);
if(Sys.file_exists out_name_satmc) then (
let txt = readFile out_name_satmc in
if(Sys.file_exists error_if_file)
then (let (_,line_number)= (readFile_and_give_line_number error_if_file) in
if(line_number > 2)
then (Text.insert ~index:(`End,[]) ~text:(("\n----- Output error of if translator :\n\n")^(readFile error_if_file)) outText;
if(Sys.file_exists error_satmc_file)
then Text.insert ~index:(`End,[]) ~text:(("\n\n\n----- Output error of SATMC :\n\n")^(readFile error_satmc_file)) outText;
if(Sys.file_exists out_name_satmc)
then Text.insert ~index:(`End,[]) ~text:(("\n\n")^txt) outText;
)
else (if(Sys.file_exists out_name_satmc)
then Text.insert ~index:(`End,[]) ~text:txt outText;)
)
else (if(Sys.file_exists out_name_satmc)
then Text.insert ~index:(`End,[]) ~text:txt outText;)
);
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_satmc) then ignore(Sys.remove out_name_satmc);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_satmc_file) then ignore(Sys.remove error_satmc_file);
)