src/HOL/Tools/SMT/smt_config.ML
changeset 42616 92715b528e78
parent 42190 b6b5846504cd
child 46042 ab32a87ba01a
equal deleted inserted replaced
42607:c8673078f915 42616:92715b528e78
    21   val solver_options_of: Proof.context -> string list
    21   val solver_options_of: Proof.context -> string list
    22 
    22 
    23   (*options*)
    23   (*options*)
    24   val oracle: bool Config.T
    24   val oracle: bool Config.T
    25   val datatypes: bool Config.T
    25   val datatypes: bool Config.T
    26   val timeoutN: string
       
    27   val timeout: real Config.T
    26   val timeout: real Config.T
    28   val random_seed: int Config.T
    27   val random_seed: int Config.T
    29   val fixed: bool Config.T
    28   val fixed: bool Config.T
    30   val verbose: bool Config.T
    29   val verbose: bool Config.T
    31   val traceN: string
       
    32   val trace: bool Config.T
    30   val trace: bool Config.T
    33   val trace_used_facts: bool Config.T
    31   val trace_used_facts: bool Config.T
    34   val monomorph_limit: int Config.T
    32   val monomorph_limit: int Config.T
    35   val monomorph_instances: int Config.T
    33   val monomorph_instances: int Config.T
    36   val monomorph_full: bool Config.T
    34   val monomorph_full: bool Config.T
   147     "SMT solver configuration"
   145     "SMT solver configuration"
   148 
   146 
   149 
   147 
   150 (* options *)
   148 (* options *)
   151 
   149 
   152 val oracleN = "smt_oracle"
   150 val oracle = Attrib.setup_config_bool @{binding smt_oracle} (K true)
   153 val (oracle, setup_oracle) = Attrib.config_bool oracleN (K true)
   151 val datatypes = Attrib.setup_config_bool @{binding smt_datatypes} (K false)
   154 
   152 val timeout = Attrib.setup_config_real @{binding smt_timeout} (K 30.0)
   155 val datatypesN = "smt_datatypes"
   153 val random_seed = Attrib.setup_config_int @{binding smt_random_seed} (K 1)
   156 val (datatypes, setup_datatypes) = Attrib.config_bool datatypesN (K false)
   154 val fixed = Attrib.setup_config_bool @{binding smt_fixed} (K false)
   157 
   155 val verbose = Attrib.setup_config_bool @{binding smt_verbose} (K true)
   158 val timeoutN = "smt_timeout"
   156 val trace = Attrib.setup_config_bool @{binding smt_trace} (K false)
   159 val (timeout, setup_timeout) = Attrib.config_real timeoutN (K 30.0)
   157 val trace_used_facts = Attrib.setup_config_bool @{binding smt_trace_used_facts} (K false)
   160 
   158 val monomorph_limit = Attrib.setup_config_int @{binding smt_monomorph_limit} (K 10)
   161 val random_seedN = "smt_random_seed"
   159 val monomorph_instances = Attrib.setup_config_int @{binding smt_monomorph_instances} (K 500)
   162 val (random_seed, setup_random_seed) = Attrib.config_int random_seedN (K 1)
   160 val monomorph_full = Attrib.setup_config_bool @{binding smt_monomorph_full} (K true)
   163 
   161 val infer_triggers = Attrib.setup_config_bool @{binding smt_infer_triggers} (K false)
   164 val fixedN = "smt_fixed"
   162 val drop_bad_facts = Attrib.setup_config_bool @{binding smt_drop_bad_facts} (K false)
   165 val (fixed, setup_fixed) = Attrib.config_bool fixedN (K false)
   163 val filter_only_facts = Attrib.setup_config_bool @{binding smt_filter_only_facts} (K false)
   166 
   164 val debug_files = Attrib.setup_config_string @{binding smt_debug_files} (K "")
   167 val verboseN = "smt_verbose"
       
   168 val (verbose, setup_verbose) = Attrib.config_bool verboseN (K true)
       
   169 
       
   170 val traceN = "smt_trace"
       
   171 val (trace, setup_trace) = Attrib.config_bool traceN (K false)
       
   172 
       
   173 val trace_used_factsN = "smt_trace_used_facts"
       
   174 val (trace_used_facts, setup_trace_used_facts) =
       
   175   Attrib.config_bool trace_used_factsN (K false)
       
   176 
       
   177 val monomorph_limitN = "smt_monomorph_limit"
       
   178 val (monomorph_limit, setup_monomorph_limit) =
       
   179   Attrib.config_int monomorph_limitN (K 10)
       
   180 
       
   181 val monomorph_instancesN = "smt_monomorph_instances"
       
   182 val (monomorph_instances, setup_monomorph_instances) =
       
   183   Attrib.config_int monomorph_instancesN (K 500)
       
   184 
       
   185 val monomorph_fullN = "smt_monomorph_full"
       
   186 val (monomorph_full, setup_monomorph_full) =
       
   187   Attrib.config_bool monomorph_fullN (K true)
       
   188 
       
   189 val infer_triggersN = "smt_infer_triggers"
       
   190 val (infer_triggers, setup_infer_triggers) =
       
   191   Attrib.config_bool infer_triggersN (K false)
       
   192 
       
   193 val drop_bad_factsN = "smt_drop_bad_facts"
       
   194 val (drop_bad_facts, setup_drop_bad_facts) =
       
   195   Attrib.config_bool drop_bad_factsN (K false)
       
   196 
       
   197 val filter_only_factsN = "smt_filter_only_facts"
       
   198 val (filter_only_facts, setup_filter_only_facts) =
       
   199   Attrib.config_bool filter_only_factsN (K false)
       
   200 
       
   201 val debug_filesN = "smt_debug_files"
       
   202 val (debug_files, setup_debug_files) =
       
   203   Attrib.config_string debug_filesN (K "")
       
   204 
       
   205 val setup_options =
       
   206   setup_oracle #>
       
   207   setup_datatypes #>
       
   208   setup_timeout #>
       
   209   setup_random_seed #>
       
   210   setup_fixed #>
       
   211   setup_trace #>
       
   212   setup_verbose #>
       
   213   setup_monomorph_limit #>
       
   214   setup_monomorph_instances #>
       
   215   setup_monomorph_full #>
       
   216   setup_infer_triggers #>
       
   217   setup_drop_bad_facts #>
       
   218   setup_filter_only_facts #>
       
   219   setup_trace_used_facts #>
       
   220   setup_debug_files
       
   221 
   165 
   222 
   166 
   223 (* diagnostics *)
   167 (* diagnostics *)
   224 
   168 
   225 fun cond_trace flag f x = if flag then tracing ("SMT: " ^ f x) else ()
   169 fun cond_trace flag f x = if flag then tracing ("SMT: " ^ f x) else ()
   267 
   211 
   268 (* setup *)
   212 (* setup *)
   269 
   213 
   270 val setup =
   214 val setup =
   271   setup_solver #>
   215   setup_solver #>
   272   setup_options #>
       
   273   setup_certificates
   216   setup_certificates
   274 
   217 
   275 fun print_setup ctxt =
   218 fun print_setup ctxt =
   276   let
   219   let
   277     fun string_of_bool b = if b then "true" else "false"
   220     fun string_of_bool b = if b then "true" else "false"