408 val metis_fns = (inc_metis_calls, inc_metis_success, inc_metis_time, |
408 val metis_fns = (inc_metis_calls, inc_metis_success, inc_metis_time, |
409 inc_metis_timeout, inc_metis_lemmas, inc_metis_posns) |
409 inc_metis_timeout, inc_metis_lemmas, inc_metis_posns) |
410 val metis0_fns = (inc_metis_calls0, inc_metis_success0, inc_metis_time0, |
410 val metis0_fns = (inc_metis_calls0, inc_metis_success0, inc_metis_time0, |
411 inc_metis_timeout0, inc_metis_lemmas0, inc_metis_posns0) |
411 inc_metis_timeout0, inc_metis_lemmas0, inc_metis_posns0) |
412 val named_thms = ref (NONE : (string * thm list) list option) |
412 val named_thms = ref (NONE : (string * thm list) list option) |
413 |
413 val minimize = AList.defined (op =) args minimizeK |
414 fun if_enabled k f = |
414 in |
415 if AList.defined (op =) args k andalso is_some (!named_thms) |
415 Mirabelle.catch sh_tag (run_sledgehammer args named_thms) id st; |
416 then f id st else () |
416 if is_some (!named_thms) |
417 |
417 then |
418 val _ = Mirabelle.catch sh_tag (run_sledgehammer args named_thms) id st |
418 (if minimize |
419 val _ = if_enabled minimizeK |
419 then Mirabelle.catch metis_tag (run_metis metis0_fns args (these (!named_thms))) id st |
420 (Mirabelle.catch metis_tag (run_metis metis0_fns args (these (!named_thms)))) |
420 else (); |
421 val _ = if_enabled minimizeK |
421 if minimize andalso not(null(these(!named_thms))) |
422 (Mirabelle.catch minimize_tag (run_minimize args named_thms)) |
422 then Mirabelle.catch minimize_tag (run_minimize args named_thms) id st |
423 val _ = if is_some (!named_thms) |
423 else (); |
424 then Mirabelle.catch metis_tag (run_metis metis_fns args (these (!named_thms))) id st |
424 Mirabelle.catch metis_tag (run_metis metis_fns args (these (!named_thms))) id st) |
425 else () |
425 else () |
426 in () end |
426 end |
427 |
427 |
428 fun invoke args = |
428 fun invoke args = |
429 let |
429 let |
430 val _ = AtpManager.set_full_types (AList.defined (op =) args full_typesK) |
430 val _ = AtpManager.set_full_types (AList.defined (op =) args full_typesK) |
431 in Mirabelle.register (init, sledgehammer_action args, done) end |
431 in Mirabelle.register (init, sledgehammer_action args, done) end |