summaryrefslogtreecommitdiff
path: root/src/expr/command.cpp
AgeCommit message (Collapse)Author
2012-10-11Standardizing copyright notice. Touches **ALL** sources, guys, sorry.. it'sMorgan Deters
just the header comments at the top, though. Don't update to this rev if you don't have time for a complete rebuild, and exclude this rev if you want to see what's new across a range of commits. (this commit was certified error- and warning-free by the test-and-commit script.)
2012-10-09* make Model class private (as discussed at meeting today)Morgan Deters
* fix minor issue with s-expr parsing in CVC and SMT grammars * other minor things (this commit was certified error- and warning-free by the test-and-commit script.)
2012-10-05Bug-related:Morgan Deters
* ITE removal fixed to be context-dependent (on UserContext). Resolves incrementality bugs 376 and 396 (which had given wrong answers). * some bugfixes for incrementality that Dejan found (fixes bug 394) * fix for bug in SmtEngine::getValue() where definitions weren't respected (partially resolves bug 411, but get-model is still broken). * change status of microwave21.ec.minimized.smt2 (it's actually unsat, but was labeled sat); re-enable it for "make regress" Also: * --check-model doesn't fail if quantified assertions don't simplify away. * fix some examples, and the Java system test, for the disappearance of the BoolExpr class * add copy constructor to array type enumerator (the type enumerator framework requires copy ctors, and the automatically-generated copy ctor was copying pointers that were then deleted, leaving dangling pointers in the copy and causing segfaults) * --dump=assertions now implies --dump=skolems * --dump=assertions:pre-<PASS> and --dump=assertions:post-<PASS> now allow you to dump before/after a particular preprocessing pass. E.g., --dump=assertions:pre-ite-removal or --dump=assertions:post-static-learning. "--dump=assertions" by itself is after all preprocessing, just before CNF conversion. * minor fixes to dumping output * include Model in language bindings Minor refactoring/misc: * fix compiler warning in src/theory/model.cpp * remove unnecessary SmtEngine::printModel(). * mkoptions script doesn't give progress output if stdout isn't a terminal (e.g., if it's written to a log, or piped through less(1), or whatever). * add some type enumerator unit tests * de-emphasize --parse-only and --preprocess-only (they aren't really "common" options) * fix some exception throw() specifications in SmtEngine * minor documentation clarifications
2012-10-05BoolExpr removed and replaced with ExprDejan Jovanović
2012-09-28Some fixes to portfolioKshitij Bansal
* respect output lang * fix export variable for BOUND_VARIABLE * support export of SUBRANGE_TYPE * statistic for lastWinner, other minor stat changes * fix running of multiple threads on checsat/query * changes of Assert -> assert which became private * fix some destruction time order issues * fix Pickler with AssertionException going private Fixed by not fixing: * portfolio+datatypes does not work - added ExportUnsupportedException to more places, switches to sequential (still TODO / decide : not switch silently, but print error) > note: this exception now needs to be (and is) defined in expr.h Known issues: * problems in portfolio+quantifiers - at least some problems appear to be because of static variables (will be later "fixed" like the datatypes) (this commit was certified error- and warning-free by the test-and-commit script.)
2012-09-26Finish off SEXPR kind work.Morgan Deters
(this commit was certified error- and warning-free by the test-and-commit script.)
2012-09-26The Tuesday Afternoon Catch-All Commit (TACAC):Morgan Deters
* --early-exit and --no-early-exit command line options (the former is default for all builds except debug builds) * New SEXPR kind for doing lists of things (we previously used TUPLEs for this purpose, but TUPLEs will be used in future by the datatypes theory, and so cannot have function symbols in them, etc.). * SMT-LIB compliant output for (set-option :produce-unsat-cores true) and (get-unsat-core) (this commit was certified error- and warning-free by the test-and-commit script.)
2012-09-19General subscriber infrastructure for NodeManager, as discussed in theMorgan Deters
meeting last week. The SmtEngine now subscribes to NodeManager events, does appropriate dumping of variable declarations, and notifies the Model class. The way to create a skolem is now: nodeManager->mkSkolem("myvar_$$", TypeNode, "is a variable created by the theory of Foo") The first argument is the name of the skolem, and the (optional) "$$" is a placeholder for the node id (to get a unique name). Without a "$$", a "_$$" is automatically appended to the given name. The second argument is the type. The (optional, but recommended) third argument is a comment, used by the dump infrastructure to indicate what the variable is for / who owns it. An optional fourth argument (not shown) allows you to specify flags that control the behavior (e.g., don't do notification, and/or don't make a unique name). Look at the documentation for details on these. In particular, the above means you can't just do a mkSkolem(boolType) for example---you have to specify a name and (hopefully also, but it's optional) a comment. This leads to easier debugging than the anonymous skolems before, since we'll be able to track where the skolems came from. Much of the Model and Dump stuff, as well as some Command stuff, is cleaned up by this commit. Some remains to be cleaned up. (this commit was certified error- and warning-free by the test-and-commit script.)
2012-09-15minor interface improvements, compliance fixesMorgan Deters
(this commit was certified error- and warning-free by the test-and-commit script.)
2012-09-08Single driver for both sequential and portfolioKshitij Bansal
A "command executer" layer between parsing commands and invoking them. New implementation of portfolio driver splits only when check-sat or query command is encountered, and then switches back to sequential till the next one. As side effect, restores functionality of interactive mode and push/pops.
2012-09-04Accepted some patches from the Multicore Programming Group at Imperial ↵Morgan Deters
College London (via Peter Collingbourne): cvc4-0001-Look-for-cxxtestgen-as-well-as-cxxtestgen.pl-and-cxx.patch * better checking for cxxtest cvc4-0002-Do-not-read-an-additional-command-after-failure.patch * more correct failure behavior for interactive tools cvc4-0003-Only-exit-when-encountering-a-CommandFailure.patch * don't consider "unsupported" as a failure (accepted with modifications) cvc4-0004-Produce-SMT-LIB-v2-conformant-output-for-get-info.patch * better get-info responses (accepted with modifications) These patches will help the group build Boogie support for CVC4. (this commit was certified error- and warning-free by the test-and-commit script.)
2012-08-31merge from fmf-devel branch. more updates to models: now with ↵Andrew Reynolds
collectModelInfo with fullModel argument, most theory-specific implementation out of the model class, model printer relegated to printer classes. Also updates to finite mode finding, modifications to datatypes making them compatible with theory combination, support for theory-specific handling of user attributes, refactoring of uf models
2012-08-24fix get-value output in a couple ways; this fixes bug #378Morgan Deters
2012-08-06Support setting :regular-output-channel and :diagnostic-output-channel.Morgan Deters
Also some cleanup of option-related exceptions infrastructure.
2012-08-06Cleanup of some command stuff, fixes broken Java build.Morgan Deters
2012-07-31Options merge. This commit:Morgan Deters
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.
2012-07-27Merge quantifiers2-trunk:François Bobot
- new syntax for rewrite rules - better rewrite rules theory - remove the rewriting with rewrite rules during ppRewrite temporarily - theory can define their own candidate generator - define a general candidate generator (inefficient ask to every theory) - split inst_match between the pattern matching used for quantifiers (inst_match.*) and the one used for rewrite rules (rr_inst_match.*): - the pattern matching is less exhaustive for quantifiers, - the one for rewrite rules can use efficient-e-matching.
2012-07-18more compliance fixes for SMT-LIBv2Morgan Deters
2012-07-17SMT-LIBv2 compliance updates:Morgan Deters
* more correct support for get-info responses * printer infrastructure extended to SExprs * parser updates to correctly handle symbols and strings (there were some minor differences from the spec)
2012-07-12merged fmf-devel branch, includes support for SMT2 command get-value and ↵Andrew Reynolds
(extended) SMT command get-model. added collectModelInfo and removed getValue from theory interface. merge also includes major updates to finite model finding module (from CASC), added fmf options, some updates to strong solver and quantifiers engine interface. The test recursion_breaker_black currently fails for me on production builds, Morgan is planning to look into this.
2012-07-08minor SMT-LIBv2 compliance issuesMorgan Deters
2012-06-14some changes to make CVC4 work nicely with trace executor for application ↵Morgan Deters
track; (set-option :print-success true) supported, (exit) causes immediate exit regardless of EOF, etc.
2012-06-09Dagification of output expressions.Morgan Deters
By default, common subexpressions are dagified if they appear > 1 time and are not constants or variables. This can be changed with --default-expr-dag=N --- N is a threshold such that if the subexpression occurs > N times, it is dagified; a setting of 0 turns off dagification entirely. If you notice strange dumping behavior (taking too long to print anything, e.g.), revert to the old behavior with --default-expr-dag=0 and let me know of the problem.
2012-06-08Extend Printer infrastructure also to the "Result" class, meaning that ↵Morgan Deters
different output languages can write "sat", "unsat", etc., in different ways. No output is changed by this commit, but the flexibility is added that Francois wanted at today's meeting.
2012-06-07Adding EchoCommand and associated printer and parser rules:Morgan Deters
* SMT-LIBv2 parser now supports (echo...). * Dump() gestures can now dump EchoCommands in CVC and SMT-LIB formats. This can make it much easier to interpret output.
2012-03-09Some work on the dump infrastructure to support portfolio work.Morgan Deters
Dump("foo") << FooCommand(...); now "dumps" the textual representation of the command (in the current output language) to a file, IF dumping is on at configure-time, AND the "muzzle" feature is off, AND the "foo" flag is turned on for the dump stream during this run. If it's a portfolio build, the above will also store the command in a CommandSequence, IF the "foo" flag is turned on for the dump stream during this run. This is done even if the muzzle is on. This commit also cleans up some code that used the dump feature (in arrays, particularly).
2012-03-01Partial merge from kind-backend branch, including Minisat and CNF work toMorgan Deters
support incrementality. Some clean-up work will likely follow, but the CNF/Minisat stuff should be left pretty much untouched. Expected performance change negligible; slightly better on memory: http://church.cims.nyu.edu/regress-results/compare_jobs.php?job_id=3705&reference_id=3697&mode=&category=&p=5 Note that there are crashes, but that these are exhibited in the nightly regression run too!
2012-02-22Fixes to documentation / fixes for MacOSMorgan Deters
2012-02-20portfolio mergeMorgan Deters
2012-02-13proper handling of improper get-valueMorgan Deters
2011-11-22More language bindings work:Morgan Deters
* with a patched SWIG, the ocaml bindings build correctly. ** I will provide my patch to the SWIG dev team. * fixed some class interfaces to play more nicely with SWIG. * php, perl, tcl now work; examples added. * improved binding module building and installation. Also: Stop #defining NULL ((void*) 0). This has been in cvc4_public.h for a long, long time, I forget why I added it in the first place, and it's a very, very bad idea. In C++, certain things are permitted for NULL that aren't permitted for ((void*) 0), like for instance implicit conversion to any pointer type. We didn't see an issue here (until now, when interfacing with SWIG), because GCC is usually pretty smart at working around such a broken #definition of NULL. But that's fragile. New exception-free Command architecture. Previously, some command invocations were wrapped in a try {} catch() {} and printed out an error. This is much more consistent now. Each Command invocation results in a CommandStatus. The status can be "unsupported", "error", or "success" (these are each derived classes, though, not strings, so that they can be easily printed in a language-specific way... e.g., in SMT-LIBv2, they are printed in a manner consistent with the spec, and "success" is not printed if the print-success option is off.) All Command functionality are now no-throw functions, which @cconway reports is a Good Thing for Google (where all C++ exceptions are suspect), and also I think is much cleaner than the old way in this instance. Added an --smtlib2 option that enables an "SMT-LIBv2 compliance mode"---really it just sets a few other options like strictParsing, inputLanguage, and printSuccess. In the future we might put other options into a compliance mode, or we might choose to make it the default.
2011-10-29Support for SMT-LIBv2 (get-proof), CVC-style DUMP_PROOF command, ↵Morgan Deters
SmtEngine::getProof(), a few other things..
2011-09-16dump define-funs correctly with "--dump declarations", whether the function ↵Morgan Deters
is defined via API or through input language
2011-09-02Merge from my post-smtcomp branch. Includes:Morgan Deters
Dumping infrastructure. Can dump preprocessed queries and clauses. Can also dump queries (for testing with another solver) to see if any conflicts are missed, T-propagations are missed, all lemmas are T-valid, etc. For a full list of options see --dump=help. CUDD building much cleaner. Documentation and assertion fixes. Printer improvements, printing of commands in language-defined way, etc. Typechecker stuff in expr package now autogenerated, no need to manually edit the expr package when adding a new theory. CVC3 compatibility layer (builds as libcompat). SWIG detection and language binding support (infrastructure). Support for some Z3 extended commands (like datatypes) in SMT-LIBv2 mode (when not in compliance mode). Copyright and file headers regenerated.
2011-07-11merge from symmetry branchMorgan Deters
2011-07-05updated preprocessing and rewriting input equalities into inequalities for LRADejan Jovanović
2011-05-05Merge from nonclausal-simplification-v2 branch:Morgan Deters
* Preprocessing-time, non-clausal, Boolean simplification round to support "quasi-non-linear rewrites" as discussed at last few meetings. * --simplification=none is the default for now, but we'll probably change that to --simplification=incremental. --simplification=batch is also a possibility. See --simplification=help for details. * RecursionBreaker<T> now uses a hash set for the seen trail. * Fixes to TLS stuff to support that. * Fixes to theory and SmtEngine documentation. * Fixes to stream indentation. * Other miscellaneous stuff.
2011-05-01minor fixes, plus experimental readline support in InteractiveShellMorgan Deters
2011-04-18more work on CVC languageMorgan Deters
2011-04-18Partial merge from datatypes-merge branch:Morgan Deters
1. Defines a new type "DatatypeType", a type-constant that holds a Datatype, describing an inductive data type. 2. CVC language parser supports datatypes. 3. CVC language printer now functional. 4. Minor other cleanups. No performance impact is expected outside of datatypes. I'm verifying that that is the case with a cluster job this morning.
2011-03-25This is a merge from the "theoryfixes+cdattrhash" branch. The changesMorgan Deters
are somewhat disparate but belonged on the same branch because they were held back from trunk all for the same reason (to keep the trunk stable for furious bitvector development). Dejan has now given me the go-ahead for a merge. ========================================= THIS COMMIT CHANGES THE THEORY INTERFACE! ========================================= Theory constructors are expected to take an additional "Valuation*" parameter that each Theory should send along to the base class constructor. The base class Theory keeps the Valuation* in a d_valuation field for use by it and by its derived classes. Theory::getValue() no longer takes a Valuation* (it is expected to use d_valuation instead). This allows other theory functions to take advantage of getValue() for debugging or heuristic purposes. TODO BEFORE MERGE TO TRUNK: ****implement BitIterator find() in CDAttrHash<bool>. Specifically: * Added QF_BV support for SMT-LIB v2. * Two adjustments to the theory interface as requested by Tim King: 1. As described above. 2. Theories now have const access to the fact queue through base class functions facts_begin() and facts_end(); useful for debugging. * Added an "Asserted" attribute so that theories can check if something has been asserted or not (and therefore not propagate it). However, this has been disabled for now, pending more data on the overhead of it, and pending discussion at the 3/25/2011 meeting. * Do not define NDEBUG in MiniSat in assertion-enabled builds (so that MiniSat asserts are evaluated). * As a result of the new MiniSat assertions, some --incremental regressions had to be disabled; also, some bitvectors ?!! * Bug 71 is resolved by adding a specialization for CDAttrHash<> in the attribute package. * Fixes for some warnings flagged by clang. * System tests have arrived! So far mainly infrastructure for having system tests, but there is a system test aimed at improving code coverage of the printer package. * Minor other adjustments to documentation and coding to be more conformant to CVC4 policy. Tests have been performed to demonstrate that these changes have no or negligible effect on performance. In particular, changing the CDAttrHash<> doesn't have any real effect on performance or memory right now, since there is only one context-dependent boolean flag (as soon as another is added, the effect is noticeable but probably still slight).
2010-11-08cleanup, documentation, SMT-LIBv2 complianceMorgan Deters
2010-10-26GetValueCommand now gives a TUPLE as output, with the first operand the ↵Morgan Deters
input expression and the second the value (resolves bug 227)
2010-10-10additional model gen and SMT-LIBv2 compliance work: (get-assignment) now ↵Morgan Deters
supported; work on Result type (biggest noticeable change is that CVC4 now outputs lowercase "sat" and "unsat"), Options class moved to src/smt, to allow for future work on runtime configuration via (set-option) command
2010-10-09support for SMT-LIBv2 :named attributes, and attributes in general; zero-ary ↵Morgan Deters
define-fun; several set-info, set-option, get-option, get-info improvementss
2010-10-07SMT-LIBv2 (define-fun...) command now functional; does eager expansion at ↵Morgan Deters
preprocessing time
2010-10-05parser and core support for SMT-LIBv2 commands get-info, set-option, ↵Morgan Deters
get-option, get-assertions, get-value, define-sort, define-fun, and declare-sort with arity > 0; SmtEngine doesn't yet support most of these, but will shortly...
2010-06-04** Don't fear the files-changed list, almost all changes are in the **Morgan Deters
** file-level documentation at the top of the sources. ** This is the "make bugzilla stop bugging me" bugfix commit. * Remove BackedNodeBuilder<> and collapse NodeBuilder<> hierarchy. Updated documentation in the file. Resolves bug #99. * Convenience NodeBuilders (PlusNodeBuilder, OrNodeBuilder, etc.) moved into a separate file. Partially resolves bug #100. * Moved isAssociative(Kind) into kind.h (and into the CVC4::kind namespace) instead of metakind.h (where it was in CVC4::metakind). This clears up a warning (private #inclusion) from the SMT and SMT2 parsers, and maybe makes more sense anyways, since this is based on the kind (and not the metakind) of an operator. * Documentation improvement; doxygen top-level \file gestures, \brief gestures for files, etc. Changed contrib/update-copyright.pl for this change, and post-processed to add \brief. Resolves bug #98. * Removed ExprManager::mkExpr(Kind) and NodeManager::mkNode(Kind). They no longer made sense. Resolves bug #91.
2010-04-06* Add some protected ContextObj accessors for ContextObj-derived classes:Morgan Deters
+ Context* getContext() -- gets the context + ContextMemoryManager* getCMM() -- gets the CMM + int getLevel() -- the scope level of the ContextObj's most recent update + bool isCurrent() -- true iff the most recent update is the current top level In particular, the ContextObj::getCMM() call cleans up by TheoryUF's ECData::addPredecessor() function substantially (re: code review bug #64). * Fix serious bugs in context operations that corrupted the ContextObj linked lists. Closes bug #85. * Identified a bug in the way objects of the "Link" class are allocated; see bug #96. * Re-enable context white-box tests that ensure proper links in linked lists. Closes bug #86. * Re-enable CDMap<>::emptyTrash(). Closes bug #87. * Add a tracing option (-t foo or --trace foo) to the driver to enable Trace("foo") output stream. -d foo implies -t foo. * Minor clean-up of some TheoryUF code; addition of some documentation (re: code review bug #64). * Address some things that caused Doxygen discomfort. * Address an issue raised in NodeManager's code review (bug #65). * Remove an inaccurate comment in Attribute code (re: code review bug #61).
2010-03-05* public/private code untangled (smt/smt_engine.h no longer #includesMorgan Deters
expr/node.h). This removes the warnings we had during compilation, and heads off a number of potential linking errors due to improper inlining of private (library-only) stuff in client (out-of-library) code. * "configure" now takes some options as part of a "bare-option" build type (e.g., "./configure debug-coverage" or "./configure production-muzzle"). * split cdo.h, cdlist.h, cdmap.h, and cdset.h from context.h * split cdlist_black unit test from context_black * implement CDMap<>. * give ExprManagers ownership of the context (and have SmtEngine share that one) * fix main driver to properly report file-not-found * fix MemoryMappedInputBuffer class to report reasons for "errno"-returned system errors * src/expr/attribute.h: context-dependent attribute kinds now supported * test/unit/expr/node_white.h: context-dependent attribute tests * src/prop/cnf_conversion.h and associated parts of src/util/options.h and src/main/getopt.cpp: obsolete command-line option, removed. * src/util/Assert.h: assertions are now somewhat more useful (in debug builds, anyway) during stack unwinding. * test/unit/theory/theory_black.h: test context-dependent behavior of registerTerm() attribute for theories * src/expr/node_builder.h: formatting, fixes for arithmetic convenience node builders, check memory allocations * test/unit/expr/node_builder_black.h: add tessts for addition, subtraction, unary minus, and multiplication convenience node builders * src/expr/attribute.h: more comments * (various) code formatting, comment cleanup, added throws specifier to some destructors * contrib/code-checker: prototype perl script to test (some) code policy * contrib/indent-settings: command line for GNU indent to indent using CVC4 style (sort of; this is a work in progress) * COPYING: legal stuff * DESIGN_QUESTIONS: obsolete, removed
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback