summaryrefslogtreecommitdiff
path: root/src/parser/smt/Makefile.am
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-07-31 20:40:14 +0000
committerMorgan Deters <mdeters@gmail.com>2012-07-31 20:40:14 +0000
commit24072d4b0f33abbbe1e468e5b62eb25928f7da25 (patch)
tree1ba758d66c407a2d965dd2a43d902996d27e49ec /src/parser/smt/Makefile.am
parent485c03a323911142e460bd0a7c428759496dc631 (diff)
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.
Diffstat (limited to 'src/parser/smt/Makefile.am')
-rw-r--r--src/parser/smt/Makefile.am30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/parser/smt/Makefile.am b/src/parser/smt/Makefile.am
index 975a90b72..a74a6909c 100644
--- a/src/parser/smt/Makefile.am
+++ b/src/parser/smt/Makefile.am
@@ -15,14 +15,14 @@ ANTLR_OPTS =
noinst_LTLIBRARIES = libparsersmt.la
ANTLR_TOKEN_STUFF = \
- @srcdir@/generated/Smt.tokens
+ generated/Smt.tokens
ANTLR_LEXER_STUFF = \
- @srcdir@/generated/SmtLexer.h \
- @srcdir@/generated/SmtLexer.c \
+ generated/SmtLexer.h \
+ generated/SmtLexer.c \
$(ANTLR_TOKEN_STUFF)
ANTLR_PARSER_STUFF = \
- @srcdir@/generated/SmtParser.h \
- @srcdir@/generated/SmtParser.c
+ generated/SmtParser.h \
+ generated/SmtParser.c
ANTLR_STUFF = \
$(ANTLR_LEXER_STUFF) \
$(ANTLR_PARSER_STUFF)
@@ -35,27 +35,25 @@ libparsersmt_la_SOURCES = \
smt_input.cpp \
$(ANTLR_STUFF)
-BUILT_SOURCES = $(ANTLR_STUFF) @srcdir@/stamp-generated
-
-EXTRA_DIST = @srcdir@/stamp-generated
+BUILT_SOURCES = $(ANTLR_STUFF) stamp-generated
MAINTAINERCLEANFILES = $(ANTLR_STUFF)
maintainer-clean-local:
- -$(AM_V_at)rmdir @srcdir@/generated
- -$(AM_V_at)rm -f @srcdir@/stamp-generated
+ -$(AM_V_at)rmdir generated
+ -$(AM_V_at)rm -f stamp-generated
-@srcdir@/stamp-generated:
- $(AM_V_at)mkdir -p @srcdir@/generated
- $(AM_V_at)touch @srcdir@/stamp-generated
+stamp-generated:
+ $(AM_V_at)mkdir -p generated
+ $(AM_V_at)touch stamp-generated
# antlr doesn't overwrite output files, it just leaves them. So we have to delete them first.
-@srcdir@/generated/SmtLexer.h: Smt.g @srcdir@/stamp-generated
+generated/SmtLexer.h: Smt.g stamp-generated
-$(AM_V_at)rm -f $(ANTLR_STUFF)
@if test -z "$(ANTLR)"; then echo "ERROR: antlr parser generator cannot be found, cannot generate the parser" >&2; exit 1; fi
- $(AM_V_GEN)$(ANTLR) $(ANTLR_OPTS) -fo "@srcdir@/generated" "@srcdir@/Smt.g"
+ $(AM_V_GEN)$(ANTLR) $(ANTLR_OPTS) -fo "generated" "@srcdir@/Smt.g"
# These don't actually depend on SmtLexer.h, but if we're doing parallel
# make and the lexer needs to be rebuilt, we have to keep the rules
# from running in parallel (since the token files will be deleted &
# recreated)
-@srcdir@/generated/SmtLexer.c @srcdir@/generated/SmtParser.h @srcdir@/generated/SmtParser.c $(ANTLR_TOKEN_STUFF): @srcdir@/generated/SmtLexer.h
+generated/SmtLexer.c generated/SmtParser.h generated/SmtParser.c $(ANTLR_TOKEN_STUFF): generated/SmtLexer.h
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback