summaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2010-05-25Added Rational constructors that only take a numerator. The const char* ↵Tim King
Rational and Integer constructors are now explicit. This means that 'Integer = 3;' and so on are no longer permitted. This closes bug 121.
2010-05-12Adding class Smt2 to handle declaration of logic and theory symbolsChristopher L. Conway
2010-05-07make CVC4::Rational public (fixes broken build)Morgan Deters
2010-05-06Adding --strict-parsing optionChristopher L. Conway
2010-05-06Adding tests for Rational::fromDecimalChristopher L. Conway
2010-05-06Adding bit-vector constants in SMT2Christopher L. Conway
2010-05-06Implementing Rational::fromDecimal and adding support for real constants in ↵Christopher L. Conway
SMT parsers
2010-05-05changing the interface to bit-vector constant constructorDejan Jovanović
2010-05-05bit-vector constant constructor from stringDejan Jovanović
2010-05-04Disabling semantic checks in competition mode.Christopher L. Conway
Adding function debugTagIsOn to safely test for tracing in any compilation mode. Removing irrelevant command-line options from usage message in muzzled mode.
2010-05-04Adding general support for SMT2 set-info commandChristopher L. Conway
2010-05-04Type-checking classes and hooks (not tested yet).Dejan Jovanović
2010-05-02smt parser for bit-vectorsDejan Jovanović
2010-04-29Added the capability to construct expressions by passing the operator ↵Dejan Jovanović
instead of the kind, i.e. Expr op = ..."f"... em.mkExpr(op, children); Operator kinds are automatically associated with the enclosing expression kind in the DSL and generated.
2010-04-28Merging the arithmetic theory draft (lra-init) back into the main trunk. ↵Tim King
This should not affect other parts of the system. This code is untested, and is volatile. It is going to be improved in the future so don't pick on it too much. I am merging this code in its current state back into the main trunk because it was getting unruly to keep merging the updated trunk back into the branch.
2010-04-14Marging from types 404:415, changes: MassiveDejan Jovanović
* Types are now represented as nodes in the attribute table and are managed, i.e. you can say Type booleanType = d_nodeManager->booleanType(); Type t = d_nodeManager->mkFunctionType(booleanType, booleanType); FunctionType ft = (FunctionType)t; Assert(ft.getArgTypes()[0], booleanType); * The attributes now have a table for Nodes and a table for TNodes (both should be used with caution) * Changes the way nodes are extracted from NodeBuilder, added several methods to extract a Node, NodeValue, or Node*, with corresponding methods for extraction * Used the above in the construction of Expr and Type objects * The NodeManager now destroys the attributes in the destructor by pausing the garbage collection * To achive destruction a flag d_inDesctruction has been added to loosen the assertion in NodeValue::dec() (there might be -refcount TNodes leftover) * Beginnings of the Bitvector constants using GMP Not yet in tiptop phase, needs more documentation, and Types should be pulled out to TypeNodes eventually. Also, the types are currently defined in the builting_kinds, and I need to add these to the theory specific definitions with special 'type' constructs. I hate branching and merging.
2010-04-09added experimental "make lcov" target (it runs only unit tests); better ↵Morgan Deters
coverage for util and context classes; implemented some output functionality that was missing; reclassified some tests white -> black or black -> public; other minor fixes
2010-04-04* Node::isAtomic() now looks at an "atomic" attribute of argumentsMorgan Deters
instead of assuming it's atomic based on kind. Atomicity is determined at node building time. Fixes bug #81. If this is determined to make node building too slow, we can allocate another attribute "AtomicHasBeenComputed" to lazily compute atomicity. * TheoryImpl<> has gone away. Theory implementations now derive from Theory directly and share a single RegisteredAttr attribute for term registration (which shouldn't overlap: every term is "owned" by exactly one Theory). Fixes bug #79. * Additional atomicity tests in ExprBlack unit test. * More appropriate whitebox testing for attribute ID assignment (AttributeWhite unit test). * Better (and more correct) assertion checking in NodeBuilderBlack. * run-regression script now checks exit status against what's provided in "% EXIT: " gesture in .cvc input files, and stderr against "% EXPECT-ERROR: ". These can be used to support intended failures. Fixes bug #84. Also add "% EXIT: " gestures to all .cvc regressions in repository. * Solved some "control reaches end of non-void function" warnings in src/parser/bounded_token_buffer.cpp by replacing "AlwaysAssert(false)" with "Unreachable()" (which is known statically to never return normally). * Regression tests now use the cvc4 binary under builds/$(CURRENT_BUILD)/src/main instead of the one in bin/ which may not be properly installed yet at that point of the build. (Partially fixes bug #46.) * -fvisibility=hidden is now included by configure.ac instead of each Makefile.am, which will make it easier to support platforms (e.g. cygwin) that do things a different way. * TheoryUF code formatting. (re: my code review bug #64) * CDMap<> is leaking memory again, pending a fix for bug #85 in the context subsystem. (To avoid serious errors, can't free context objects.) * add ContextWhite unit test for bug #85 (though it's currently "defanged," awaiting the bugfix) * Minor documentation, other cleanup.
2010-04-01reran update-copyright.pl to get new contributors and add new header ↵Morgan Deters
comments to files without them
2010-04-01PARSER STUFF:Morgan Deters
* Other minor changes to the new parser to match coding guidelines, add documentation, .... * Add CFLAGS stuff to configure.ac parser Makefile.ams. This ensures that profiling, coverage, optimization, debugging, and warning level options will apply to the new parser as well (which is in C, not C++). This fixes the deprecated warning we were seeing this evening. * Now, if you have ANTLR_HOME set in your environment, you don't need to specify --with-antlr-dir to ./configure or have libantlr3c installed in standard places. --with-antlr-dir still overrides $ANTLR_HOME, and if the installation in $ANTLR_HOME is missing or doesn't work, the standard places are still tried. * Extend "silent make" to new parser stuff. * Added src/parser/bounded_token_buffer.{h,cpp} to the list of exclusions in contrib/update-copyright.pl and mention them as excluded from CVC4 copyright in COPYING. They are antlr3-derived works, covered under a BSD license. OTHER STUFF: * expr_manager.h, expr.h, expr_manager.cpp, and expr.cpp are now auto-generated by a "mkexpr" script. This provides the correct instantiations of mkConst() for public use, e.g., by the parser. * Fix doxygen documentation in expr, expr_manager.. closes bug #35 * Node::isAtomic() implemented in a better way, based on theory kinds files. Fixes bug #40. To support this, a "nonatomic_operator" command has been added. All other "parameterized" or "operator" kinds are atomic. * Added expr_black test * Remove kind::TRUE and kind::FALSE and make a new CONST_BOOLEAN kind that takes a "bool" payload; for example, to make "true" you now do nodeManager->mkConst(true). * Make new "cvc4_public.h" and "cvc4parser_public.h" headers. Private headers should include "cvc4_private.h" (resp. "cvc4parser_private.h"), which existed previously. Public headers should include the others. **No one** should include the autoheader #include (which has been renamed "cvc4autoconfig.h") directly, and public CVC4 headers can't access its #defines. This is to avoid us having the same distribution problem as libantlr3c. * Preliminary fixes based on Tim's code review of attributes (bug #61). This includes splitting hairy template internals into attribute_internals.h, for which another code review ticket will be opened. Bug is still outstanding, but pending further refactoring/documentation. * Some *HashFcns renamed to *HashStrategy to match refactoring done elsewhere (done by Chris?) earlier this week. * Simplified creation of make rules for generated files (expr.cpp, expr.h, expr_manager.cpp, expr_manager.h, theoryof_table.h, kind.h, metakind.h). * CVC4::Configuration interface and implementation split (so private stuff doesn't leak into public headers). * Some documentation/code formatting fixes. * Add required versions of autotools to autogen.sh. * src/expr/mkmetakind: fix a nonportable thing in invocation of "expr" that was causing warnings on Red Hat. * src/context/cdmap.h: add workaround to what appears to be a g++ 4.1 parsing bug.
2010-03-30Removing unnecessary .gitignoresChristopher L. Conway
2010-03-30Merging from branches/antlr3 (r246:354)Christopher L. Conway
2010-03-30Highlights of this commit are:Morgan Deters
* add NodeManagerWhite unit test * change kind::APPLY to kind::APPLY_UF * better APPLY handling: operators are no longer considered children * more efficient pool lookup; the NodeValue doesn't have to be as fully constructed for the lookup to proceed * extend DSL for kind declarations + new "theory" command declares a theory and its header. theory_def.h no longer required. + arity enforced on operators + constant mapping, hashing, equality * CONSTANT metakinds supported (via Node::getConst<T>(), for example, Node::getConst<CVC4::Rational>() gets a Rational out of a Node (assuming it is of CONST_RATIONAL kind) * added CONST_RATIONAL and CONST_INTEGER kinds * builtin operators (AND, OR, PLUS, etc..) returned by Node::getOperator() are now CONSTANT metakind and are created by NodeManager * Pretty-printing of Nodes now has a depth limit settable by a stream manipulator (e.g. "cout << Node::setdepth(5) << m << endl;" prints DAG rooted at m to a depth of 5) * getters added to Node, TNode, NodeValue, etc., for operators and metakinds * build-time generators for kind.h, metakind.h, and theoryof_table.h headers now have a simpler design and flag errors better, and the templates (kind_template.h etc.) are easier to understand. * DISTINCT is now a kind, and the SMT parser now passes through DISTINCT nodes instead of blowing them up into ANDs. Until theory rewriting is online, though, DISTINCTs are directly blown up into conjunctions in TheoryEngine::rewrite(). * add gmpxx detection and inclusion * better Asserts throughout, some documentation, cleanup
2010-03-28Improved the documentation and testing for Rational.Tim King
2010-03-26Added GMP backed Rational and Integer classes, and white box tests for them. ↵Tim King
You may have to reconfigure after this update.
2010-03-16* test/unit/Makefile.am, test/unit/expr/attribute_white.h,Morgan Deters
test/unit/expr/node_white.h: add whitebox attribute test (pulled out attribute stuff from node_white) * test/unit/parser/parser_black.h: fix memory leaks uncovered by valgrind * src/theory/interrupted.h: actually make this "lightweight" (not derived from CVC4::Exception), as promised in my last commit * src/theory/uf/theory_uf.h, test/unit/expr/attribute_black.h: match the new-style cleanup function definition * src/expr/attribute.cpp, src/expr/attribute.h: support for attribute deletion, custom cleanup functions, clearer cleanup function definition. * src/expr/node_manager.h, src/expr/node_manager.cpp: reclaim remaining zombies in dtor, rename NodeValueSet ==> "NodeValuePool", and enable freeing of NodeValues * src/expr/type.h, src/expr/type.cpp: reference-counting for types, customized cleanup function for types, also code cleanup * (various): changed "const Type*" to "Type*" (to enable reference-counting etc. Types are still immutable.) * src/util/output.h: add ::isOn()-- which queries whether a Debug/Trace flag is currently on or not. * src/smt/smt_engine.cpp, src/parser/antlr_parser.cpp, src/expr/type.cpp, src/expr/expr_manager.cpp, various others: minor code cleanup
2010-03-15This checkin resolves bug #57.Morgan Deters
* CVC4::theory::Interrupted no longer derives CVC4::Exception. * Interrupted is only thrown if "safe" parameter is TRUE ! * UF returns one conflict (instead of waiting for Interrupted to be thrown). * Minor build system work (quieter builds if V=0, better handling of build profiles in configure)
2010-03-12* Added shutdown() functions to SmtEngine, TheoryEngine, PropEngine,Morgan Deters
DecisionEngine, and Theory. These are triggered from the SmtEngine dtor before the other engines are deleted. This is important because of potential issues with outstanding TNodes in Theory implementations (which fail if the destruction is done in the wrong order, in certain cases). * Favor "FactQueueResetter" instead of clearAssertionQueues() for resetting facts queue in Theory implementations. * Better theory-rewriting code. * Minor cleanups.
2010-03-08This fixes regressions at levels >= 1 which were failingMorgan Deters
* implement zombification and garbage collection of NodeValues (but GC not turned on yet) * implement removal of key nodes from all attribute tables * audit NodeBuilder and fix memory leaks and improper reference-count management. This is in many places a re-write. Clearly documented invariants on NodeBuilder state. (Closes Bug 38) * created a "BackedNodeBuilder" that can be used to construct NodeBuilders with a stack-based backing store for a size that's not a compile-time constant. * NodeValues no longer depend on Node for toStream()'ing * make unit test-building "silent" with --enable-silent-rules * (Makefile.am, Makefile.builds.in) fix top-level build system so that "make regressN" works with unbuilt/out-of-date source trees in the expected way. * (various) code cleanup, documentation, formatting
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
2010-03-02* NodeBuilder work: specifically, convenience builders. "a && b && c || d && e"Morgan Deters
(etc.) now work for Nodes a, b, c, d, e. Also refcounting fixes for NodeBuilder in certain cases * (various places) don't overload __gnu_cxx::hash<>, instead provide an explicit hash function to hash_maps and hash_sets. * add a new kind of assert, DtorAssert(), which doesn't throw exceptions (right now it operates like a usual C assert()). For use in destructors. * don't import NodeValue into CVC4 namespace (leave under CVC4::expr::). * fix some Make rule dependencies * reformat node.h as per code formatting policy * added Theory and NodeBuilder unit tests
2010-02-27Adding --mmap option to use memory-mapped file input, which provides a ↵Christopher L. Conway
marginal improvement (<5%) on big benchmarks.
2010-02-26* test/unit/context/context_black.h: Test CDList<>. In particular,Morgan Deters
test behavior of grow(), which was previously very broken, fixed by Tim earlier this afternoon. * add the notion of a "private header". Private header files (those not intended for distribution) should now #include "cvc4_private.h" (or "cvc4parser_private.h" for the parser code). When not actually building libcvc4 (resp. libcvc4parser), or associated unit tests, a warning is emitted by the preprocessor. This should make it easier to notice (and disentangle early) any unwanted public/private mixing. Currently the warning identifies a couple places where we need to fix things. * added directory infrastructure for arrays and BV theories. * the Theory inheritance hierarchy makes some assumptions about the way inheritance is done. These are checked at runtime when CVC4_ASSERTIONS is on. See src/theory/theory.h's TheoryImpl<> definition for details. * src/theory/booleans/theory_bool.h, src/theory/booleans/theory_def.h, src/theory/arith/theory_arith.h, src/theory/arith/theory_def.h, src/theory/uf/theory_uf.h, src/theory/uf/theory_def.h, src/parser/antlr_parser.h: minor code formatting fixes as per policy. * src/theory/uf/theory_uf.cpp: fix for non-debug builds. * src/util/options.h, src/util/model.h, src/util/result.h, src/expr/type.h: make CVC4_PUBLIC. * src/util/decision_engine.h: no longer CVC4_PUBLIC. * src/expr/expr_manager.cpp: ExprManager::booleanType() and ExprManager::kindType() weren't returning a value ?! Fixed. * src/expr/expr_manager.h, src/expr/node_manager.h: ExprManager no longer depends on NodeManager (public/private interface mixing). ExprManagerScope is an internal implementation detail, and is moved to node_manager.h. * src/expr/node.h: mark gdb debug routines as "used" so that GCC always emits code for them (even though its static analysis shows they're unused).
2010-02-22* configure.ac: Remove doc/ from search path for Makefile.amsMorgan Deters
* configure.ac, test/unit/Makefile.am: Resolved an issue where even when not testing, one unit test was built. * Re-ran contrib/update-copyright.pl on all source files to ensure consistent and correct header comments. * contrib/get-authors: Change definition of "minor contributor" to >= 10% of lines (rather than strictly greater than 10% of lines)
2010-02-22fix bug 22 (remove tracing from non-trace builds; remove all outputMorgan Deters
from muzzled builds) add public-facing CVC4::Configuration class that gives CVC4's (static) configuration (whether debugging is enabled, assertions, version information, etc...) add some whitebox tests for assertions, output classes, and new CVC4::Configuration class main driver now gets about() information from CVC4::Configuration. configure.ac now more flexible at specifying major/minor/release versions of CVC4 add --show-config option that dumps CVC4's static configuration commented option processing strings in src/main/getopt.cpp fixed some compilation problems for muzzled builds. fixed some test code for non-assertion builds (where no assertions are expected)
2010-02-19specialized implementation for boolean node attributes ("flags"): they now ↵Morgan Deters
share memory words properly; also, implementations of some output functionality
2010-02-18Adding --no-checking option to disable semantic checks in parserChristopher L. Conway
2010-02-16Adding --parse-only optionChristopher L. Conway
2010-02-12build fixDejan Jovanović
2010-02-12Fix to compile out Debug(...) << ... statements in optimized mode. Someone ↵Dejan Jovanović
please look to see if it makes sense.
2010-02-04minor interface changes to TheoryEngine/Theory after meeting and ↵Morgan Deters
conversation with Tim
2010-02-04remove -*- c++ -*- emacs tag from source files (it overrides ↵Morgan Deters
cvc4-c++-editing-mode from contrib/editing-with-emacs
2010-02-04minor cleanup; give the main driver a different exit code for ↵Morgan Deters
SAT-INVALID/UNSAT-VALID
2010-02-04src/expr/kind.h is now automatically generated.Morgan Deters
Build src/expr before src/util. Moved CVC4::Command to the expr package. Re-quieted the "result is sat/invalid" etc. from PropEngine (this is now done at the main driver level). Added file-level documentation to Antlr sources When built for debug, spin on SEGV instead of aborting. Really useful for debugging problems that crop up only on long runs. Added '--segv-nospin' to override this spinning so that "make check," nightly regressions, etc. don't hang when built with debug. Updated src/main/about.h for 2010.
2010-02-04minor fix for update-copyright.pl; ran update-copyright.pl on all sources; ↵Morgan Deters
regenerated configure script
2010-02-03Addressed many of the concerns of bug 10 (build system code review).Morgan Deters
Some parts split into other bugs: 19, 20, 21. Addressed concerns of bug 11 (util package code review). Slight parser source file modifications: file comments, #included headers in generated parsers/lexers Added CVC4::Result propagation back through MiniSat->PropEngine->SmtEngine->main(). Silenced MiniSat when verbosity is not requested.
2010-02-03ELSEIF support and parser debugging with '-d parser'Dejan Jovanović
2010-02-03simple ITE parsingDejan Jovanović
2010-02-02Switched cnf conversion to go through CnfStream.Tim King
2010-01-30cnf conversion (variable-introducing), cleanups, fixes to minisat calling ↵Morgan Deters
for multiple-query cases
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback