summaryrefslogtreecommitdiff
path: root/src/parser
AgeCommit message (Collapse)Author
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-27merging fmf-devel branch, includes refactored datatype theory, updates to ↵Andrew Reynolds
model.h/cpp to prepare for release, and major refactoring of quantifiers/finite model finding. Note that new datatype theory does not insist upon any interpretation for selectors applied to incorrect constructors and consequently some answers may differ with previous version
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-17fix an obvious oversight: "distinct" wasn't part of the SMT2 core ↵Morgan Deters
theory---but this only gave trouble in strict parsing mode
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-10going back to 1. being a non decimalDejan Jovanović
2012-07-10small changes:Dejan Jovanović
* smtlib2 decimal constant can be "1.", i.e. doesn't need digits after the point * adding CVC4_PUBLIC to rational output operator, otherwise it's unusable for users
2012-07-08Bugs resolved by this commit: #314, #322, #359, #364, #365.Morgan Deters
See below for details. * Fix the "assert" name-collision bug (resolves bug #364). Our identifiers should never be named "assert", as that's a preprocessor definition in <assert.h>, which is often #included indirectly (so simply having a policy of not including <assert.h> isn't good enough---one of our dependences might include it). It was once the case that we didn't have anything named "assert", but "assert()" has now crept back in. Instead, name things "assertFoo()" or similar. Thanks to Tim for the report. To fix this, I've changed some of Dejan's circuit-propagator code from "assert()" to "assertTrue()". Ditto for Andy's explanation manager. Guys, if you prefer a different name in your code, please change it. * Fix the incorrect parsing of lets in SMT-LIBv2 parser (resolves bug #365). Inner lets now shadow outer lets (previously, they incorrectly gave an error). Additionally, while looking at this, I found that a sequential let was implemented rather than a parallel let. This is now fixed. Thanks to Liana for the report. * Remove ANTLR parser generation warnings in CVC parser (resolves bug #314). * There were a lot of Debug lines in bitvectors that had embedded toString() calls. This wasted a LOT of time in debug builds for BV benchmarks (like in "make regress"). Added if(Debug.isOn(...)) guards; much faster now. * Support for building public-facing interface documentation only (as opposed to all internals documentation). Now "make doc" does the public-facing and "make doc-internals" does documentation of everything. (Along with changes to the nightly build script---which will now build and publish both types of Doxygen documentation---this resolves bug #359). * Fix the lambda typechecking bug (resolves bug #322). Thanks to Andy for the report (a long long time ago--sorry). * The default output language for all streams is now based on the current set of Options (if there is one). This has been a constant annoyance, especially when stringstreams are used to construct output. However, it doesn't work for calls from outside the library, so it's mainly an annoyance-fixer for CVC4 library code itself. * Add some CVC4_UNUSED markers to local variables in theory_arith.cpp that are used only in assertions-enabled builds (and thus give warnings in production builds). This was briefly discussed at the meeting this week.
2012-06-28fix a link error on church, due to Antlr #defining "true" and "false" :-( ↵smtcomp2012-resubmissionMorgan Deters
--for now, just #undef them after the #include
2012-06-22TPTP: add parser for cnf and fofFrançois Bobot
- include directive works - no keyword : 'fof', 'cnf', ... can be used for symbols name - real -> unsorted -> real (for the one that appear, so no bijection bitween real and unsorted) - same thing for string But: - string not distinct by projection to real, not sure if the current state of string theory make them distinct - filtering in include is not done - the result is not printed in the TPTP way (currently SMT2 way)
2012-06-22parser: add some acces function and recover the original nextToken from antlr3François Bobot
in order to be able to use the stack of streams.
2012-06-22fix : function AntlrInput::tokenTextSubstrFrançois Bobot
2012-06-22Parser: add the possibility to bind at level 0.François Bobot
2012-06-18fixed smt version 1 parser for quantifiersAndrew Reynolds
2012-06-13Don't use the "inlined" feature of ANTLR 3.2, which causes a buffer overflow ↵Morgan Deters
condition when reading from stdin. This should completely resolve bug #319. However, on large inputs especially (like the stp/testcase benchmarks), this inlining feature can speed parsing by 5-10%, at the cost of not supporting interactive sessions on stdin (like in the SMT-COMP application track). So I updated the submission script and competition build so that * a competition build with antlr-inlining is built for the main and parallel tracks * a competition build without antlr-inlining is built for the application track Again, the effect is only when reading the stdin stream (but that's how SMT-COMP works). For normal (non-competition) builds, we need to support interactive sessions (from e.g. KIND) on stdin, so this inlining is off for all builds except main- and parallel-track competition builds. Also added a "get-antlr-3.4" script that automatically downloads and locally installs a copy of libantlr3c and the antlr parser generator inside the CVC4 source tree. Closing bug #319.
2012-06-12Fix to SMT-LIBv1 parser: QF_UF declares sort "U", but other *UF* logics do ↵Morgan Deters
not (e.g. QF_UFLIA). Also fix a syntax error in a regression test (CVC4 is too lenient to catch it though---CVC3 tripped over it). Also add additional parts for "make submission" in the top-level makefile
2012-06-11Merge from quantifiers2-trunkmerge branch.Morgan Deters
Adds TheoryQuantifiers and TheoryRewriteRules, QuantifiersEngine, and other infrastructure. Adds theory instantiators to many theories. Adds the UF strong solver.
2012-06-08Fix SMT-LIBv2 ALL_SUPPORTED logic inference (by inferring it earlier).Morgan Deters
2012-06-07LogicInfo locking implemented, and some initialization-order issues in ↵Morgan Deters
SmtEngine resolved. ALL_SUPPORTED and QF_ALL_SUPPORTED logics now supported by SMT-LIB parsers. In SMT-LIBv2, if a (set-logic..) command is missing, ALL_SUPPORTED is assumed, and a warning is issued, as discussed on the cvc4-devel mailing list.
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-06-04Added preprocessing pass that propagates unconstrained values - solves all ofClark Barrett
the unconstrained examples in QF_AUFBV/brummayerbiere3 - should also help generally on at least BV and maybe others. Off by default for now - results are mixed and it's hard to evaluate with so many existing assertion failures and segfaults - will re-evaluate once those are fixed
2012-05-15This commit removes the CONST_INTEGER kind from nodes. This code comes from ↵Tim King
the branch arithmetic/remove_const_int.
2012-05-15removing all extended commands (as inspired by the Z3 extended command set) ↵Morgan Deters
except for declare-datatypes
2012-05-15Fix QF_AUFLIA (resolves bug #331).Morgan Deters
2012-05-03Some cleanup starting off from trying to understand the sharing code. ↵Dejan Jovanović
Changes include * fixed term visitor from the bvprop branch * removed all the warnings from builds -- warnings are there to be noted *NOT* to be used as scribbles * moved the LogicInfo into the theory constructor
2012-04-27fix parser logic-handling oversights: QF_UFBV should now be supportedMorgan Deters
2012-04-11merge from arrays-clark branchMorgan Deters
2012-04-06* Fix ITEs and functions in CVC language printer.Morgan Deters
* Permit "BOOL = BOOL" in CVC language parser (auto-replaced with IFF internally, except in strict mode). * SExpr atoms now can be string-, integer-, or rational-valued. * SmtEngine::setInfo(":status", ...) now properly dumps a SetBenchmarkStatusCommand rather than a SetInfoCommand. * Some dumping fixes (resolves bug 313)
2012-03-21Disable nonclausal simplification for QF_SAT benchmarks by default.Morgan Deters
(Can be overridden with --simplification=batch, for example.)
2012-03-09fix a "lost command" bug and associated memory leak in SMT-LIBv1 parser due ↵Morgan Deters
to an out-of-place parenthesis
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-20portfolio mergeMorgan Deters
2012-01-17updates to smt2 parser to support datatypes, minor updates to datatypes ↵Andrew Reynolds
theory/rewriter to support datatypes with non-datatype subdata
2011-12-14minor fixes to printing and parsing of CVC-language defined functions and ↵Morgan Deters
lambdas; resolves bug 294
2011-12-02Error detection is different now---with new Command infrastructure, ↵Morgan Deters
exceptions are not thrown outside the library. Reflect this in the exit code of the driver. Fixes a bug found by Tim among the nightly regressions. Also improved error reporting if antlr is unavailable and the parsers need to be generated.
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-11-16Addressed many of the concerns raised in the public interface review of CVC4 ↵Morgan Deters
Datatypes (bug #283) by Chris Conway. Thanks, Chris!
2011-11-02Sometimes antlr decides to generate lexers and parsers in a different ↵Morgan Deters
directory than specified by "-o dir" ?! Fix that by specifying "-fo dir".
2011-11-01Improvements to header installation on user machines. Internally, we canMorgan Deters
still write, for example: #include "expr/node.h" but public CVC4 headers, upon installation to /usr/include/cvc4 (or wherever), have such #includes rewritten automatically to: #include <cvc4/expr/node.h>
2011-10-29Support for SMT-LIBv2 (get-proof), CVC-style DUMP_PROOF command, ↵Morgan Deters
SmtEngine::getProof(), a few other things..
2011-10-28* ability to output NodeBuilders without first converting them to ↵Morgan Deters
Nodes---useful for debugging. * language-dependent Node::toString() * some minor proof-related cleanup
2011-10-21some printing and parser fixes for problems recently uncoveredMorgan Deters
2011-10-20add support for QF_AUFLIA and QF_AUFLIRA logic strings in SMT inputs, for ↵Morgan Deters
testing
2011-10-19Adding support for QF_UFLIA to the smt2 parser.Tim King
2011-10-04cvc3 compatibility layer; and another libantlr3c v3.4 incompatibility fixMorgan Deters
2011-10-04compat layer cleanupMorgan Deters
2011-10-04oops, one more fix, hopefully the lastMorgan Deters
2011-10-04Oh, here's another cute compatibility fix for libantlr3c 3.4-beta4. They ↵Morgan Deters
#define true and false to their own ANTLR3_TRUE and ANTLR3_FALSE, wreaking havoc on our parsers. I'm really fed up with this package.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback