Options merge. This commit:
authorMorgan Deters <mdeters@gmail.com>
Tue, 31 Jul 2012 20:40:14 +0000 (20:40 +0000)
committerMorgan Deters <mdeters@gmail.com>
Tue, 31 Jul 2012 20:40:14 +0000 (20:40 +0000)
commit24072d4b0f33abbbe1e468e5b62eb25928f7da25
tree1ba758d66c407a2d965dd2a43d902996d27e49ec
parent485c03a323911142e460bd0a7c428759496dc631
Options merge.  This commit:

1. changes the way options are declared (see http://church.cims.nyu.edu/wiki/Options)
2. moves module-specific options enumerations (SimplificationMode, DecisionMode, ArithUnateLemmaMode, etc.) to their own header files, also they are no longer inside the Options:: class namespace.
3. includes many SMT-LIBv2 compliance fixes, especially to (set-option..) and (get-option..)

The biggest syntactical changes (outside of adding new options) you'll notice are in accessing and setting options:

* to access an option, write (e.g.) options::unconstrainedSimp() instead of Options::current()->unconstrainedSimp.
* to determine if an option value was set by the user, check (e.g.) options::unconstrainedSimp.wasSetByUser().
* ensure that you have the option available (you have to #include the right module's options.h file, e.g. #include "theory/uf/options.h" for UF options)
*** this point is important.  If you access an option and it tells you the option doesn't exist, you aren't #including the appropriate options.h header file ***

Note that if you want an option to be directly set (i.e., other than via command-line parsing or SmtEngine::setOption()), you need to mark the option :read-write in its options file (otherwise it's read-only), and you then write (e.g.) options::unconstrainedSimp.set(true).

Adding new options is incredibly simple for primitive types (int, unsigned, bool, string, double).  For option settings that you need to turn into a member of an enumerated type, you write a custom "handler" for the option---this is no additional work than it was before, and there are many examples to copy from (a good one is stringToSimplificationMode() in src/smt/options_handlers.h).

Benefits of the new options system include:

1. changes to options declarations don't require a full-source rebuild (you only have to rebuild those sources that depend on the set of options that changed).
2. lots of sanity checks (that the same option isn't declared twice, that option values are in range for their type, that all options are documented properly, etc.)
3. consistency: Boolean-valued option --foo gets a --no-foo automatically, documentation is generated consistently, the option-parsing matches the documented option name, etc.
4. setting options programmatically via SmtEngine::setOption() is enabled, and behaves the same as command-line equivalents (including checking the value is in range, etc.)
5. the notion of options being "set by the user" is now primitive; you can use (e.g.) options::unconstrainedSimp.wasSetByUser() instead of having to use (and maintain) a separate Boolean option for the purpose

I've taken lots of care not to break anything.  Hopefully, I've succeeded in that.
176 files changed:
Makefile.am
configure.ac
contrib/addsourcedir
doc/cvc4.1.in [deleted file]
doc/cvc4.1_template.in [new file with mode: 0644]
examples/hashsmt/word.cpp
examples/hashsmt/word.h
examples/nra-translate/normalize.cpp
examples/nra-translate/smt2info.cpp
examples/nra-translate/smt2todreal.cpp
examples/nra-translate/smt2toisat.cpp
examples/nra-translate/smt2tomathematica.cpp
examples/nra-translate/smt2toqepcad.cpp
examples/nra-translate/smt2toredlog.cpp
src/Makefile.am
src/compat/cvc3_compat.cpp
src/cvc4.i
src/decision/Makefile.am
src/decision/decision_engine.cpp
src/decision/decision_mode.cpp [new file with mode: 0644]
src/decision/decision_mode.h [new file with mode: 0644]
src/decision/decision_strategy.h
src/decision/options [new file with mode: 0644]
src/decision/options_handlers.h [new file with mode: 0644]
src/decision/relevancy.cpp
src/decision/relevancy.h
src/expr/Makefile.am
src/expr/command.cpp
src/expr/expr_manager_template.cpp
src/expr/expr_manager_template.h
src/expr/expr_template.h
src/expr/node_builder.h
src/expr/node_manager.cpp
src/expr/node_manager.h
src/expr/node_value.cpp
src/expr/options [new file with mode: 0644]
src/expr/options_handlers.h [new file with mode: 0644]
src/include/cvc4.h
src/main/Makefile.am
src/main/driver.cpp
src/main/driver_portfolio.cpp
src/main/interactive_shell.cpp
src/main/interactive_shell.h
src/main/main.cpp
src/main/main.h
src/main/options [new file with mode: 0644]
src/main/options_handlers.h [new file with mode: 0644]
src/main/portfolio.cpp
src/main/portfolio.h
src/main/util.cpp
src/options/Makefile [new file with mode: 0644]
src/options/Makefile.am [new file with mode: 0644]
src/options/base_options [new file with mode: 0644]
src/options/base_options_handlers.h [new file with mode: 0644]
src/options/base_options_template.cpp [new file with mode: 0644]
src/options/base_options_template.h [new file with mode: 0644]
src/options/mkoptions [new file with mode: 0755]
src/options/options.h [new file with mode: 0644]
src/options/options.i [new file with mode: 0644]
src/options/options_holder_template.h [new file with mode: 0644]
src/options/options_template.cpp [new file with mode: 0644]
src/parser/cvc/Makefile.am
src/parser/options [new file with mode: 0644]
src/parser/parser.cpp
src/parser/parser_builder.cpp
src/parser/smt/Makefile.am
src/parser/smt/Smt.g
src/parser/smt2/Makefile.am
src/parser/smt2/Smt2.g
src/parser/tptp/Makefile.am
src/printer/Makefile.am
src/printer/options [new file with mode: 0644]
src/proof/Makefile.am
src/proof/options [new file with mode: 0644]
src/proof/proof.h
src/prop/Makefile.am
src/prop/bvminisat/core/Solver.cc
src/prop/cnf_stream.cpp
src/prop/minisat/core/Solver.cc
src/prop/minisat/minisat.cpp
src/prop/minisat/simp/SimpSolver.cc
src/prop/options [new file with mode: 0644]
src/prop/options_handlers.h [new file with mode: 0644]
src/prop/prop_engine.cpp
src/prop/prop_engine.h
src/prop/sat_module.cpp [new file with mode: 0644]
src/prop/sat_solver.h
src/prop/theory_proxy.cpp
src/prop/theory_proxy.h
src/smt/Makefile.am
src/smt/options [new file with mode: 0644]
src/smt/options_handlers.h [new file with mode: 0644]
src/smt/simplification_mode.cpp [new file with mode: 0644]
src/smt/simplification_mode.h [new file with mode: 0644]
src/smt/smt_engine.cpp
src/smt/smt_engine.h
src/smt/smt_options_template.cpp [new file with mode: 0644]
src/theory/Makefile.am
src/theory/arith/Makefile.am
src/theory/arith/arith_heuristic_pivot_rule.cpp [new file with mode: 0644]
src/theory/arith/arith_heuristic_pivot_rule.h [new file with mode: 0644]
src/theory/arith/arith_propagation_mode.cpp [new file with mode: 0644]
src/theory/arith/arith_propagation_mode.h [new file with mode: 0644]
src/theory/arith/arith_unate_lemma_mode.cpp [new file with mode: 0644]
src/theory/arith/arith_unate_lemma_mode.h [new file with mode: 0644]
src/theory/arith/options [new file with mode: 0644]
src/theory/arith/options_handlers.h [new file with mode: 0644]
src/theory/arith/simplex.cpp
src/theory/arith/simplex.h
src/theory/arith/theory_arith.cpp
src/theory/arith/theory_arith_instantiator.cpp
src/theory/arrays/Makefile.am
src/theory/arrays/options [new file with mode: 0644]
src/theory/arrays/theory_arrays_instantiator.cpp
src/theory/booleans/Makefile.am
src/theory/booleans/options [new file with mode: 0644]
src/theory/builtin/Makefile.am
src/theory/builtin/options [new file with mode: 0644]
src/theory/bv/Makefile.am
src/theory/bv/bitblaster.cpp
src/theory/bv/bv_subtheory_bitblast.cpp
src/theory/bv/options [new file with mode: 0644]
src/theory/bv/theory_bv.cpp
src/theory/candidate_generator.cpp
src/theory/datatypes/Makefile.am
src/theory/datatypes/options [new file with mode: 0644]
src/theory/datatypes/theory_datatypes_instantiator.cpp
src/theory/inst_match.cpp
src/theory/ite_simplifier.h
src/theory/options [new file with mode: 0644]
src/theory/options_handlers.h [new file with mode: 0644]
src/theory/quantifiers/Makefile.am
src/theory/quantifiers/first_order_model.cpp
src/theory/quantifiers/inst_when_mode.cpp [new file with mode: 0644]
src/theory/quantifiers/inst_when_mode.h [new file with mode: 0644]
src/theory/quantifiers/instantiation_engine.cpp
src/theory/quantifiers/literal_match_mode.cpp [new file with mode: 0644]
src/theory/quantifiers/literal_match_mode.h [new file with mode: 0644]
src/theory/quantifiers/model_builder.cpp
src/theory/quantifiers/model_engine.cpp
src/theory/quantifiers/options [new file with mode: 0644]
src/theory/quantifiers/options_handlers.h [new file with mode: 0644]
src/theory/quantifiers/quantifiers_rewriter.cpp
src/theory/quantifiers/term_database.cpp
src/theory/quantifiers/theory_quantifiers.cpp
src/theory/quantifiers/theory_quantifiers_instantiator.cpp
src/theory/quantifiers_engine.cpp
src/theory/rewriterules/options [new file with mode: 0644]
src/theory/rewriterules/theory_rewriterules.cpp
src/theory/rewriterules/theory_rewriterules_rules.cpp
src/theory/rr_inst_match.h
src/theory/theory.h
src/theory/theory_engine.cpp
src/theory/theory_engine.h
src/theory/trigger.cpp
src/theory/uf/Makefile.am
src/theory/uf/inst_strategy.cpp
src/theory/uf/options [new file with mode: 0644]
src/theory/uf/options_handlers.h [new file with mode: 0644]
src/theory/uf/theory_uf.cpp
src/theory/uf/theory_uf_instantiator.cpp
src/theory/uf/theory_uf_strong_solver.cpp
src/util/Makefile.am
src/util/configuration.cpp
src/util/options.cpp [deleted file]
src/util/options.h [deleted file]
src/util/options.i [deleted file]
src/util/rational_cln_imp.h
src/util/rational_gmp_imp.h
src/util/stats.cpp
src/util/stats.h
test/system/Makefile.am
test/system/smt2_compliance.cpp [new file with mode: 0644]
test/unit/main/interactive_shell_black.h
test/unit/parser/parser_black.h
test/unit/theory/theory_engine_white.h