src/HOL/Tools/Nitpick/nitpick_isar.ML
changeset 41803 ef13e3b7cbaf
parent 41801 ed77524f3429
child 41856 7244589c8ccc
equal deleted inserted replaced
41802:7592a165fa0b 41803:ef13e3b7cbaf
    56    ("merge_type_vars", "false"),
    56    ("merge_type_vars", "false"),
    57    ("binary_ints", "smart"),
    57    ("binary_ints", "smart"),
    58    ("destroy_constrs", "true"),
    58    ("destroy_constrs", "true"),
    59    ("specialize", "true"),
    59    ("specialize", "true"),
    60    ("star_linear_preds", "true"),
    60    ("star_linear_preds", "true"),
       
    61    ("preconstr", "smart"),
    61    ("peephole_optim", "true"),
    62    ("peephole_optim", "true"),
    62    ("fix_datatype_vals", "true"),
       
    63    ("datatype_sym_break", "5"),
    63    ("datatype_sym_break", "5"),
    64    ("kodkod_sym_break", "15"),
    64    ("kodkod_sym_break", "15"),
    65    ("timeout", "30"),
    65    ("timeout", "30"),
    66    ("tac_timeout", "0.5"),
    66    ("tac_timeout", "0.5"),
    67    ("max_threads", "0"),
    67    ("max_threads", "0"),
    89    ("dont_merge_type_vars", "merge_type_vars"),
    89    ("dont_merge_type_vars", "merge_type_vars"),
    90    ("unary_ints", "binary_ints"),
    90    ("unary_ints", "binary_ints"),
    91    ("dont_destroy_constrs", "destroy_constrs"),
    91    ("dont_destroy_constrs", "destroy_constrs"),
    92    ("dont_specialize", "specialize"),
    92    ("dont_specialize", "specialize"),
    93    ("dont_star_linear_preds", "star_linear_preds"),
    93    ("dont_star_linear_preds", "star_linear_preds"),
       
    94    ("dont_preconstr", "preconstr"),
    94    ("no_peephole_optim", "peephole_optim"),
    95    ("no_peephole_optim", "peephole_optim"),
    95    ("fix_datatype_vals", "dont_fix_datatype_vals"),
       
    96    ("no_debug", "debug"),
    96    ("no_debug", "debug"),
    97    ("quiet", "verbose"),
    97    ("quiet", "verbose"),
    98    ("no_overlord", "overlord"),
    98    ("no_overlord", "overlord"),
    99    ("hide_datatypes", "show_datatypes"),
    99    ("hide_datatypes", "show_datatypes"),
   100    ("hide_consts", "show_consts"),
   100    ("hide_consts", "show_consts"),
   102    ("trust_genuine", "check_genuine")]
   102    ("trust_genuine", "check_genuine")]
   103 
   103 
   104 fun is_known_raw_param s =
   104 fun is_known_raw_param s =
   105   AList.defined (op =) default_default_params s orelse
   105   AList.defined (op =) default_default_params s orelse
   106   AList.defined (op =) negated_params s orelse
   106   AList.defined (op =) negated_params s orelse
   107   member (op =) ["max", "show_all", "whack", "atoms", "eval", "expect"] s orelse
   107   member (op =) ["max", "show_all", "whack", "eval", "atoms", "expect"] s orelse
   108   exists (fn p => String.isPrefix (p ^ " ") s)
   108   exists (fn p => String.isPrefix (p ^ " ") s)
   109          ["card", "max", "iter", "box", "dont_box", "finitize", "dont_finitize",
   109          ["card", "max", "iter", "box", "dont_box", "finitize", "dont_finitize",
   110           "mono", "non_mono", "std", "non_std", "wf", "non_wf", "format",
   110           "mono", "non_mono", "std", "non_std", "wf", "non_wf", "preconstr",
   111           "atoms"]
   111           "dont_preconstr", "format", "atoms"]
   112 
   112 
   113 fun check_raw_param (s, _) =
   113 fun check_raw_param (s, _) =
   114   if is_known_raw_param s then ()
   114   if is_known_raw_param s then ()
   115   else error ("Unknown parameter: " ^ quote s ^ ".")
   115   else error ("Unknown parameter: " ^ quote s ^ ".")
   116 
   116 
   251     val merge_type_vars = lookup_bool "merge_type_vars"
   251     val merge_type_vars = lookup_bool "merge_type_vars"
   252     val binary_ints = lookup_bool_option "binary_ints"
   252     val binary_ints = lookup_bool_option "binary_ints"
   253     val destroy_constrs = lookup_bool "destroy_constrs"
   253     val destroy_constrs = lookup_bool "destroy_constrs"
   254     val specialize = lookup_bool "specialize"
   254     val specialize = lookup_bool "specialize"
   255     val star_linear_preds = lookup_bool "star_linear_preds"
   255     val star_linear_preds = lookup_bool "star_linear_preds"
       
   256     val preconstrs =
       
   257       lookup_bool_option_assigns read_term_polymorphic "preconstr"
   256     val peephole_optim = lookup_bool "peephole_optim"
   258     val peephole_optim = lookup_bool "peephole_optim"
   257     val fix_datatype_vals = lookup_bool "fix_datatype_vals"
       
   258     val datatype_sym_break = lookup_int "datatype_sym_break"
   259     val datatype_sym_break = lookup_int "datatype_sym_break"
   259     val kodkod_sym_break = lookup_int "kodkod_sym_break"
   260     val kodkod_sym_break = lookup_int "kodkod_sym_break"
   260     val timeout = if auto then NONE else lookup_time "timeout"
   261     val timeout = if auto then NONE else lookup_time "timeout"
   261     val tac_timeout = lookup_time "tac_timeout"
   262     val tac_timeout = lookup_time "tac_timeout"
   262     val max_threads = if auto then 1 else Int.max (0, lookup_int "max_threads")
   263     val max_threads = if auto then 1 else Int.max (0, lookup_int "max_threads")
   263     val show_datatypes = debug orelse lookup_bool "show_datatypes"
   264     val show_datatypes = debug orelse lookup_bool "show_datatypes"
   264     val show_consts = debug orelse lookup_bool "show_consts"
   265     val show_consts = debug orelse lookup_bool "show_consts"
       
   266     val evals = lookup_term_list_polymorphic "eval"
   265     val formats = lookup_ints_assigns read_term_polymorphic "format" 0
   267     val formats = lookup_ints_assigns read_term_polymorphic "format" 0
   266     val atomss = lookup_strings_assigns read_type_polymorphic "atoms"
   268     val atomss = lookup_strings_assigns read_type_polymorphic "atoms"
   267     val evals = lookup_term_list_polymorphic "eval"
       
   268     val max_potential =
   269     val max_potential =
   269       if auto then 0 else Int.max (0, lookup_int "max_potential")
   270       if auto then 0 else Int.max (0, lookup_int "max_potential")
   270     val max_genuine = Int.max (0, lookup_int "max_genuine")
   271     val max_genuine = Int.max (0, lookup_int "max_genuine")
   271     val check_potential = lookup_bool "check_potential"
   272     val check_potential = lookup_bool "check_potential"
   272     val check_genuine = lookup_bool "check_genuine"
   273     val check_genuine = lookup_bool "check_genuine"
   282      wfs = wfs, sat_solver = sat_solver, blocking = blocking, falsify = falsify,
   283      wfs = wfs, sat_solver = sat_solver, blocking = blocking, falsify = falsify,
   283      debug = debug, verbose = verbose, overlord = overlord,
   284      debug = debug, verbose = verbose, overlord = overlord,
   284      user_axioms = user_axioms, assms = assms, whacks = whacks,
   285      user_axioms = user_axioms, assms = assms, whacks = whacks,
   285      merge_type_vars = merge_type_vars, binary_ints = binary_ints,
   286      merge_type_vars = merge_type_vars, binary_ints = binary_ints,
   286      destroy_constrs = destroy_constrs, specialize = specialize,
   287      destroy_constrs = destroy_constrs, specialize = specialize,
   287      star_linear_preds = star_linear_preds, peephole_optim = peephole_optim,
   288      star_linear_preds = star_linear_preds, preconstrs = preconstrs,
   288      fix_datatype_vals = fix_datatype_vals,
   289      peephole_optim = peephole_optim, datatype_sym_break = datatype_sym_break,
   289      datatype_sym_break = datatype_sym_break,
       
   290      kodkod_sym_break = kodkod_sym_break, timeout = timeout,
   290      kodkod_sym_break = kodkod_sym_break, timeout = timeout,
   291      tac_timeout = tac_timeout, max_threads = max_threads,
   291      tac_timeout = tac_timeout, max_threads = max_threads,
   292      show_datatypes = show_datatypes, show_consts = show_consts,
   292      show_datatypes = show_datatypes, show_consts = show_consts,
   293      formats = formats, atomss = atomss, evals = evals,
   293      evals = evals, formats = formats, atomss = atomss,
   294      max_potential = max_potential, max_genuine = max_genuine,
   294      max_potential = max_potential, max_genuine = max_genuine,
   295      check_potential = check_potential, check_genuine = check_genuine,
   295      check_potential = check_potential, check_genuine = check_genuine,
   296      batch_size = batch_size, expect = expect}
   296      batch_size = batch_size, expect = expect}
   297   end
   297   end
   298 
   298