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.
.PHONY: test
test: check
-.PHONY: doc
+.PHONY: doc doc-internals
doc: doc-builds
+doc-internals: doc-internals-builds
.PHONY: examples
examples: all
@SET_MAKE@
# Set up some basic autoconf make vars
+srcdir = @srcdir@
+builddir = @builddir@
install_sh = @install_sh@
mkinstalldirs = $(install_sh) -d
exec_prefix = @exec_prefix@
.PHONY: doc-builds doc-prereq
doc-builds: doc-prereq
- +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc)
+ +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="`builddir="$(builddir)" srcdir="$(srcdir)" "$(srcdir)/doc/find_public_interface.sh"`")
+doc-internals-builds: doc-prereq
+ +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="$(srcdir)/src src")
doc-prereq:
+(cd $(CURRENT_BUILD) && for dir in `find . -name Makefile | xargs grep -l BUILT_SOURCES`; do (cd `dirname "$$dir"`; (cat Makefile; echo 'doc-prereq: $$(BUILT_SOURCES)') | $(MAKE) -f- doc-prereq); done)
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = $(SRCDIR)/src \
- src
+INPUT = $(CVC4_DOXYGEN_INPUT)
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
--- /dev/null
+#!/bin/bash
+#
+# Enumerates public interface headers, so that public-only documentation
+# can be produced.
+#
+
+cd "$(dirname "$0")"
+
+echo -n "\"$srcdir/src/include/cvc4.h\" "
+echo -n "\"$srcdir/src/include/cvc4_public.h\" "
+( (find "$builddir" -name '*.h' | xargs grep -l '^# *include *"cvc4.*_public\.h"'); \
+ (find "$srcdir" -name '*.h' | xargs grep -l '^# *include *"cvc4.*_public\.h"'); \
+) | \
+while read f; do
+ if expr "$f" : ".*_\(template\|private\|test_utils\)\.h$" &>/dev/null; then
+ continue
+ fi
+ echo -n "\"$f\" "
+done
+
#include "util/exception.h"
#include "util/language.h"
#include "util/hash.h"
+#include "util/options.h"
// This is a hack, but an important one: if there's an error, the
// compiler directs the user to the template file instead of the
// generated one. We don't want the user to modify the generated one,
// since it'll get overwritten on a later build.
-#line 45 "${template}"
+#line 46 "${template}"
namespace CVC4 {
long& l = out.iword(s_iosIndex);
if(l == 0) {
// set the default print depth on this ostream
- l = s_defaultPrintDepth;
+ if(Options::current() != NULL) {
+ l = Options::current()->defaultExprDepth;
+ }
+ if(l == 0) {
+ l = s_defaultPrintDepth;
+ }
}
return l;
}
/**
* The default language to use, for ostreams that haven't yet had a
- * setlanguage() applied to them.
+ * setlanguage() applied to them and where the current Options
+ * information isn't available.
*/
- static const int s_defaultLanguage = language::output::LANG_AST;
+ static const int s_defaultOutputLanguage = language::output::LANG_AST;
/**
* When this manipulator is used, the setting is stored here.
if(l == 0) {
// set the default language on this ostream
// (offset by one to detect whether default has been set yet)
- l = s_defaultLanguage + 1;
+ if(Options::current() != NULL) {
+ l = Options::current()->outputLanguage + 1;
+ }
+ if(l <= 0 || l > language::output::LANG_MAX) {
+ // if called from outside the library, we may not have options
+ // available to us at this point (or perhaps the output language
+ // is not set in Options). Default to something reasonable.
+ l = s_defaultOutputLanguage + 1;
+ }
}
return OutputLanguage(l - 1);
}
${getConst_instantiations}
-#line 946 "${template}"
+#line 961 "${template}"
namespace expr {
if(! tn.isPredicateLike() ||
tn.getArgTypes().size() != 1) {
std::stringstream ss;
- ss << Expr::setlanguage(Options::current()->outputLanguage)
- << "expected a predicate of one argument to define predicate subtype, but got type `" << tn << "'";
+ ss << "expected a predicate of one argument to define predicate subtype, but got type `" << tn << "'";
throw TypeCheckingExceptionPrivate(lambdan, ss.str());
}
if(! tn.isPredicateLike() ||
tn.getArgTypes().size() != 1) {
std::stringstream ss;
- ss << Expr::setlanguage(Options::current()->outputLanguage)
- << "expected a predicate of one argument to define predicate subtype, but got type `" << tn << "'";
+ ss << "expected a predicate of one argument to define predicate subtype, but got type `" << tn << "'";
throw TypeCheckingExceptionPrivate(lambdan, ss.str());
}
#line 72 "${template}"
default: {
std::stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage
- ( Options::current()->inputLanguage ));
ss << "A theory kinds file did not provide a cardinality "
<< "or cardinality computer for type:\n" << typeNode
<< "\nof kind " << k;
inline bool isWellFounded(TypeConstant tc) {
switch(tc) {
${type_constant_wellfoundednesses}
-#line 88 "${template}"
+#line 86 "${template}"
default: {
std::stringstream ss;
ss << "No well-foundedness status known for type constant: " << tc;
case TYPE_CONSTANT:
return isWellFounded(typeNode.getConst<TypeConstant>());
${type_wellfoundednesses}
-#line 103 "${template}"
+#line 101 "${template}"
default: {
std::stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage
- ( Options::current()->inputLanguage ));
ss << "A theory kinds file did not provide a well-foundedness "
<< "or well-foundedness computer for type:\n" << typeNode
<< "\nof kind " << k;
inline Node mkGroundTerm(TypeConstant tc) {
switch(tc) {
${type_constant_groundterms}
-#line 119 "${template}"
+#line 115 "${template}"
default: {
std::stringstream ss;
ss << "No ground term known for type constant: " << tc;
case TYPE_CONSTANT:
return mkGroundTerm(typeNode.getConst<TypeConstant>());
${type_groundterms}
-#line 134 "${template}"
+#line 130 "${template}"
default: {
std::stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage
- ( Options::current()->inputLanguage ));
ss << "A theory kinds file did not provide a ground term "
<< "or ground term computer for type:\n" << typeNode
<< "\nof kind " << k;
}
}
- // Create the expression manager
- ExprManager exprMgr(options);
-
- // Create the SmtEngine
- SmtEngine smt(&exprMgr);
-
- // signal handlers need access
- pStatistics = smt.getStatisticsRegistry();
-
// Auto-detect input language by filename extension
const char* filename = inputFromStdin ? "<stdin>" : argv[firstArgIndex];
- // Timer statistic
- RegisterStatistic statTotalTime(exprMgr, &s_totalTime);
-
- // Filename statistics
- ReferenceStat< const char* > s_statFilename("filename", filename);
- RegisterStatistic statFilenameReg(exprMgr, &s_statFilename);
-
if(options.inputLanguage == language::input::LANG_AUTO) {
if( inputFromStdin ) {
// We can't do any fancy detection on stdin
<< Expr::printtypes(false);
}
+ // important even for muzzled builds (to get result output right)
+ *options.out << Expr::setlanguage(options.outputLanguage);
+
+ // Create the expression manager
+ ExprManager exprMgr(options);
+
+ // Create the SmtEngine
+ SmtEngine smt(&exprMgr);
+
Parser* replayParser = NULL;
if( options.replayFilename != "" ) {
ParserBuilder replayParserBuilder(&exprMgr, options.replayFilename, options);
*options.replayLog << Expr::setlanguage(options.outputLanguage) << Expr::setdepth(-1);
}
- // important even for muzzled builds (to get result output right)
- *options.out << Expr::setlanguage(options.outputLanguage);
+ // signal handlers need access
+ pStatistics = smt.getStatisticsRegistry();
+
+ // Timer statistic
+ RegisterStatistic statTotalTime(exprMgr, &s_totalTime);
+
+ // Filename statistics
+ ReferenceStat< const char* > s_statFilename("filename", filename);
+ RegisterStatistic statFilenameReg(exprMgr, &s_statFilename);
// Parse and execute commands until we are done
Command* cmd;
i != i_end;
++i) {
PARSER_STATE->checkDeclaration(*i, CHECK_UNDECLARED, SYM_VARIABLE);
- Expr func = EXPR_MANAGER->mkVar(*i, f.getType());
+ Expr func = EXPR_MANAGER->mkVar(*i, t);
PARSER_STATE->defineFunction(*i, f);
Command* decl = new DefineFunctionCommand(*i, func, f);
seq->addCommand(decl);
)
;
+// these empty fragments remove "no lexer rule corresponding to token" warnings
+fragment INTEGER_LITERAL:;
+fragment DECIMAL_LITERAL:;
+fragment DOT:;
+fragment DOTDOT:;
+
/**
* Matches the hexidecimal digits (0-9, a-f, A-F)
*/
#include "util/integer.h"
#include "util/output.h"
#include "util/rational.h"
+#include "util/hash.h"
#include <vector>
+#include <set>
+#include <string>
+#include <sstream>
using namespace CVC4;
using namespace CVC4::parser;
std::string attr;
Expr attexpr;
std::vector<Expr> attexprs;
+ std::hash_set<std::string, StringHashFunction> names;
+ std::vector< std::pair<std::string, Expr> > binders;
}
: /* a built-in operator application */
LPAREN_TOK builtinOp[kind] termList[args,expr] RPAREN_TOK
| /* a let binding */
LPAREN_TOK LET_TOK LPAREN_TOK
{ PARSER_STATE->pushScope(); }
- ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[expr, f2] RPAREN_TOK
- { PARSER_STATE->defineVar(name,expr); } )+
+ ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK
+ // this is a parallel let, so we have to save up all the contributions
+ // of the let and define them only later on
+ { if(names.count(name) == 1) {
+ std::stringstream ss;
+ ss << "warning: symbol `" << name << "' bound multiple times by let; the last binding will be used, shadowing earlier ones";
+ PARSER_STATE->warning(ss.str());
+ } else {
+ names.insert(name);
+ }
+ binders.push_back(std::make_pair(name, expr)); } )+
+ { // now implement these bindings
+ for(std::vector< std::pair<std::string, Expr> >::iterator i = binders.begin(); i != binders.end(); ++i) {
+ PARSER_STATE->defineVar((*i).first, (*i).second);
+ }
+ }
RPAREN_TOK
term[expr, f2]
RPAREN_TOK
#include "theory/rewriter.h"
#include "expr/expr_stream.h"
#include "decision/decision_engine.h"
-
+#include "util/lemma_input_channel.h"
+#include "util/lemma_output_channel.h"
namespace CVC4 {
namespace prop {
Type formulaType = formula.getType(Options::current()->typeChecking);
Type funcType = func.getType();
- Type rangeType = funcType.isFunction() ?
- FunctionType(funcType).getRangeType() : funcType;
- if(formulaType != rangeType) {
- stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage))
- << "Defined function's declared type does not match that of body\n"
- << "The function : " << func << "\n"
- << "Its range type: " << rangeType << "\n"
- << "The body : " << formula << "\n"
- << "Body type : " << formulaType;
- throw TypeCheckingException(func, ss.str());
+ // We distinguish here between definitions of constants and functions,
+ // because the type checking for them is subtly different. Perhaps we
+ // should instead have SmtEngine::defineFunction() and
+ // SmtEngine::defineConstant() for better clarity, although then that
+ // doesn't match the SMT-LIBv2 standard...
+ if(formals.size() > 0) {
+ Type rangeType = FunctionType(funcType).getRangeType();
+ if(formulaType != rangeType) {
+ stringstream ss;
+ ss << "Type of defined function does not match its declaration\n"
+ << "The function : " << func << "\n"
+ << "Declared type : " << rangeType << "\n"
+ << "The body : " << formula << "\n"
+ << "Body type : " << formulaType;
+ throw TypeCheckingException(func, ss.str());
+ }
+ } else {
+ if(formulaType != funcType) {
+ stringstream ss;
+ ss << "Declared type of defined constant does not match its definition\n"
+ << "The constant : " << func << "\n"
+ << "Declared type : " << funcType << "\n"
+ << "The definition : " << formula << "\n"
+ << "Definition type: " << formulaType;
+ throw TypeCheckingException(func, ss.str());
+ }
}
TNode funcNode = func.getTNode();
vector<Node> formalsNodes;
for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) {
Assert(Rewriter::rewrite(d_assertionsToPreprocess[i]) == d_assertionsToPreprocess[i]);
Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): asserting " << d_assertionsToPreprocess[i] << endl;
- d_propagator.assert(d_assertionsToPreprocess[i]);
+ d_propagator.assertTrue(d_assertionsToPreprocess[i]);
}
Trace("simplify") << "SmtEnginePrivate::nonClausalSimplify(): "
// well-typed, and we don't want the C++ runtime to abort our
// process without any error notice.
stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage))
- << "A bad expression was produced. Original exception follows:\n"
+ ss << "A bad expression was produced. Original exception follows:\n"
<< tcep;
InternalError(ss.str().c_str());
}
Type boolType = d_exprManager->booleanType();
if(type != boolType) {
stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage))
- << "Expected " << boolType << "\n"
+ ss << "Expected " << boolType << "\n"
<< "The assertion : " << e << "\n"
<< "Its type : " << type;
throw TypeCheckingException(e, ss.str());
while(!done()){
Constraint curr = constraintFromFactQueue();
if(curr != NullConstraint){
- bool res = assertionCases(curr);
+ bool res CVC4_UNUSED = assertionCases(curr);
Assert(!res || inConflict());
}
if(inConflict()){ break; }
d_learnedBounds.pop();
Debug("arith::learned") << curr << endl;
- bool res = assertionCases(curr);
+ bool res CVC4_UNUSED = assertionCases(curr);
Assert(!res || inConflict());
if(inConflict()){ break; }
namespace theory {
namespace booleans {
-void CircuitPropagator::assert(TNode assertion)
+void CircuitPropagator::assertTrue(TNode assertion)
{
if (assertion.getKind() == kind::AND) {
for (unsigned i = 0; i < assertion.getNumChildren(); ++ i) {
- assert(assertion[i]);
+ assertTrue(assertion[i]);
}
} else {
// Analyze the assertion for back-edges and all that
{ d_context.pop(); }
/** Assert for propagation */
- void assert(TNode assertion);
+ void assertTrue(TNode assertion);
/**
* Propagate through the asserted circuit propagator. New information discovered by the propagator
for(; argument_it != argument_it_end; ++argument_it, ++argument_type_it) {
if((*argument_it).getType() != *argument_type_it) {
std::stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage));
ss << "argument types do not match the function type:\n"
<< "argument: " << *argument_it << "\n"
<< "has type: " << (*argument_it).getType() << "\n"
if ( TypeNode::leastCommonTypeNode(lhsType, rhsType).isNull() ) {
std::stringstream ss;
- ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage));
ss << "Subtypes must have a common type:" << std::endl;
ss << "Equation: " << n << std::endl;
ss << "Type 1: " << lhsType << std::endl;
bits.push_back(utils::mkBitOf(node, i));
}
- BVDebug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
- BVDebug("bitvector-bb") << " with bits " << toString(bits);
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
+ BVDebug("bitvector-bb") << " with bits " << toString(bits);
+ }
}
void DefaultConstBB (TNode node, Bits& bits, Bitblaster* bb) {
bits.push_back(utils::mkTrue());
}
}
- BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ }
}
}
}
Assert (bits.size() == utils::getSize(node));
- BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ }
}
void DefaultAndBB (TNode node, Bits& bits, Bitblaster* bb) {
shiftAddMultiplier(res, current, newres);
res = newres;
}
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ }
}
void DefaultPlusBB (TNode node, Bits& res, Bitblaster* bb) {
}
}
}
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ }
}
void DefaultLshrBB (TNode node, Bits& res, Bitblaster* bb) {
}
}
}
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ }
}
void DefaultAshrBB (TNode node, Bits& res, Bitblaster* bb) {
}
}
}
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
-
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ }
}
void DefaultExtractBB (TNode node, Bits& bits, Bitblaster* bb) {
}
Assert (bits.size() == high - low + 1);
- BVDebug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
- BVDebug("bitvector-bb") << " with bits " << toString(bits);
-
+ if(Debug.isOn("bitvector-bb")) {
+ BVDebug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
+ BVDebug("bitvector-bb") << " with bits " << toString(bits);
+ }
}
while (d_nodesInserted < d_memory.size()) {
const tree_entry_type& node = d_memory.back();
- BVDebug("cd_set_collection") << "BacktrackableSetCollection::backtrack(): removing " << node.getValue()
- << " from " << internalToString(getRoot(d_memory.size()-1)) << std::endl;
+ if(Debug.isOn("cd_set_collection")) {
+ BVDebug("cd_set_collection") << "BacktrackableSetCollection::backtrack(): removing " << node.getValue()
+ << " from " << internalToString(getRoot(d_memory.size()-1)) << std::endl;
+ }
if (node.hasParent()) {
if (node.isLeft()) {
// Find the biggest node smaleer than value (it must exist)
while (set != null) {
- BVDebug("set_collection") << "BacktrackableSetCollection::getPrev(" << toString(set) << "," << value << ")" << std::endl;
+ if(Debug.isOn("set_collection")) {
+ BVDebug("set_collection") << "BacktrackableSetCollection::getPrev(" << toString(set) << "," << value << ")" << std::endl;
+ }
const tree_entry_type& node = d_memory[set];
if (node.getValue() >= value) {
// If the node is bigger than the value, we need a smaller one
// Find the smallest node bigger than value (it must exist)
while (set != null) {
- BVDebug("set_collection") << "BacktrackableSetCollection::getNext(" << toString(set) << "," << value << ")" << std::endl;
+ if(Debug.isOn("set_collection")) {
+ BVDebug("set_collection") << "BacktrackableSetCollection::getNext(" << toString(set) << "," << value << ")" << std::endl;
+ }
const tree_entry_type& node = d_memory[set];
if (node.getValue() <= value) {
// If the node is smaller than the value, we need a bigger one
backtrack();
Assert(isValid(set));
- BVDebug("set_collection") << "BacktrackableSetCollection::getElements(" << toString(set) << "," << lowerBound << "," << upperBound << ")" << std::endl;
+ if(Debug.isOn("set_collection")) {
+ BVDebug("set_collection") << "BacktrackableSetCollection::getElements(" << toString(set) << "," << lowerBound << "," << upperBound << ")" << std::endl;
+ }
// Empty set no elements
if (set == null) {
{
public:
/** assert that n is true */
- virtual void assert( Node n ) = 0;
+ virtual void assertTrue( Node n ) = 0;
/** get the explanation for n.
This should call pm->setExplanation( n1, jn1, r1 ) ... pm->setExplanation( nk, jnk, rk )
for some set of Nodes n1...nk.
jni is the (at least informal) justification for ni.
- Return value should be a (possibly empty) conjunction of nodes n'1...n'k, where each n'i occurs
(as a conjunct) in jn1...jnk, but not in n1...nk.
- For each of these literals n'i, assert( n'i ) was called.
+ For each of these literals n'i, assertTrue( n'i ) was called.
- either pm->setExplanation( n, ... ) is called, or n is the return value.
*/
virtual Node explain( Node n, ProofManager* pm ) = 0;
}
~CongruenceClosureExplainer(){}
/** assert that n is true */
- void assert( Node n ){
+ void assertTrue( Node n ){
Assert( n.getKind() == kind::EQUAL || n.getKind() == kind::IFF );
d_cc->addEquality( n );
}
~ExplanationManager(){}
/** assert that n is true (n is an input) */
- void assert( Node n ) {
+ void assertTrue( Node n ) {
//TODO: this can be optimized:
// if the previous explanation for n was empty (n is a tautology),
// then we should not claim it to be an input.
}
}
-#endif
\ No newline at end of file
+#endif
if( !hasConflict() ){
if( d_em.hasNode( assertion ) ){
Debug("datatypes") << "Assertion has already been derived" << endl;
- d_em.assert( assertion );
+ d_em.assertTrue( assertion );
} else {
switch(assertion.getKind()) {
case kind::EQUAL:
//setup merge pending list
d_merge_pending.push_back( vector< pair< Node, Node > >() );
- d_cce.assert(eq);
+ d_cce.assertTrue(eq);
d_cc.addTerm(eq[0]);
d_cc.addTerm(eq[1]);
Debug("datatypes-ae") << " Find is " << find( eq[0] ) << " = " << find( eq[1] ) << std::endl;
//merge original nodes
merge( eq[0], eq[1] );
- d_cce.assert(eq);
+ d_cce.assertTrue(eq);
d_cc.addTerm(eq[0]);
d_cc.addTerm(eq[1]);
#else
Debug("datatypes-ae") << " Find is " << find( eq[0] ) << " = " << find( eq[1] ) << std::endl;
merge( eq[0], eq[1] );
if( !hasConflict() ){
- d_cce.assert(eq);
+ d_cce.assertTrue(eq);
d_cc.addTerm(eq[0]);
d_cc.addTerm(eq[1]);
}
#include "expr/node.h"
#include "expr/node_builder.h"
#include "util/options.h"
+#include "util/lemma_output_channel.h"
#include "theory/theory.h"
#include "theory/theory_engine.h"
TypeNode currentArgumentType = *argument_type_it;
if(!currentArgument.isSubtypeOf(currentArgumentType)) {
std::stringstream ss;
- ss << Expr::setlanguage(Options::current()->outputLanguage)
- << "argument type is not a subtype of the function's argument type:\n"
+ ss << "argument type is not a subtype of the function's argument type:\n"
<< "argument: " << *argument_it << "\n"
<< "has type: " << (*argument_it).getType() << "\n"
<< "not subtype: " << *argument_type_it;
namespace __gnu_cxx {}
#include <ext/hash_map>
+#include <ext/hash_set>
namespace __gnu_cxx {
strictParsing(false),
lazyDefinitionExpansion(false),
printWinner(false),
+ defaultExprDepth(0),
simplificationMode(SIMPLIFICATION_MODE_BATCH),
simplificationModeSetByUser(false),
decisionMode(DECISION_STRATEGY_INTERNAL),
Chat.getStream() << Expr::setdepth(depth);
Message.getStream() << Expr::setdepth(depth);
Warning.getStream() << Expr::setdepth(depth);
+ defaultExprDepth = depth;
}
break;
#include "util/exception.h"
#include "util/language.h"
-#include "util/lemma_output_channel.h"
-#include "util/lemma_input_channel.h"
#include "util/tls.h"
#include "theory/theoryof_mode.h"
namespace CVC4 {
class ExprStream;
+class LemmaInputChannel;
+class LemmaOutputChannel;
/** Class representing an option-parsing exception. */
class CVC4_PUBLIC OptionException : public CVC4::Exception {
/** Parallel Only: Whether the winner is printed at the end or not. */
bool printWinner;
+ /** The default expression depth to print on ostreams. */
+ int defaultExprDepth;
+
/** Enumeration of simplification modes (when to simplify). */
typedef enum {
/** Simplify the assertions as they come in */
simple-lra.smt2 \
simple-rdl.smt2 \
simple-uf.smt2 \
- simplification_bug4.smt2
+ simplification_bug4.smt2 \
+ parallel-let.smt2
# Regression tests for PL inputs
CVC_TESTS = \
buggy-ite.smt2 \
bug303.smt2 \
bug310.cvc \
- bug339.smt2
+ bug322.cvc \
+ bug322b.cvc \
+ bug339.smt2 \
+ bug365.smt2
TESTS = $(SMT_TESTS) $(SMT2_TESTS) $(CVC_TESTS) $(TPTP_TESTS) $(BUG_TESTS)
--- /dev/null
+% EXPECT: sat
+% EXIT: 10
+% Preamble --------------
+DATATYPE UNIT = Unit END;
+DATATYPE BOOL = Truth | Falsity END;
+
+% Decls --------------
+node$type: TYPE;
+value$type: TYPE;
+Nodes$elem$type: TYPE = node$type;
+Nodes$t$type: TYPE;
+node_pair_set$type: TYPE = ARRAY node$type OF ARRAY node$type OF BOOL;
+failure_pattern$type: TYPE = node_pair_set$type;
+is_faulty:(node$type, failure_pattern$type) -> BOOL = (LAMBDA (p: node$type,
+ deliver: failure_pattern$type):
+ (IF (EXISTS (q: node$type):
+ (NOT ((((deliver)[
+ (p)])[
+ (q)]) =
+ (Truth)))) THEN
+ (Truth) ELSE (Falsity) ENDIF));
+
+CHECKSAT;
--- /dev/null
+% COMMAND-LINE: --incremental
+% EXPECT: valid
+% EXPECT: valid
+% EXPECT: valid
+% EXIT: 20
+x : INT;
+y : INT = x + 1;
+z : INT = -10;
+identity : INT -> INT = LAMBDA(x:INT) : x;
+QUERY identity(x) = x;
+QUERY identity(y) > x;
+QUERY identity(z) = -10;
--- /dev/null
+(set-logic QF_LIA)
+(set-info :smt-lib-version 2.0)
+(set-info :status unsat)
+(assert (let
+ ((a 2))
+ (= a (let ((a 7)) a))))
+(check-sat)
+(exit)
+
% EXPECT: valid
% EXIT: 20
c : BOOLEAN;
-a16 : [# _a : REAL, _b : REAL #] = (
+a16 : [# _a : INT, _b : INT #] = (
IF c THEN (# _a := 3, _b := 2 #)
ELSE (# _a := 1, _b := 5 #)
ENDIF WITH ._a := 2);
--- /dev/null
+(set-logic QF_UF)
+(set-info :status unsat)
+(declare-sort U 0)
+(declare-fun x () U)
+(declare-fun y () U)
+(assert (distinct x y))
+(assert (let ((x y) (y x)) (= x y)))
+(check-sat)
+(exit)