This PR replaces all usages of Debug() by Trace(), the same for similar methods like Debug.isOn().
Given that Debug is no longer used then, it is removed.
const std::string Cvc5ostream::s_tab = " ";
const int Cvc5ostream::s_indentIosIndex = std::ios_base::xalloc();
-DebugC DebugChannel(&std::cout);
WarningC WarningChannel(&std::cerr);
TraceC TraceChannel(&std::cout);
#ifndef CVC5__OUTPUT_H
#define CVC5__OUTPUT_H
+#include <algorithm>
#include <cstdio>
#include <ios>
#include <iostream>
#include <set>
#include <string>
#include <utility>
+#include <vector>
#include "cvc5_export.h"
/**
* A utility class to provide (essentially) a "/dev/null" streambuf.
* If debugging support is compiled in, but debugging for
- * e.g. "parser" is off, then Debug("parser") returns a stream
+ * e.g. "parser" is off, then Trace("parser") returns a stream
* attached to a null_streambuf instance so that output is directed to
* the bit bucket.
*/
extern NullC nullStream CVC5_EXPORT;
-/** The debug output class */
-class DebugC
-{
- std::set<std::string> d_tags;
- std::ostream* d_os;
-
-public:
- explicit DebugC(std::ostream* os) : d_os(os) {}
-
- Cvc5ostream operator()(const std::string& tag) const
- {
- if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
- return Cvc5ostream(d_os);
- } else {
- return Cvc5ostream();
- }
- }
-
- bool on(const std::string& tag)
- {
- d_tags.insert(tag);
- return true;
- }
- bool off(const std::string& tag)
- {
- d_tags.erase(tag);
- return false;
- }
- bool off() { d_tags.clear(); return false; }
-
- bool isOn(const std::string& tag) const
- {
- return d_tags.find(tag) != d_tags.end();
- }
-
- std::ostream& setStream(std::ostream* os) { d_os = os; return *os; }
- std::ostream& getStream() const { return *d_os; }
- std::ostream* getStreamPointer() const { return d_os; }
-}; /* class DebugC */
-
/** The warning output class */
class WarningC
{
class TraceC
{
std::ostream* d_os;
- std::set<std::string> d_tags;
+ std::vector<std::string> d_tags;
public:
explicit TraceC(std::ostream* os) : d_os(os) {}
- Cvc5ostream operator()(std::string tag) const
+ Cvc5ostream operator()() const
+ {
+ return Cvc5ostream(d_os);
+ }
+ Cvc5ostream operator()(const std::string& tag) const
{
- if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
+ if (isOn(tag)) {
return Cvc5ostream(d_os);
} else {
return Cvc5ostream();
bool on(const std::string& tag)
{
- d_tags.insert(tag);
+ d_tags.emplace_back(tag);
return true;
}
bool off(const std::string& tag)
{
- d_tags.erase(tag);
+ auto it = std::find(d_tags.begin(), d_tags.end(), tag);
+ if (it != d_tags.end())
+ {
+ *it = d_tags.back();
+ d_tags.pop_back();
+ }
return false;
}
- bool off() { d_tags.clear(); return false; }
bool isOn(const std::string& tag) const
{
- return d_tags.find(tag) != d_tags.end();
+ // This is faster than using std::set::find() or sorting the vector and
+ // using std::lower_bound.
+ return !d_tags.empty() && std::find(d_tags.begin(), d_tags.end(), tag) != d_tags.end();
}
std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
}; /* class TraceC */
-/** The debug output singleton */
-extern DebugC DebugChannel CVC5_EXPORT;
/** The warning output singleton */
extern WarningC WarningChannel CVC5_EXPORT;
/** The trace output singleton */
#ifdef CVC5_MUZZLE
-#define Debug ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::DebugChannel
#define Warning \
::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel
#define WarningOnce \
::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel
-#define Trace ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel
+#define TraceIsOn ::cvc5::__cvc5_true() ? false : ::cvc5::TraceChannel.isOn
+#define Trace(tag) ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel()
#else /* CVC5_MUZZLE */
-#if defined(CVC5_DEBUG) && defined(CVC5_TRACING)
-#define Debug ::cvc5::DebugChannel
-#else /* CVC5_DEBUG && CVC5_TRACING */
-#define Debug ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::DebugChannel
-#endif /* CVC5_DEBUG && CVC5_TRACING */
#define Warning \
(!::cvc5::WarningChannel.isOn()) ? ::cvc5::nullStream : ::cvc5::WarningChannel
#define WarningOnce \
? ::cvc5::nullStream \
: ::cvc5::WarningChannel
#ifdef CVC5_TRACING
-#define Trace ::cvc5::TraceChannel
+#define TraceIsOn ::cvc5::TraceChannel.isOn
+#define Trace(tag) !::cvc5::TraceChannel.isOn(tag) ? ::cvc5::nullStream : ::cvc5::TraceChannel()
#else /* CVC5_TRACING */
-#define Trace ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel
+#define TraceIsOn ::cvc5::__cvc5_true() ? false : ::cvc5::TraceChannel.isOn
+#define Trace(tag) ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel()
#endif /* CVC5_TRACING */
#endif /* CVC5_MUZZLE */
-// Disallow e.g. !Debug("foo").isOn() forms
+// Disallow e.g. !Trace("foo").isOn() forms
// because the ! will apply before the ? .
// If a compiler error has directed you here,
-// just parenthesize it e.g. !(Debug("foo").isOn())
+// just parenthesize it e.g. !(Trace("foo").isOn())
class __cvc5_true
{
CVC5_UNUSED void operator!();
// FIXME multithreading
if (d_map->d_first == this)
{
- Debug("gc") << "remove first-elem " << this << " from map " << d_map
- << " with next-elem " << d_next << std::endl;
if (d_next == this)
{
Assert(d_prev == this);
d_map->d_first = d_next;
}
}
- else
- {
- Debug("gc") << "remove nonfirst-elem " << this << " from map "
- << d_map << std::endl;
- }
d_next->d_prev = d_prev;
d_prev->d_next = d_next;
- Debug("gc") << "CDHashMap<> trash push_back " << this << std::endl;
// this->deleteSelf();
enqueueToGarbageCollect();
}
if (first == NULL)
{
first = d_next = d_prev = this;
- Debug("gc") << "add first-elem " << this << " to map " << d_map
- << std::endl;
}
else
{
- Debug("gc") << "add nonfirst-elem " << this << " to map " << d_map
- << " with first-elem " << first << "[" << first->d_prev << " "
- << first->d_next << std::endl;
d_prev = first->d_prev;
d_next = first;
d_prev->d_next = this;
~CDHashMap()
{
- Debug("gc") << "cdhashmap" << this << " disappearing, destroying..."
- << std::endl;
destroy();
- Debug("gc") << "cdhashmap" << this << " disappearing, done destroying"
- << std::endl;
clear();
}
void clear()
{
- Debug("gc") << "clearing cdhashmap" << this << ", emptying trash"
- << std::endl;
- Debug("gc") << "done emptying trash for " << this << std::endl;
-
for (auto& key_element_pair : d_map)
{
// mark it as being a destruction (short-circuit restore())
const Key& front = d_keys.front();
d_hashMap.erase(front);
- Debug("TrailHashMap") <<"TrailHashMap pop_front " << size() << std::endl;
+ Trace("TrailHashMap") <<"TrailHashMap pop_front " << size() << std::endl;
d_keys.pop_front();
}
const Key& back = d_keys.back();
d_hashMap.erase(back);
- Debug("TrailHashMap") <<"TrailHashMap pop_back " << size() << std::endl;
+ Trace("TrailHashMap") <<"TrailHashMap pop_back " << size() << std::endl;
d_keys.pop_back();
}
CDInsertHashMap(const CDInsertHashMap& l)
: ContextObj(l), d_insertMap(nullptr), d_size(l.d_size)
{
- Debug("CDInsertHashMap") << "copy ctor: " << this
+ Trace("CDInsertHashMap") << "copy ctor: " << this
<< " from " << &l
<< " size " << d_size << std::endl;
}
ContextObj* save(ContextMemoryManager* pCMM) override
{
ContextObj* data = new(pCMM) CDInsertHashMap<Key, Data, HashFcn>(*this);
- Debug("CDInsertHashMap") << "save " << this
- << " at level " << this->getContext()->getLevel()
- << " size at " << this->d_size
- << " d_list is " << this->d_insertMap
- << " data:" << data << std::endl;
return data;
}
protected:
*/
void restore(ContextObj* data) override
{
- Debug("CDInsertHashMap")
- << "restore " << this << " level " << this->getContext()->getLevel()
- << " data == " << data << " d_insertMap == " << this->d_insertMap
- << std::endl;
size_t oldSize = ((CDInsertHashMap<Key, Data, HashFcn>*)data)->d_size;
// The size to restore to.
d_insertMap->pop_to_size(restoreSize);
d_size = restoreSize;
Assert(d_insertMap->size() == d_size);
- Debug("CDInsertHashMap")
- << "restore " << this << " level " << this->getContext()->getLevel()
- << " size back to " << this->d_size << std::endl;
}
public:
d_cleanUp(l.d_cleanUp),
d_allocator(l.d_allocator)
{
- Debug("cdlist") << "copy ctor: " << this << " from " << &l << " size "
+ Trace("cdlist") << "copy ctor: " << this << " from " << &l << " size "
<< d_size << std::endl;
}
CDList& operator=(const CDList& l) = delete;
* allocated space.
*/
void grow() {
- Debug("cdlist") << "grow " << this << " " << getContext()->getLevel()
- << ": grow? " << d_size << " " << d_sizeAlloc << std::endl;
if (d_size != d_sizeAlloc)
{
// If there is still unused allocated space
return;
}
- Debug("cdlist") << "grow " << this << " " << getContext()->getLevel()
- << ": grow!" << std::endl;
const size_t maxSize =
std::allocator_traits<AllocatorT>::max_size(d_allocator);
{
// Allocate an initial list if one does not yet exist
d_sizeAlloc = INITIAL_SIZE;
- Debug("cdlist") << "initial grow of cdlist " << this
- << " level " << getContext()->getLevel()
- << " to " << d_sizeAlloc << std::endl;
if (d_sizeAlloc > maxSize)
{
d_sizeAlloc = maxSize;
}
T* newList =
std::allocator_traits<AllocatorT>::allocate(d_allocator, newSize);
- Debug("cdlist") << "2x grow of cdlist " << this
- << " level " << getContext()->getLevel()
- << " to " << newSize
- << " (from " << d_list
- << " to " << newList << ")" << std::endl;
if (newList == nullptr)
{
throw std::bad_alloc();
ContextObj* save(ContextMemoryManager* pCMM) override
{
ContextObj* data = new(pCMM) CDList<T, CleanUp, Allocator>(*this);
- Debug("cdlist") << "save " << this
- << " at level " << this->getContext()->getLevel()
- << " size at " << this->d_size
- << " sizeAlloc at " << this->d_sizeAlloc
- << " d_list is " << this->d_list
- << " data:" << data << std::endl;
return data;
}
*/
void restore(ContextObj* data) override
{
- Debug("cdlist") << "restore " << this << " level "
- << this->getContext()->getLevel() << " data == " << data
- << " call dtor == " << this->d_callDestructor
- << " d_list == " << this->d_list << std::endl;
truncateList(((CDList<T, CleanUp, Allocator>*)data)->d_size);
- Debug("cdlist") << "restore " << this << " level "
- << this->getContext()->getLevel() << " size back to "
- << this->d_size << " sizeAlloc at " << this->d_sizeAlloc
- << std::endl;
}
/**
* to avoid this issue.
*/
void push_back(const T& data) {
- Debug("cdlist") << "push_back " << this
+ Trace("cdlist") << "push_back " << this
<< " " << getContext()->getLevel()
<< ": make-current, "
<< "d_list == " << d_list << std::endl;
grow();
Assert(d_size < d_sizeAlloc);
- Debug("cdlist") << "push_back " << this
- << " " << getContext()->getLevel()
- << ": construct! at " << d_list
- << "[" << d_size << "] == " << &d_list[d_size]
- << std::endl;
std::allocator_traits<AllocatorT>::construct(
d_allocator, &d_list[d_size], data);
- Debug("cdlist") << "push_back " << this
- << " " << getContext()->getLevel()
- << ": done..." << std::endl;
++d_size;
- Debug("cdlist") << "push_back " << this
- << " " << getContext()->getLevel()
- << ": size now " << d_size << std::endl;
}
/**
template <typename... Args>
void emplace_back(Args&&... args)
{
- Debug("cdlist") << "emplace_back " << this << " "
+ Trace("cdlist") << "emplace_back " << this << " "
<< getContext()->getLevel() << ": make-current, "
<< "d_list == " << d_list << std::endl;
makeCurrent();
grow();
Assert(d_size < d_sizeAlloc);
- Debug("cdlist") << "emplace_back " << this << " "
- << getContext()->getLevel() << ": construct! at " << d_list
- << "[" << d_size << "] == " << &d_list[d_size] << std::endl;
std::allocator_traits<AllocatorT>::construct(
d_allocator, &d_list[d_size], std::forward<Args>(args)...);
- Debug("cdlist") << "emplace_back " << this << " "
- << getContext()->getLevel() << ": done..." << std::endl;
++d_size;
- Debug("cdlist") << "emplace_back " << this << " "
- << getContext()->getLevel() << ": size now " << d_size
- << std::endl;
}
/**
*/
ContextObj* save(ContextMemoryManager* pCMM) override
{
- Debug("context") << "save cdo " << this;
- ContextObj* p = new(pCMM) CDO<T>(*this);
- Debug("context") << " to " << p << std::endl;
- return p;
+ return new (pCMM) CDO<T>(*this);
}
/**
*/
void restore(ContextObj* pContextObj) override
{
- //Debug("context") << "restore cdo " << this;
CDO<T>* p = static_cast<CDO<T>*>(pContextObj);
d_data = p->d_data;
- //Debug("context") << " to " << get() << std::endl;
// Explicitly call destructor as it will not otherwise get called.
p->d_data.~T();
}
// We save the d_size in d_lastsave and we should never destruct below this
// indices before the corresponding restore.
d_lastsave = ParentType::d_size;
- Debug("cdqueue") << "save " << this
- << " at level " << this->getContext()->getLevel()
- << " size at " << this->d_size
- << " iter at " << this->d_iter
- << " lastsave at " << this->d_lastsave
- << " d_list is " << this->d_list
- << " data:" << data << std::endl;
return data;
}
void ContextObj::update()
{
- Debug("context") << "before update(" << this << "):" << std::endl
- << "context is " << getContext() << std::endl
- << *getContext() << std::endl;
-
// Call save() to save the information in the current object
ContextObj* pContextObjSaved = save(d_pScope->getCMM());
- Debug("context") << "in update(" << this << ") with restore "
- << pContextObjSaved << ": waypoint 1" << std::endl
- << *getContext() << std::endl;
-
// Check that base class data was saved
Assert((pContextObjSaved->d_pContextObjNext == d_pContextObjNext
&& pContextObjSaved->d_ppContextObjPrev == d_ppContextObjPrev
// Link the "saved" object in place of this ContextObj in the scope
// we're moving it FROM.
- Debug("context") << "in update(" << this
- << "): next() == " << next() << std::endl;
if(next() != NULL) {
- Debug("context") << "in update(" << this
- << "): next()->prev() == " << next()->prev() << std::endl;
next()->prev() = &pContextObjSaved->next();
- Debug("context") << "in update(" << this
- << "): next()->prev() is now "
- << next()->prev() << std::endl;
}
- Debug("context") << "in update(" << this
- << "): prev() == " << prev() << std::endl;
- Debug("context") << "in update(" << this
- << "): *prev() == " << *prev() << std::endl;
*prev() = pContextObjSaved;
- Debug("context") << "in update(" << this
- << "): *prev() is now " << *prev() << std::endl;
-
- Debug("context") << "in update(" << this << ") with restore "
- << pContextObjSaved << ": waypoint 3" << std::endl
- << *getContext() << std::endl;
// Update Scope pointer to current top Scope
d_pScope = d_pScope->getContext()->getTopScope();
// Insert object into the list of objects that need to be restored when this
// Scope is popped.
d_pScope->addToChain(this);
-
- Debug("context") << "after update(" << this << ") with restore "
- << pContextObjSaved << ":" << std::endl
- << *getContext() << std::endl;
}
ContextObj* ContextObj::restoreAndContinue()
// Assert(d_pScope == d_pScope->getContext()->getBottomScope()) <<
// "Expected bottom scope";
- Debug("context") << "NULL restore object! " << this << std::endl;
+ Trace("context") << "NULL restore object! " << this << std::endl;
pContextObjNext = d_pContextObjNext;
d_pScope = nullptr;
Assert(d_pScope != nullptr);
/* Context can be big and complicated, so we only want to process this output
* if we're really going to use it. (Same goes below.) */
- Debug("context") << "before destroy " << this << " (level " << getLevel()
+ Trace("context") << "before destroy " << this << " (level " << getLevel()
<< "):" << std::endl << *getContext() << std::endl;
for (;;)
{
break;
}
- Debug("context") << "in destroy " << this << ", restore object is "
- << d_pContextObjRestore << " at level "
- << d_pContextObjRestore->getLevel() << ":" << std::endl
- << *getContext() << std::endl;
restoreAndContinue();
}
- Debug("context") << "after destroy " << this << ":" << std::endl
+ Trace("context") << "after destroy " << this << ":" << std::endl
<< *getContext() << std::endl;
}
d_ppContextObjPrev(NULL) {
Assert(pContext != NULL) << "NULL context pointer";
- Debug("context") << "create new ContextObj(" << this << " inCMM=false)" << std::endl;
+ Trace("context") << "create new ContextObj(" << this << " inCMM=false)" << std::endl;
d_pScope = pContext->getBottomScope();
d_pScope->addToChain(this);
}
d_ppContextObjPrev(NULL) {
Assert(pContext != NULL) << "NULL context pointer";
- Debug("context") << "create new ContextObj(" << this << " inCMM=" << allocatedInCMM << ")" << std::endl;
+ Trace("context") << "create new ContextObj(" << this << " inCMM=" << allocatedInCMM << ")" << std::endl;
if(allocatedInCMM) {
d_pScope = pContext->getTopScope();
} else {
*/
static void* operator new(size_t size, ContextMemoryManager* pCMM)
{
- Trace("context_mm") << "Scope::new " << size << " in " << pCMM << std::endl;
return pCMM->newData(size);
}
* to be done using the restore method.
*/
static void* operator new(size_t size, ContextMemoryManager* pCMM) {
- Trace("context_mm") << "Context::new " << size << " in " << pCMM << std::endl;
return pCMM->newData(size);
}
* ContextMemoryManager as an argument.
*/
void deleteSelf() {
- Debug("context") << "deleteSelf(" << this << ") " << typeid(*this).name() << std::endl;
this->~ContextObj();
::operator delete(this);
}
AlwaysAssert(d_nextFree <= d_endChunk)
<< "Request is bigger than memory chunk size";
}
- Debug("context") << "ContextMemoryManager::newData(" << size
- << ") returning " << res << " at level "
- << d_chunkList.size() << std::endl;
#ifdef CVC5_VALGRIND
VALGRIND_MEMPOOL_ALLOC(this, static_cast<char*>(res), size);
void JustifyStack::pushToStack(TNode n, prop::SatValue desiredVal)
{
- if (Trace.isOn("jh-stack"))
+ if (TraceIsOn("jh-stack"))
{
for (size_t i = 0, ssize = d_stackSizeValid.get(); i < ssize; i++)
{
return BitIterator();
}
/*
- Debug.printf("boolattr",
+ Trace.printf("boolattr",
"underlying word at 0x%p looks like 0x%016llx, bit is %u\n",
&(*i).second,
(uint64_t)((*i).second),
return ConstBitIterator();
}
/*
- Debug.printf("boolattr",
+ Trace.printf("boolattr",
"underlying word at 0x%p looks like 0x%016llx, bit is %u\n",
&(*i).second,
(uint64_t)((*i).second),
if (computeCardinalityRecSingleton(t, processing, d_cardUAssume[t]))
{
d_cardRecSingleton[t] = 1;
- if (Trace.isOn("dt-card"))
+ if (TraceIsOn("dt-card"))
{
Trace("dt-card") << "DType " << getName()
<< " is recursive singleton, dependent upon "
std::unordered_set<TypeNode> types;
std::map<TypeNode, bool> processed;
getAlienSubfieldTypes(types, processed, false);
- if (Trace.isOn("datatypes-init"))
+ if (TraceIsOn("datatypes-init"))
{
Trace("datatypes-init") << "Alien subfield types: " << std::endl;
for (const TypeNode& t : types)
template <bool ref_count>
bool NodeTemplate<ref_count>::isConst() const {
assertTNodeNotExpired();
- Debug("isConst") << "Node::isConst() for: " << *this << std::endl;
+ Trace("isConst") << "Node::isConst() for: " << *this << std::endl;
if(isNull()) {
return false;
}
switch(getMetaKind()) {
case kind::metakind::CONSTANT:
- Debug("isConst") << "Node::isConst() returning true, it's a CONSTANT" << std::endl;
+ Trace("isConst") << "Node::isConst() returning true, it's a CONSTANT" << std::endl;
return true;
case kind::metakind::VARIABLE:
- Debug("isConst") << "Node::isConst() returning false, it's a VARIABLE" << std::endl;
+ Trace("isConst") << "Node::isConst() returning false, it's a VARIABLE" << std::endl;
return false;
default:
if(getAttribute(IsConstComputedAttr())) {
bool bval = getAttribute(IsConstAttr());
- Debug("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl;
+ Trace("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl;
return bval;
} else {
bool bval = expr::TypeChecker::computeIsConst(NodeManager::currentNM(), *this);
- Debug("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl;
+ Trace("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl;
const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstAttr(), bval);
const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstComputedAttr(), true);
return bval;
}
n.setAttribute(HasBoundVarAttr(), hasBv);
n.setAttribute(HasBoundVarComputedAttr(), true);
- Debug("bva") << n << " has bva : " << n.getAttribute(HasBoundVarAttr())
+ Trace("bva") << n << " has bva : " << n.getAttribute(HasBoundVarAttr())
<< std::endl;
return hasBv;
}
nv->d_id = d_nm->next_id++; // FIXME multithreading
nv->d_rc = 0;
setUsed();
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "creating node value " << nv << " [" << nv->d_id << "]: ";
- nv->printAst(Debug("gc"));
- Debug("gc") << std::endl;
+ Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: ";
+ nv->printAst(Trace("gc"));
+ Trace("gc") << std::endl;
}
return nv;
}
// poolNv = nv;
d_nm->poolInsert(nv);
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "creating node value " << nv << " [" << nv->d_id
+ Trace("gc") << "creating node value " << nv << " [" << nv->d_id
<< "]: ";
- nv->printAst(Debug("gc"));
- Debug("gc") << std::endl;
+ nv->printAst(Trace("gc"));
+ Trace("gc") << std::endl;
}
return nv;
}
// poolNv = nv;
d_nm->poolInsert(nv);
- Debug("gc") << "creating node value " << nv << " [" << nv->d_id
+ Trace("gc") << "creating node value " << nv << " [" << nv->d_id
<< "]: " << *nv << "\n";
return nv;
}
* NOTE IN 1(b) AND 2(b) THAT we can NOT create Node wrapper
* temporary for the NodeValue in the NodeBuilder::operator Node()
* member function. If we create a temporary (for example by writing
- * Debug("builder") << Node(nv) << endl), the NodeValue will have its
+ * Trace("builder") << Node(nv) << endl), the NodeValue will have its
* reference count incremented from zero to one, then decremented,
* which makes it eligible for collection before the builder has even
* returned it! So this is a no-no.
ScopedBool(bool& value) :
d_value(value) {
- Debug("gc") << ">> setting ScopedBool\n";
+ Trace("gc") << ">> setting ScopedBool\n";
d_value = true;
}
~ScopedBool() {
- Debug("gc") << "<< clearing ScopedBool\n";
+ Trace("gc") << "<< clearing ScopedBool\n";
d_value = false;
}
};
NVReclaim(NodeValue*& deletionField) :
d_deletionField(deletionField) {
- Debug("gc") << ">> setting NVRECLAIM field\n";
+ Trace("gc") << ">> setting NVRECLAIM field\n";
}
~NVReclaim() {
- Debug("gc") << "<< clearing NVRECLAIM field\n";
+ Trace("gc") << "<< clearing NVRECLAIM field\n";
d_deletionField = NULL;
}
};
NodeValue* greatest_maxed_out = order.back();
order.pop_back();
Assert(greatest_maxed_out->HasMaximizedReferenceCount());
- Debug("gc") << "Force zombify " << greatest_maxed_out << std::endl;
+ Trace("gc") << "Force zombify " << greatest_maxed_out << std::endl;
greatest_maxed_out->d_rc = 0;
markForDeletion(greatest_maxed_out);
}
poolRemove(&expr::NodeValue::null());
}
- if (Debug.isOn("gc:leaks"))
+ if (TraceIsOn("gc:leaks"))
{
- Debug("gc:leaks") << "still in pool:" << endl;
+ Trace("gc:leaks") << "still in pool:" << endl;
for (NodeValuePool::const_iterator i = d_nodeValuePool.begin(),
iend = d_nodeValuePool.end();
i != iend;
++i)
{
- Debug("gc:leaks") << " " << *i << " id=" << (*i)->d_id
+ Trace("gc:leaks") << " " << *i << " id=" << (*i)->d_id
<< " rc=" << (*i)->d_rc << " " << **i << endl;
}
- Debug("gc:leaks") << ":end:" << endl;
+ Trace("gc:leaks") << ":end:" << endl;
}
// defensive coding, in case destruction-order issues pop up (they often do)
// FIXME multithreading
Assert(!d_attrManager->inGarbageCollection());
- Debug("gc") << "reclaiming " << d_zombies.size() << " zombie(s)!\n";
+ Trace("gc") << "reclaiming " << d_zombies.size() << " zombie(s)!\n";
// during reclamation, reclaimZombies() is never supposed to be called
Assert(!d_inReclaimZombies)
// collect ONLY IF still zero
if (nv->d_rc == 0)
{
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "deleting node value " << nv << " [" << nv->d_id
+ Trace("gc") << "deleting node value " << nv << " [" << nv->d_id
<< "]: ";
- nv->printAst(Debug("gc"));
- Debug("gc") << endl;
+ nv->printAst(Trace("gc"));
+ Trace("gc") << endl;
}
// remove from the pool
{
NodeValue* current = stack.back().second;
const bool visited_children = stack.back().first;
- Debug("gc") << "Topological sort " << current << " " << visited_children
+ Trace("gc") << "Topological sort " << current << " " << visited_children
<< std::endl;
if (visited_children)
{
bool hasType = getAttribute(n, TypeAttr(), typeNode);
bool needsCheck = check && !getAttribute(n, TypeCheckedAttr());
- Debug("getType") << this << " getting type for " << &n << " " << n
+ Trace("getType") << this << " getting type for " << &n << " " << n
<< ", check=" << check << ", needsCheck = " << needsCheck
<< ", hasType = " << hasType << endl;
/* The check should have happened, if we asked for it. */
Assert(!check || getAttribute(n, TypeCheckedAttr()));
- Debug("getType") << "type of " << &n << " " << n << " is " << typeNode
+ Trace("getType") << "type of " << &n << " " << n << " is " << typeNode
<< endl;
return typeNode;
}
{
CheckArgument(
!elementType.isNull(), elementType, "unexpected NULL element type");
- Debug("bags") << "making bags type " << elementType << std::endl;
+ Trace("bags") << "making bags type " << elementType << std::endl;
return mkTypeNode(kind::BAG_TYPE, elementType);
}
}
dt.addConstructor(c);
d_data = nm->mkDatatypeType(dt);
- Debug("tuprec-debug") << "Return type : " << d_data << std::endl;
+ Trace("tuprec-debug") << "Return type : " << d_data << std::endl;
}
return d_data;
}
}
dt.addConstructor(c);
d_data = nm->mkDatatypeType(dt);
- Debug("tuprec-debug") << "Return type : " << d_data << std::endl;
+ Trace("tuprec-debug") << "Return type : " << d_data << std::endl;
}
return d_data;
}
TypeNode NodeManager::mkTupleType(const std::vector<TypeNode>& types)
{
std::vector<TypeNode> ts;
- Debug("tuprec-debug") << "Make tuple type : ";
+ Trace("tuprec-debug") << "Make tuple type : ";
for (unsigned i = 0; i < types.size(); ++i)
{
CheckArgument(!types[i].isFunctionLike(),
types,
"cannot put function-like types in tuples");
ts.push_back(types[i]);
- Debug("tuprec-debug") << types[i] << " ";
+ Trace("tuprec-debug") << types[i] << " ";
}
- Debug("tuprec-debug") << std::endl;
+ Trace("tuprec-debug") << std::endl;
return d_tt_cache.getTupleType(this, ts);
}
new (&nv->d_children) T(val);
poolInsert(nv);
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "creating node value " << nv << " [" << nv->d_id << "]: ";
- nv->printAst(Debug("gc"));
- Debug("gc") << std::endl;
+ Trace("gc") << "creating node value " << nv << " [" << nv->d_id << "]: ";
+ nv->printAst(Trace("gc"));
+ Trace("gc") << std::endl;
}
return NodeClass(nv);
// if d_reclaiming is set, make sure we don't call
// reclaimZombies(), because it's already running.
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "zombifying node value " << nv << " [" << nv->d_id
+ Trace("gc") << "zombifying node value " << nv << " [" << nv->d_id
<< "]: ";
- nv->printAst(Debug("gc"));
- Debug("gc") << (d_inReclaimZombies ? " [CURRENTLY-RECLAIMING]" : "")
+ nv->printAst(Trace("gc"));
+ Trace("gc") << (d_inReclaimZombies ? " [CURRENTLY-RECLAIMING]" : "")
<< std::endl;
}
inline void markRefCountMaxedOut(expr::NodeValue* nv)
{
Assert(nv->HasMaximizedReferenceCount());
- if (Debug.isOn("gc"))
+ if (TraceIsOn("gc"))
{
- Debug("gc") << "marking node value " << nv << " [" << nv->d_id
+ Trace("gc") << "marking node value " << nv << " [" << nv->d_id
<< "]: as maxed out" << std::endl;
}
d_maxedOut.push_back(nv);
"unexpected NULL index type");
CheckArgument(!constituentType.isNull(), constituentType,
"unexpected NULL constituent type");
- Debug("arrays") << "making array type " << indexType << " "
+ Trace("arrays") << "making array type " << indexType << " "
<< constituentType << std::endl;
return mkTypeNode(kind::ARRAY_TYPE, indexType, constituentType);
}
inline TypeNode NodeManager::mkSetType(TypeNode elementType) {
CheckArgument(!elementType.isNull(), elementType,
"unexpected NULL element type");
- Debug("sets") << "making sets type " << elementType << std::endl;
+ Trace("sets") << "making sets type " << elementType << std::endl;
return mkTypeNode(kind::SET_TYPE, elementType);
}
const vector<api::Sort>& params,
api::Sort t)
{
- if (Debug.isOn("sort")) {
- Debug("sort") << "bindType(" << name << ", [";
+ if (TraceIsOn("sort")) {
+ Trace("sort") << "bindType(" << name << ", [";
if (params.size() > 0) {
copy(params.begin(),
params.end() - 1,
- ostream_iterator<api::Sort>(Debug("sort"), ", "));
- Debug("sort") << params.back();
+ ostream_iterator<api::Sort>(Trace("sort"), ", "));
+ Trace("sort") << params.back();
}
- Debug("sort") << "], " << t << ")" << endl;
+ Trace("sort") << "], " << t << ")" << endl;
}
d_typeMap.insert(name, make_pair(params, t));
return p.second.instantiate(params);
}
bool isSortConstructor = p.second.isSortConstructor();
- if (Debug.isOn("sort"))
+ if (TraceIsOn("sort"))
{
- Debug("sort") << "instantiating using a sort "
+ Trace("sort") << "instantiating using a sort "
<< (isSortConstructor ? "constructor" : "substitution")
<< std::endl;
- Debug("sort") << "have formals [";
+ Trace("sort") << "have formals [";
copy(p.first.begin(),
p.first.end() - 1,
- ostream_iterator<api::Sort>(Debug("sort"), ", "));
- Debug("sort") << p.first.back() << "]" << std::endl << "parameters [";
+ ostream_iterator<api::Sort>(Trace("sort"), ", "));
+ Trace("sort") << p.first.back() << "]" << std::endl << "parameters [";
copy(params.begin(),
params.end() - 1,
- ostream_iterator<api::Sort>(Debug("sort"), ", "));
- Debug("sort") << params.back() << "]" << endl
+ ostream_iterator<api::Sort>(Trace("sort"), ", "));
+ Trace("sort") << params.back() << "]" << endl
<< "type ctor " << name << std::endl
<< "type is " << p.second << std::endl;
}
? p.second.instantiate(params)
: p.second.substitute(p.first, params);
- Debug("sort") << "instance is " << instantiation << std::endl;
+ Trace("sort") << "instance is " << instantiation << std::endl;
return instantiation;
}
// clang-format on
default:
- Debug("getType") << "FAILURE" << std::endl;
+ Trace("getType") << "FAILURE" << std::endl;
Unhandled() << " " << n.getKind();
}
{
std::vector<TypeNode> argTypes = dt.getParamTypes();
addTypes(argTypes);
- Debug("typecheck-idt") << "instantiating matcher for " << dt << std::endl;
+ Trace("typecheck-idt") << "instantiating matcher for " << dt << std::endl;
for (unsigned i = 0, narg = argTypes.size(); i < narg; ++i)
{
if (dt.isParameterInstantiatedDatatype(i))
{
- Debug("typecheck-idt")
+ Trace("typecheck-idt")
<< "++ instantiate param " << i << " : " << d_types[i] << std::endl;
d_match[i] = d_types[i];
}
bool TypeMatcher::doMatching(TypeNode pattern, TypeNode tn)
{
- Debug("typecheck-idt") << "doMatching() : " << pattern << " : " << tn
+ Trace("typecheck-idt") << "doMatching() : " << pattern << " : " << tn
<< std::endl;
std::vector<TypeNode>::iterator i =
std::find(d_types.begin(), d_types.end(), pattern);
size_t index = i - d_types.begin();
if (!d_match[index].isNull())
{
- Debug("typecheck-idt")
+ Trace("typecheck-idt")
<< "check subtype " << tn << " " << d_match[index] << std::endl;
TypeNode tnn = TypeNode::leastCommonTypeNode(tn, d_match[index]);
// recognize subtype relation
// Determine which messages to show based on smtcomp_mode and verbosity
if(Configuration::isMuzzledBuild()) {
- DebugChannel.setStream(&cvc5::null_os);
TraceChannel.setStream(&cvc5::null_os);
WarningChannel.setStream(&cvc5::null_os);
}
string input = "";
while(true) {
- Debug("interactive") << "Input now '" << input << line << "'" << endl
+ Trace("interactive") << "Input now '" << input << line << "'" << endl
<< flush;
Assert(!(d_in.fail() && !d_in.eof()) || line.empty());
/* Extract the newline delimiter from the stream too */
int c CVC5_UNUSED = d_in.get();
Assert(c == '\n');
- Debug("interactive") << "Next char is '" << (char)c << "'" << endl
+ Trace("interactive") << "Next char is '" << (char)c << "'" << endl
<< flush;
}
}
} else {
/* No continuation, we're done. */
- Debug("interactive") << "Leaving input loop." << endl << flush;
+ Trace("interactive") << "Leaving input loop." << endl << flush;
break;
}
}
#if HAVE_LIBEDITLINE
char** commandCompletion(const char* text, int start, int end) {
- Debug("rl") << "text: " << text << endl;
- Debug("rl") << "start: " << start << " end: " << end << endl;
+ Trace("rl") << "text: " << text << endl;
+ Trace("rl") << "start: " << start << " end: " << end << endl;
return rl_completion_matches(text, commandGenerator);
}
std::vector<std::string>& nonoptions)
{
Assert(argv != nullptr);
- if (Debug.isOn("options"))
+ if (TraceIsOn("options"))
{
- Debug("options") << "starting a new parseInternal with " << argc
+ Trace("options") << "starting a new parseInternal with " << argc
<< " arguments" << std::endl;
for (int i = 0; i < argc; ++i)
{
Assert(argv[i] != nullptr);
- Debug("options") << " argv[" << i << "] = " << argv[i] << std::endl;
+ Trace("options") << " argv[" << i << "] = " << argv[i] << std::endl;
}
}
// non-option.
if (main_optind > 0 && main_optind < argc && argv[main_optind][0] != '-')
{
- Debug("options") << "enqueueing " << argv[main_optind]
+ Trace("options") << "enqueueing " << argv[main_optind]
<< " as a non-option." << std::endl;
nonoptions.push_back(argv[main_optind]);
++main_optind;
continue;
}
- Debug("options") << "[ before, main_optind == " << main_optind << " ]"
+ Trace("options") << "[ before, main_optind == " << main_optind << " ]"
<< std::endl;
- Debug("options") << "[ before, optind == " << optind << " ]" << std::endl;
- Debug("options") << "[ argc == " << argc << ", argv == " << argv << " ]"
+ Trace("options") << "[ before, optind == " << optind << " ]" << std::endl;
+ Trace("options") << "[ argc == " << argc << ", argv == " << argv << " ]"
<< std::endl;
// clang-format off
int c = getopt_long(argc, argv,
main_optind = optind;
- Debug("options") << "[ got " << int(c) << " (" << char(c) << ") ]"
+ Trace("options") << "[ got " << int(c) << " (" << char(c) << ") ]"
<< "[ next option will be at pos: " << optind << " ]"
<< std::endl;
if (c == -1)
{
- if (Debug.isOn("options"))
+ if (TraceIsOn("options"))
{
- Debug("options") << "done with option parsing" << std::endl;
+ Trace("options") << "done with option parsing" << std::endl;
for (int index = optind; index < argc; ++index)
{
- Debug("options") << "remaining " << argv[index] << std::endl;
+ Trace("options") << "remaining " << argv[index] << std::endl;
}
}
break;
std::string option = argv[old_optind == 0 ? 1 : old_optind];
std::string optionarg = (optarg == nullptr) ? "" : optarg;
- Debug("preemptGetopt") << "processing option " << c << " (`" << char(c)
+ Trace("preemptGetopt") << "processing option " << c << " (`" << char(c)
<< "'), " << option << std::endl;
switch (c)
}
}
- Debug("options") << "got " << nonoptions.size() << " non-option arguments."
+ Trace("options") << "got " << nonoptions.size() << " non-option arguments."
<< std::endl;
}
// To debug options parsing, you may prefer to simply uncomment this
// and recompile. Debug flags have not been parsed yet so these have
// not been set.
- // DebugChannel.on("options");
+ // TraceChannel.on("options");
- Debug("options") << "argv == " << argv << std::endl;
+ Trace("options") << "argv == " << argv << std::endl;
// Find the base name of the program.
const char* x = strrchr(progName, '/');
std::vector<std::string> nonoptions;
parseInternal(solver, argc, argv, nonoptions);
- if (Debug.isOn("options"))
+ if (TraceIsOn("options"))
{
for (const auto& no : nonoptions)
{
- Debug("options") << "nonoptions " << no << std::endl;
+ Trace("options") << "nonoptions " << no << std::endl;
}
}
void OptionsHandler::setErrStream(const std::string& flag, const ManagedErr& me)
{
- Debug.setStream(me);
Warning.setStream(me);
- Trace.setStream(me);
+ TraceChannel.setStream(me);
}
Language OptionsHandler::stringToLanguage(const std::string& flag,
void OptionsHandler::setVerbosity(const std::string& flag, int value)
{
if(Configuration::isMuzzledBuild()) {
- DebugChannel.setStream(&cvc5::null_os);
TraceChannel.setStream(&cvc5::null_os);
WarningChannel.setStream(&cvc5::null_os);
} else {
}
for (const auto& tag: tags)
{
- Trace.on(tag);
+ TraceChannel.on(tag);
}
}
optarg,
Configuration::getTraceTags()));
}
- Debug.on(optarg);
- Trace.on(optarg);
+ TraceChannel.on(optarg);
}
void OptionsHandler::enableOutputTag(const std::string& flag,
void OptionsHandler::setPrintSuccess(const std::string& flag, bool value)
{
- Debug.getStream() << Command::printsuccess(value);
- Trace.getStream() << Command::printsuccess(value);
+ TraceChannel.getStream() << Command::printsuccess(value);
Warning.getStream() << Command::printsuccess(value);
*d_options->base.out << Command::printsuccess(value);
}
void OptionsHandler::setDefaultExprDepth(const std::string& flag, int64_t depth)
{
ioutils::setDefaultNodeDepth(depth);
- ioutils::applyNodeDepth(Debug.getStream(), depth);
- ioutils::applyNodeDepth(Trace.getStream(), depth);
+ ioutils::applyNodeDepth(TraceChannel.getStream(), depth);
ioutils::applyNodeDepth(Warning.getStream(), depth);
}
void OptionsHandler::setDefaultDagThresh(const std::string& flag, int64_t dag)
{
ioutils::setDefaultDagThresh(dag);
- ioutils::applyDagThresh(Debug.getStream(), dag);
- ioutils::applyDagThresh(Trace.getStream(), dag);
+ ioutils::applyDagThresh(TraceChannel.getStream(), dag);
ioutils::applyDagThresh(Warning.getStream(), dag);
}
// we found the right place
string word = slice.substr(caretPos, (caretPosOrig - caretPos + 1));
size_t matchLoc = wholeWordMatch(message, word, isSimpleChar);
- Debug("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl;
+ Trace("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl;
if( matchLoc != string::npos ) {
- Debug("friendlyparser") << "[friendlyparser] Feeling good." << std::endl;
+ Trace("friendlyparser") << "[friendlyparser] Feeling good." << std::endl;
}
}
} else {
}
string word = slice.substr(nearestWordSt, (nearestWordEn - nearestWordSt + 1));
size_t matchLoc = wholeWordMatch(message, word, isSimpleChar);
- Debug("friendlyparser") << "[friendlyparser] nearest word = " << word << std::endl;
- Debug("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl;
+ Trace("friendlyparser") << "[friendlyparser] nearest word = " << word << std::endl;
+ Trace("friendlyparser") << "[friendlyparser] matchLoc = " << matchLoc << endl;
if( matchLoc != string::npos ) {
- Debug("friendlyparser") << "[friendlyparser] strong evidence that caret should be at "
+ Trace("friendlyparser") << "[friendlyparser] strong evidence that caret should be at "
<< nearestWordSt << std::endl;
foundCaretPos = true;
}
d_lexer->getCharPositionInLine(d_lexer),
message);
- Debug("parser") << "Throwing exception: "
+ Trace("parser") << "Throwing exception: "
<< (const char*)d_lexer->rec->state->tokSource->fileName->chars << ":"
<< d_lexer->getLine(d_lexer) << "."
<< d_lexer->getCharPositionInLine(d_lexer) << ": "
/* start and end are boundary pointers. The text is a string
* of (end-start+1) bytes beginning at start. */
std::string txt( (const char *)start, end-start+1 );
- Debug("parser-extra") << "tokenText: start=" << start << std::endl
+ Trace("parser-extra") << "tokenText: start=" << start << std::endl
<< "end=" << end << std::endl
<< "txt='" << txt << "'" << std::endl;
return txt;
input->charPositionInLine = 0;
input->currentLine = line_buffered_input->line_buffer->getPtr(
input->line, input->charPositionInLine);
- Debug("pipe") << "-- newline!" << std::endl;
+ Trace("pipe") << "-- newline!" << std::endl;
}
input->nextChar = line_buffered_input->line_buffer->getPtr(
const api::Sort& type,
bool doOverload)
{
- Debug("parser") << "bindVar(" << name << ", " << type << ")" << std::endl;
+ Trace("parser") << "bindVar(" << name << ", " << type << ")" << std::endl;
api::Term expr = d_solver->mkConst(type, name);
defineVar(name, expr, doOverload);
return expr;
api::Term Parser::bindBoundVar(const std::string& name, const api::Sort& type)
{
- Debug("parser") << "bindBoundVar(" << name << ", " << type << ")"
+ Trace("parser") << "bindBoundVar(" << name << ", " << type << ")"
<< std::endl;
api::Term expr = d_solver->mkVar(type, name);
defineVar(name, expr);
const api::Term& val,
bool doOverload)
{
- Debug("parser") << "defineVar( " << name << " := " << val << ")" << std::endl;
+ Trace("parser") << "defineVar( " << name << " := " << val << ")" << std::endl;
if (!d_symtab->bind(name, val, doOverload))
{
std::stringstream ss;
const std::vector<api::Sort>& params,
const api::Sort& type)
{
- if (Debug.isOn("parser")) {
- Debug("parser") << "defineParameterizedType(" << name << ", "
+ if (TraceIsOn("parser")) {
+ Trace("parser") << "defineParameterizedType(" << name << ", "
<< params.size() << ", [";
if (params.size() > 0) {
copy(params.begin(),
params.end() - 1,
- ostream_iterator<api::Sort>(Debug("parser"), ", "));
- Debug("parser") << params.back();
+ ostream_iterator<api::Sort>(Trace("parser"), ", "));
+ Trace("parser") << params.back();
}
- Debug("parser") << "], " << type << ")" << std::endl;
+ Trace("parser") << "], " << type << ")" << std::endl;
}
defineType(name, params, type);
}
api::Sort Parser::mkSort(const std::string& name)
{
- Debug("parser") << "newSort(" << name << ")" << std::endl;
+ Trace("parser") << "newSort(" << name << ")" << std::endl;
api::Sort type = d_solver->mkUninterpretedSort(name);
defineType(name, type);
return type;
api::Sort Parser::mkSortConstructor(const std::string& name, size_t arity)
{
- Debug("parser") << "newSortConstructor(" << name << ", " << arity << ")"
+ Trace("parser") << "newSortConstructor(" << name << ", " << arity << ")"
<< std::endl;
api::Sort type = d_solver->mkSortConstructorSort(name, arity);
defineType(name, vector<api::Sort>(arity), type);
api::Sort Parser::mkUnresolvedTypeConstructor(
const std::string& name, const std::vector<api::Sort>& params)
{
- Debug("parser") << "newSortConstructor(P)(" << name << ", " << params.size()
+ Trace("parser") << "newSortConstructor(P)(" << name << ", " << params.size()
<< ")" << std::endl;
api::Sort unresolved = d_solver->mkSortConstructorSort(name, params.size());
defineType(name, params, unresolved);
api::Sort t = types[i];
const api::Datatype& dt = t.getDatatype();
const std::string& name = dt.getName();
- Debug("parser-idt") << "define " << name << " as " << t << std::endl;
+ Trace("parser-idt") << "define " << name << " as " << t << std::endl;
if (isDeclared(name, SYM_SORT)) {
throw ParserException(name + " already declared");
}
{
const api::DatatypeConstructor& ctor = dt[j];
api::Term constructor = ctor.getConstructorTerm();
- Debug("parser-idt") << "+ define " << constructor << std::endl;
+ Trace("parser-idt") << "+ define " << constructor << std::endl;
string constructorName = ctor.getName();
if(consNames.find(constructorName)==consNames.end()) {
if(!doOverload) {
if (getTesterName(constructor, testerName))
{
api::Term tester = ctor.getTesterTerm();
- Debug("parser-idt") << "+ define " << testerName << std::endl;
+ Trace("parser-idt") << "+ define " << testerName << std::endl;
if (!doOverload)
{
checkDeclaration(testerName, CHECK_UNDECLARED);
{
const api::DatatypeSelector& sel = ctor[k];
api::Term selector = sel.getSelectorTerm();
- Debug("parser-idt") << "+++ define " << selector << std::endl;
+ Trace("parser-idt") << "+++ define " << selector << std::endl;
string selectorName = sel.getName();
if(selNames.find(selectorName)==selNames.end()) {
if(!doOverload) {
// no difference
return range;
}
- if (Debug.isOn("parser"))
+ if (TraceIsOn("parser"))
{
- Debug("parser") << "mkFlatFunctionType: range " << range << " and domains ";
+ Trace("parser") << "mkFlatFunctionType: range " << range << " and domains ";
for (api::Sort t : sorts)
{
- Debug("parser") << " " << t;
+ Trace("parser") << " " << t;
}
- Debug("parser") << "\n";
+ Trace("parser") << "\n";
}
while (range.isFunction())
{
void Parser::preemptCommand(Command* cmd) { d_commandQueue.push_back(cmd); }
Command* Parser::nextCommand()
{
- Debug("parser") << "nextCommand()" << std::endl;
+ Trace("parser") << "nextCommand()" << std::endl;
Command* cmd = NULL;
if (!d_commandQueue.empty()) {
cmd = d_commandQueue.front();
parseError(e.what());
}
}
- Debug("parser") << "nextCommand() => " << cmd << std::endl;
+ Trace("parser") << "nextCommand() => " << cmd << std::endl;
return cmd;
}
api::Term Parser::nextExpression()
{
- Debug("parser") << "nextExpression()" << std::endl;
+ Trace("parser") << "nextExpression()" << std::endl;
api::Term result;
if (!done()) {
try {
parseError(e.what());
}
}
- Debug("parser") << "nextExpression() => " << result << std::endl;
+ Trace("parser") << "nextExpression() => " << result << std::endl;
return result;
}
symbol[name,CHECK_UNDECLARED,SYM_SORT]
{ PARSER_STATE->checkUserSymbol(name); }
n=INTEGER_LITERAL
- { Debug("parser") << "declare sort: '" << name
+ { Trace("parser") << "declare sort: '" << name
<< "' arity=" << n << std::endl;
unsigned arity = AntlrInput::tokenToUnsigned(n);
if(arity == 0) {
{ PARSER_STATE->checkUserSymbol(name); }
LPAREN_TOK sortList[sorts] RPAREN_TOK
sortSymbol[t,CHECK_DECLARED]
- { Debug("parser") << "declare fun: '" << name << "'" << std::endl;
+ { Trace("parser") << "declare fun: '" << name << "'" << std::endl;
if( !sorts.empty() ) {
t = PARSER_STATE->mkFlatFunctionType(sorts, t);
}
LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK
sortSymbol[t,CHECK_DECLARED]
{ /* add variables to parser state before parsing term */
- Debug("parser") << "define fun: '" << name << "'" << std::endl;
+ Trace("parser") << "define fun: '" << name << "'" << std::endl;
if( sortedVarNames.size() > 0 ) {
sorts.reserve(sortedVarNames.size());
for(std::vector<std::pair<std::string, api::Sort> >::const_iterator i =
sygusGrammar[grammar, sygusVars, name]
)?
{
- Debug("parser-sygus") << "Define synth fun : " << name << std::endl;
+ Trace("parser-sygus") << "Define synth fun : " << name << std::endl;
fun = isInv ? (grammar == nullptr
? SOLVER->synthInv(name, sygusVars)
? SOLVER->synthFun(name, sygusVars, range)
: SOLVER->synthFun(name, sygusVars, range, *grammar));
- Debug("parser-sygus") << "...read synth fun " << name << std::endl;
+ Trace("parser-sygus") << "...read synth fun " << name << std::endl;
PARSER_STATE->popScope();
// we do not allow overloading for synth fun
PARSER_STATE->defineVar(name, fun);
PARSER_STATE->checkThatLogicIsSet();
}
term[expr, expr2]
- { Debug("parser-sygus") << "...read constraint " << expr << std::endl;
+ { Trace("parser-sygus") << "...read constraint " << expr << std::endl;
cmd.reset(new SygusConstraintCommand(expr, isAssume));
}
| /* inv-constraint */
( term[e, e2]
{ terms.push_back( e ); }
)* RPAREN_TOK
- { Debug("parser") << "declare pool: '" << name << "'" << std::endl;
+ { Trace("parser") << "declare pool: '" << name << "'" << std::endl;
api::Term pool = SOLVER->declarePool(name, t, terms);
PARSER_STATE->defineVar(name, pool);
cmd->reset(new DeclarePoolCommand(name, pool, t, terms));
LPAREN_TOK /* datatype definition prelude */
( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n=INTEGER_LITERAL RPAREN_TOK
{ unsigned arity = AntlrInput::tokenToUnsigned(n);
- Debug("parser-dt") << "Datatype : " << name << ", arity = " << arity << std::endl;
+ Trace("parser-dt") << "Datatype : " << name << ", arity = " << arity << std::endl;
dnames.push_back(name);
arities.push_back( static_cast<int>(arity) );
}
}
( LPAREN_TOK {
params.clear();
- Debug("parser-dt") << "Processing datatype #" << dts.size() << std::endl;
+ Trace("parser-dt") << "Processing datatype #" << dts.size() << std::endl;
if( dts.size()>=dnames.size() ){
PARSER_STATE->parseError("Too many datatypes defined in this block.");
}
// now declare it as an unresolved type
PARSER_STATE->mkUnresolvedType(dnames[dts.size()], params.size());
}
- Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
+ Trace("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()], params, isCo));
}
LPAREN_TOK
// now declare it as an unresolved type
PARSER_STATE->mkUnresolvedType(dnames[dts.size()], 0);
}
- Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
+ Trace("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()],
params,
isCo));
*/
termNonVariable[cvc5::api::Term& expr, cvc5::api::Term& expr2]
@init {
- Debug("parser") << "term: " << AntlrInput::tokenText(LT(1)) << std::endl;
+ Trace("parser") << "term: " << AntlrInput::tokenText(LT(1)) << std::endl;
api::Kind kind = api::NULL_EXPR;
std::string name;
std::vector<cvc5::api::Term> args;
PARSER_STATE->pushScope();
// f should be a constructor
type = f.getSort();
- Debug("parser-dt") << "Pattern head : " << f << " " << type << std::endl;
+ Trace("parser-dt") << "Pattern head : " << f << " " << type << std::endl;
if (!type.isConstructor())
{
PARSER_STATE->parseError("Pattern must be application of a constructor or a variable.");
quantOp[cvc5::api::Kind& kind]
@init {
- Debug("parser") << "quant: " << AntlrInput::tokenText(LT(1)) << std::endl;
+ Trace("parser") << "quant: " << AntlrInput::tokenText(LT(1)) << std::endl;
}
: EXISTS_TOK { $kind = api::EXISTS; }
| FORALL_TOK { $kind = api::FORALL; }
// make unresolved type
if(args.empty()) {
t = PARSER_STATE->mkUnresolvedType(name);
- Debug("parser-param") << "param: make unres type " << name
+ Trace("parser-param") << "param: make unres type " << name
<< std::endl;
} else {
t = PARSER_STATE->mkUnresolvedTypeConstructor(name,args);
t = t.instantiate( args );
- Debug("parser-param")
+ Trace("parser-param")
<< "param: make unres param type " << name << " " << args.size()
<< " " << PARSER_STATE->getArity( name ) << std::endl;
}
( LPAREN_TOK selector[*ctor] RPAREN_TOK )*
{ // make the constructor
type.addConstructor(*ctor);
- Debug("parser-idt") << "constructor: " << id.c_str() << std::endl;
+ Trace("parser-idt") << "constructor: " << id.c_str() << std::endl;
delete ctor;
}
;
: symbol[id,CHECK_NONE,SYM_SORT] sortSymbol[t,CHECK_NONE]
{
ctor.addSelector(id, t);
- Debug("parser-idt") << "selector: " << id.c_str()
+ Trace("parser-idt") << "selector: " << id.c_str()
<< " of type " << t << std::endl;
}
;
char *start = (char*) GETCHARINDEX();
}
: DIGIT+
- { Debug("parser-extra") << "NUMERAL: "
+ { Trace("parser-extra") << "NUMERAL: "
<< (uintptr_t)start << ".." << GETCHARINDEX()
<< " strict? " << (bool)(PARSER_STATE->strictModeEnabled())
<< " ^0? " << (bool)(*start == '0')
void Smt2::addOperator(api::Kind kind, const std::string& name)
{
- Debug("parser") << "Smt2::addOperator( " << kind << ", " << name << " )"
+ Trace("parser") << "Smt2::addOperator( " << kind << ", " << name << " )"
<< std::endl;
Parser::addOperator(kind);
d_operatorKindMap[name] = kind;
const std::vector<std::string>& names)
{
checkThatLogicIsSet();
- Debug("parser-sygus") << "Sygus : define sygus funs..." << std::endl;
- Debug("parser-sygus") << "Sygus : read inv-constraint..." << std::endl;
+ Trace("parser-sygus") << "Sygus : define sygus funs..." << std::endl;
+ Trace("parser-sygus") << "Sygus : read inv-constraint..." << std::endl;
if (names.size() != 4)
{
// Inspired by http://www.antlr3.org/api/C/interop.html
static bool newInputStream(const std::string& filename, pANTLR3_LEXER lexer) {
- Debug("parser") << "Including " << filename << std::endl;
+ Trace("parser") << "Including " << filename << std::endl;
// Create a new input stream and take advantage of built in stream stacking
// in C target runtime.
//
in = antlr3FileStreamNew((pANTLR3_UINT8) filename.c_str(), ANTLR3_ENC_8BIT);
#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */
if( in == NULL ) {
- Debug("parser") << "Can't open " << filename << std::endl;
+ Trace("parser") << "Can't open " << filename << std::endl;
return false;
}
// Same thing as the predefined PUSHSTREAM(in);
void Smt2::parseOpApplyTypeAscription(ParseOp& p, api::Sort type)
{
- Debug("parser") << "parseOpApplyTypeAscription : " << p << " " << type
+ Trace("parser") << "parseOpApplyTypeAscription : " << p << " " << type
<< std::endl;
// (as const (Array T1 T2))
if (p.d_kind == api::CONST_ARRAY)
// the builtin kind of the overall return expression
api::Kind kind = api::NULL_EXPR;
// First phase: process the operator
- if (Debug.isOn("parser"))
+ if (TraceIsOn("parser"))
{
- Debug("parser") << "applyParseOp: " << p << " to:" << std::endl;
+ Trace("parser") << "applyParseOp: " << p << " to:" << std::endl;
for (std::vector<api::Term>::iterator i = args.begin(); i != args.end();
++i)
{
- Debug("parser") << "++ " << *i << std::endl;
+ Trace("parser") << "++ " << *i << std::endl;
}
}
api::Op op;
// Testers are handled differently than other indexed operators,
// since they require a kind.
kind = fkind;
- Debug("parser") << "Got function kind " << kind << " for expression "
+ Trace("parser") << "Got function kind " << kind << " for expression "
<< std::endl;
}
args.insert(args.begin(), p.d_expr);
{
// a builtin operator, convert to kind
kind = getOperatorKind(p.d_name);
- Debug("parser") << "Got builtin kind " << kind << " for name"
+ Trace("parser") << "Got builtin kind " << kind << " for name"
<< std::endl;
}
else
parseError(ss.str());
}
api::Term ret = d_solver->mkConstArray(p.d_type, constVal);
- Debug("parser") << "applyParseOp: return store all " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return store all " << ret << std::endl;
return ret;
}
else if ((p.d_kind == api::APPLY_SELECTOR || p.d_kind == api::APPLY_UPDATER)
ret = d_solver->mkTerm(
api::APPLY_UPDATER, dt[0][n].getUpdaterTerm(), args[0], args[1]);
}
- Debug("parser") << "applyParseOp: return selector " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return selector " << ret << std::endl;
return ret;
}
else if (p.d_kind == api::TUPLE_PROJECT)
{
api::Term ret = d_solver->mkTerm(p.d_op, args);
- Debug("parser") << "applyParseOp: return projection " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return projection " << ret << std::endl;
return ret;
}
else if (p.d_kind != api::NULL_EXPR)
&& args.size() == 1)
{
// Unary AND/OR can be replaced with the argument.
- Debug("parser") << "applyParseOp: return unary " << args[0] << std::endl;
+ Trace("parser") << "applyParseOp: return unary " << args[0] << std::endl;
return args[0];
}
else if (kind == api::SUB && args.size() == 1)
std::stringstream suminus;
suminus << "-" << args[0].getIntegerValue();
api::Term ret = d_solver->mkInteger(suminus.str());
- Debug("parser") << "applyParseOp: return negative constant " << ret
+ Trace("parser") << "applyParseOp: return negative constant " << ret
<< std::endl;
return ret;
}
api::Term ret = d_solver->mkTerm(api::NEG, args[0]);
- Debug("parser") << "applyParseOp: return uminus " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return uminus " << ret << std::endl;
return ret;
}
else if (kind == api::DIVISION && args.size() == 2 && isConstInt(args[0])
std::stringstream sdiv;
sdiv << args[0].getIntegerValue() << "/" << args[1].getIntegerValue();
api::Term ret = d_solver->mkReal(sdiv.str());
- Debug("parser") << "applyParseOp: return rational constant " << ret
+ Trace("parser") << "applyParseOp: return rational constant " << ret
<< std::endl;
return ret;
}
if (kind == api::SET_SINGLETON && args.size() == 1)
{
api::Term ret = d_solver->mkTerm(api::SET_SINGLETON, args[0]);
- Debug("parser") << "applyParseOp: return set.singleton " << ret
+ Trace("parser") << "applyParseOp: return set.singleton " << ret
<< std::endl;
return ret;
}
return ret;
}
api::Term ret = d_solver->mkTerm(kind, args);
- Debug("parser") << "applyParseOp: return default builtin " << ret
+ Trace("parser") << "applyParseOp: return default builtin " << ret
<< std::endl;
return ret;
}
"Cannot partially apply functions unless logic is prefixed by "
"HO_.");
}
- Debug("parser") << "Partial application of " << args[0];
- Debug("parser") << " : #argTypes = " << arity;
- Debug("parser") << ", #args = " << args.size() - 1 << std::endl;
+ Trace("parser") << "Partial application of " << args[0];
+ Trace("parser") << " : #argTypes = " << arity;
+ Trace("parser") << ", #args = " << args.size() - 1 << std::endl;
api::Term ret = d_solver->mkTerm(api::HO_APPLY, args);
- Debug("parser") << "applyParseOp: return curry higher order " << ret
+ Trace("parser") << "applyParseOp: return curry higher order " << ret
<< std::endl;
// must curry the partial application
return ret;
if (!op.isNull())
{
api::Term ret = d_solver->mkTerm(op, args);
- Debug("parser") << "applyParseOp: return op : " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return op : " << ret << std::endl;
return ret;
}
if (kind == api::NULL_EXPR)
// should never happen in the new API
parseError("do not know how to process parse op");
}
- Debug("parser") << "Try default term construction for kind " << kind
+ Trace("parser") << "Try default term construction for kind " << kind
<< " #args = " << args.size() << "..." << std::endl;
api::Term ret = d_solver->mkTerm(kind, args);
- Debug("parser") << "applyParseOp: return : " << ret << std::endl;
+ Trace("parser") << "applyParseOp: return : " << ret << std::endl;
return ret;
}
// Inspired by http://www.antlr3.org/api/C/interop.html
bool newInputStream(std::string fileName, pANTLR3_LEXER lexer, std::vector< pANTLR3_INPUT_STREAM >& inc ) {
- Debug("parser") << "Including " << fileName << std::endl;
+ Trace("parser") << "Including " << fileName << std::endl;
// Create a new input stream and take advantage of built in stream stacking
// in C target runtime.
//
in = antlr3FileStreamNew((pANTLR3_UINT8) fileName.c_str(), ANTLR3_ENC_8BIT);
#endif /* CVC5_ANTLR3_OLD_INPUT_STREAM */
if(in == NULL) {
- Debug("parser") << "Can't open " << fileName << std::endl;
+ Trace("parser") << "Can't open " << fileName << std::endl;
return false;
}
// Same thing as the predefined PUSHSTREAM(in);
api::Term Tptp::applyParseOp(ParseOp& p, std::vector<api::Term>& args)
{
- if (Debug.isOn("parser"))
+ if (TraceIsOn("parser"))
{
- Debug("parser") << "applyParseOp: " << p << " to:" << std::endl;
+ Trace("parser") << "applyParseOp: " << p << " to:" << std::endl;
for (std::vector<api::Term>::iterator i = args.begin(); i != args.end();
++i)
{
- Debug("parser") << "++ " << *i << std::endl;
+ Trace("parser") << "++ " << *i << std::endl;
}
}
Assert(!args.empty());
{
parseError("Cannot partially apply functions unless THF.");
}
- Debug("parser") << "Partial application of " << args[0];
- Debug("parser") << " : #argTypes = " << arity;
- Debug("parser") << ", #args = " << args.size() - 1 << std::endl;
+ Trace("parser") << "Partial application of " << args[0];
+ Trace("parser") << " : #argTypes = " << arity;
+ Trace("parser") << ", #args = " << args.size() - 1 << std::endl;
// must curry the partial application
return d_solver->mkTerm(api::HO_APPLY, args);
}
api::Term Tptp::mkLambdaWrapper(api::Kind k, api::Sort argType)
{
- Debug("parser") << "mkLambdaWrapper: kind " << k << " and type " << argType
+ Trace("parser") << "mkLambdaWrapper: kind " << k << " and type " << argType
<< "\n";
std::vector<api::Term> lvars;
std::vector<api::Sort> domainTypes = argType.getFunctionDomainSorts();
TNode n = to_visit.back();
to_visit.pop_back();
- Debug("bool-to-bv") << "BoolToBV::lowerNode: Post-order traversal with "
+ Trace("bool-to-bv") << "BoolToBV::lowerNode: Post-order traversal with "
<< n << " and visited = " << ContainsKey(visited, n)
<< std::endl;
}
}
- Debug("bool-to-bv") << "safe_to_lower = " << safe_to_lower
+ Trace("bool-to-bv") << "safe_to_lower = " << safe_to_lower
<< ", safe_to_rebuild = " << safe_to_rebuild << std::endl;
if (new_kind != k && safe_to_lower)
fromCache(n),
bv::utils::mkOne(1),
bv::utils::mkZero(1)));
- Debug("bool-to-bv") << "BoolToBV::visit forcing " << n
+ Trace("bool-to-bv") << "BoolToBV::visit forcing " << n
<< " =>\n"
<< fromCache(n) << std::endl;
if (d_boolToBVMode == options::BoolToBVMode::ALL)
// with ITE introductions
updateCache(
n, nm->mkNode(kind::ITE, n, bv::utils::mkOne(1), bv::utils::mkZero(1)));
- Debug("bool-to-bv") << "BoolToBV::visit forcing " << n
+ Trace("bool-to-bv") << "BoolToBV::visit forcing " << n
<< " =>\n"
<< fromCache(n) << std::endl;
if (d_boolToBVMode == options::BoolToBVMode::ALL)
else
{
// do nothing
- Debug("bool-to-bv") << "BoolToBV::visit skipping: " << n
+ Trace("bool-to-bv") << "BoolToBV::visit skipping: " << n
<< std::endl;
}
}
TNode n = visit.back();
visit.pop_back();
- Debug("bool-to-bv") << "BoolToBV::lowerIte: Post-order traversal with " << n
+ Trace("bool-to-bv") << "BoolToBV::lowerIte: Post-order traversal with " << n
<< " and visited = " << ContainsKey(visited, n)
<< std::endl;
{
if ((n.getKind() == kind::ITE) && n[1].getType().isBitVector())
{
- Debug("bool-to-bv") << "BoolToBV::lowerIte: adding " << n[0]
+ Trace("bool-to-bv") << "BoolToBV::lowerIte: adding " << n[0]
<< " to set of ite conditions" << std::endl;
// don't force in this case -- forcing only introduces more ITEs
Node loweredNode = lowerNode(n, false);
}
else
{
- Debug("bool-to-bv")
+ Trace("bool-to-bv")
<< "BoolToBV::lowerIte Skipping because don't need to rebuild: " << n
<< std::endl;
}
NodeManager* nm = NodeManager::currentNM();
NodeBuilder builder(new_kind);
- Debug("bool-to-bv") << "BoolToBV::rebuildNode with " << n
+ Trace("bool-to-bv") << "BoolToBV::rebuildNode with " << n
<< " and new_kind = " << kindToString(new_kind)
<< std::endl;
}
}
- Debug("bool-to-bv") << "BoolToBV::rebuildNode " << n << " =>\n"
+ Trace("bool-to-bv") << "BoolToBV::rebuildNode " << n << " =>\n"
<< builder << std::endl;
updateCache(n, builder.constructNode());
Node a = convertBvTerm(node[0]);
Node b = convertBvTerm(node[1]);
Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, b);
- Debug("bv-to-bool") << "BVToBool::convertBvAtom " << node << " => " << result
+ Trace("bv-to-bool") << "BVToBool::convertBvAtom " << node << " => " << result
<< "\n";
++(d_statistics.d_numAtomsLifted);
++(d_statistics.d_numTermsForcedLifted);
Node result = nm->mkNode(kind::EQUAL, node, d_one);
addToBoolCache(node, result);
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
<< result << "\n";
return result;
}
Assert(node.getKind() == kind::CONST_BITVECTOR);
Node result = node == d_one ? bv::utils::mkTrue() : bv::utils::mkFalse();
// addToCache(node, result);
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
<< result << "\n";
return result;
}
Node false_branch = convertBvTerm(node[2]);
Node result = nm->mkNode(kind::ITE, cond, true_branch, false_branch);
addToBoolCache(node, result);
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
<< result << "\n";
return result;
}
Node converted = convertBvTerm(node[i]);
result = nm->mkNode(kind::XOR, result, converted);
}
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
<< result << "\n";
return result;
}
{
Node result = nm->mkNode(kind::EQUAL, node[0], node[1]);
addToBoolCache(node, result);
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => "
<< result << "\n";
return result;
}
Node result = builder;
addToBoolCache(node, result);
- Debug("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result
+ Trace("bv-to-bool") << "BVToBool::convertBvTerm " << node << " => " << result
<< "\n";
return result;
}
}
Assert(result != Node());
Assert(result.getType() == current.getType());
- Debug("bv-to-bool") << "BVToBool::liftNode " << current << " => \n"
+ Trace("bv-to-bool") << "BVToBool::liftNode " << current << " => \n"
<< result << "\n";
return result;
}
{
anyItes = true;
Node res = aiteu.reduceVariablesInItes(curr);
- Debug("arith::ite::red") << "@ " << i << " ... " << curr << endl
+ Trace("arith::ite::red") << "@ " << i << " ... " << curr << endl
<< " ->" << res << endl;
if (curr != res)
{
Node more = aiteu.reduceConstantIteByGCD(res);
- Debug("arith::ite::red") << " gcd->" << more << endl;
+ Trace("arith::ite::red") << " gcd->" << more << endl;
Node morer = rewrite(more);
assertionsToPreprocess->replace(i, morer);
}
Node curr = (*assertionsToPreprocess)[i];
Node next = rewrite(aiteu.applySubstitutions(curr));
Node res = aiteu.reduceVariablesInItes(next);
- Debug("arith::ite::red") << "@ " << i << " ... " << next << endl
+ Trace("arith::ite::red") << "@ " << i << " ... " << next << endl
<< " ->" << res << endl;
Node more = aiteu.reduceConstantIteByGCD(res);
- Debug("arith::ite::red") << " gcd->" << more << endl;
+ Trace("arith::ite::red") << " gcd->" << more << endl;
if (more != next)
{
anySuccess = true;
Node curr = (*assertionsToPreprocess)[i];
Node next = rewrite(aiteu.applySubstitutions(curr));
Node res = aiteu.reduceVariablesInItes(next);
- Debug("arith::ite::red") << "@ " << i << " ... " << next << endl
+ Trace("arith::ite::red") << "@ " << i << " ... " << next << endl
<< " ->" << res << endl;
Node more = aiteu.reduceConstantIteByGCD(res);
- Debug("arith::ite::red") << " gcd->" << more << endl;
+ Trace("arith::ite::red") << " gcd->" << more << endl;
Node morer = rewrite(more);
assertionsToPreprocess->replace(i, morer);
}
bool lbSuccess = true;
bool ubSuccess = true;
Rational one(1);
- if (Trace.isOn("learned-rewrite-arith-lit"))
+ if (TraceIsOn("learned-rewrite-arith-lit"))
{
Trace("learned-rewrite-arith-lit")
<< "Arithmetic lit: " << nr << std::endl;
Node LearnedRewrite::returnRewriteLearned(Node n, Node nr, LearnedRewriteId id)
{
- if (Trace.isOn("learned-rewrite"))
+ if (TraceIsOn("learned-rewrite"))
{
Trace("learned-rewrite") << "LearnedRewrite::Rewrite: (" << id << ") " << n
<< " == " << nr << std::endl;
{
if (propagator->isAssigned(v0))
{
- Debug("miplib") << "ineligible: " << v0 << " because assigned "
+ Trace("miplib") << "ineligible: " << v0 << " because assigned "
<< propagator->getAssignment(v0) << endl;
continue;
}
assertions.push_back(v0);
}
}
- Debug("miplib") << "for " << v0 << endl;
+ Trace("miplib") << "for " << v0 << endl;
bool eligible = true;
map<pair<Node, Node>, uint64_t> marks;
map<pair<Node, Node>, vector<Rational> > coef;
j1 != assertions.end();
++j1)
{
- Debug("miplib") << " found: " << *j1 << endl;
+ Trace("miplib") << " found: " << *j1 << endl;
if ((*j1).getKind() != kind::IMPLIES)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (not =>)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (not =>)" << endl;
break;
}
Node conj = BooleanSimplification::simplify((*j1)[0]);
if (conj.getKind() == kind::AND && conj.getNumChildren() > 6)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (N-ary /\\ too big)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (N-ary /\\ too big)" << endl;
break;
}
if (conj.getKind() != kind::AND && !conj.isVar()
&& !(conj.getKind() == kind::NOT && conj[0].isVar()))
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (not /\\ or literal)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (not /\\ or literal)" << endl;
break;
}
if ((*j1)[1].getKind() != kind::EQUAL
|| ((*j1)[1][0].isConst() && (*j1)[1][1].isVar())))
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (=> (and X X) X)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (=> (and X X) X)" << endl;
break;
}
if (conj.getKind() == kind::AND)
else
{
eligible = false;
- Debug("miplib")
+ Trace("miplib")
<< " -- INELIGIBLE -- (non-var: " << *ii << ")" << endl;
break;
}
if (propagator->isAssigned(posv.back()))
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (" << posv.back()
+ Trace("miplib") << " -- INELIGIBLE -- (" << posv.back()
<< " asserted)" << endl;
break;
}
if (!found_x)
{
eligible = false;
- Debug("miplib") << " --INELIGIBLE -- (couldn't find " << v0
+ Trace("miplib") << " --INELIGIBLE -- (couldn't find " << v0
<< " in conjunction)" << endl;
break;
}
if ((marks[pos_var] & (1lu << mark)) != 0)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (remarked)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (remarked)" << endl;
break;
}
- Debug("miplib") << "mark is " << mark << " -- " << (1lu << mark)
+ Trace("miplib") << "mark is " << mark << " -- " << (1lu << mark)
<< endl;
marks[pos_var] |= (1lu << mark);
- Debug("miplib") << "marks[" << pos << "," << var << "] now "
+ Trace("miplib") << "marks[" << pos << "," << var << "] now "
<< marks[pos_var] << endl;
if (countneg == pos.getNumChildren())
{
if (constant != 0)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl;
break;
}
}
if (x != v0 && x != (v0).notNode())
{
eligible = false;
- Debug("miplib")
+ Trace("miplib")
<< " -- INELIGIBLE -- (x not present where I expect it)" << endl;
break;
}
const bool xneg = (x.getKind() == kind::NOT);
x = xneg ? x[0] : x;
- Debug("miplib") << " x:" << x << " " << xneg << endl;
+ Trace("miplib") << " x:" << x << " " << xneg << endl;
const TNode var = ((*j1)[1][0].isConst()) ? (*j1)[1][1] : (*j1)[1][0];
const pair<Node, Node> x_var(x, var);
const Rational& constant = ((*j1)[1][0].isConst())
if ((marks[x_var] & (1u << mark)) != 0)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (remarked)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (remarked)" << endl;
break;
}
marks[x_var] |= (1u << mark);
if (constant != 0)
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl;
+ Trace("miplib") << " -- INELIGIBLE -- (nonzero constant)" << endl;
break;
}
}
pos.getKind() == kind::AND ? pos.getNumChildren() : 1;
uint64_t expected = (uint64_t(1) << (1 << numVars)) - 1;
expected = (expected == 0) ? -1 : expected; // fix for overflow
- Debug("miplib") << "[" << pos << "] => " << hex << mark << " expect "
+ Trace("miplib") << "[" << pos << "] => " << hex << mark << " expect "
<< expected << dec << endl;
Assert(pos.getKind() == kind::AND || pos.isVar());
if (mark != expected)
{
- Debug("miplib") << " -- INELIGIBLE " << pos
+ Trace("miplib") << " -- INELIGIBLE " << pos
<< " -- (insufficiently marked, got " << mark
<< " for " << numVars << " vars, expected "
<< expected << endl;
if ((k & (k - 1)) != 0)
{
Rational sum = 0;
- Debug("miplib") << k << " => " << checks[pos_var][k] << endl;
+ Trace("miplib") << k << " => " << checks[pos_var][k] << endl;
for (size_t v1 = 1, kk = k; kk != 0; ++v1, kk >>= 1)
{
if ((kk & 0x1) == 1)
{
Assert(pos.getKind() == kind::AND);
- Debug("miplib")
+ Trace("miplib")
<< "var " << v1 << " : " << pos[v1 - 1]
<< " coef:" << coef[pos_var][v1 - 1] << endl;
sum += coef[pos_var][v1 - 1];
}
}
- Debug("miplib") << "checkSum is " << sum << " input says "
+ Trace("miplib") << "checkSum is " << sum << " input says "
<< checks[pos_var][k] << endl;
if (sum != checks[pos_var][k])
{
eligible = false;
- Debug("miplib") << " -- INELIGIBLE " << pos
+ Trace("miplib") << " -- INELIGIBLE " << pos
<< " -- (nonlinear combination)" << endl;
break;
}
continue;
}
- Debug("miplib") << " -- ELIGIBLE " << v0 << " , " << pos << " --"
+ Trace("miplib") << " -- ELIGIBLE " << v0 << " , " << pos << " --"
<< endl;
vector<Node> newVars;
expr::NodeSelfIterator ii, iiend;
sum = nm->mkNode(
kind::MULT, nm->mkConstInt(coef[pos_var][0]), newVars[0]);
}
- Debug("miplib") << "vars[] " << var << endl
+ Trace("miplib") << "vars[] " << var << endl
<< " eq " << rewrite(sum) << endl;
Node newAssertion = var.eqNode(rewrite(sum));
if (top_level_substs.hasSubstitution(newAssertion[0]))
<= options().arith.arithMLTrickSubstitutions)
{
top_level_substs.addSubstitution(newAssertion[0], newAssertion[1]);
- Debug("miplib") << "addSubs: " << newAssertion[0] << " to "
+ Trace("miplib") << "addSubs: " << newAssertion[0] << " to "
<< newAssertion[1] << endl;
}
else
{
- Debug("miplib")
+ Trace("miplib")
<< "skipSubs: " << newAssertion[0] << " to " << newAssertion[1]
<< " (threshold is "
<< options().arith.arithMLTrickSubstitutions << ")" << endl;
}
newAssertion = rewrite(newAssertion);
- Debug("miplib") << " " << newAssertion << endl;
+ Trace("miplib") << " " << newAssertion << endl;
assertionsToPreprocess->push_back(newAssertion);
- Debug("miplib") << " assertions to remove: " << endl;
+ Trace("miplib") << " assertions to remove: " << endl;
for (vector<TNode>::const_iterator k = asserts[pos_var].begin(),
k_end = asserts[pos_var].end();
k != k_end;
++k)
{
- Debug("miplib") << " " << *k << endl;
+ Trace("miplib") << " " << *k << endl;
removeAssertions.insert((*k).getId());
}
}
}
if (!removeAssertions.empty())
{
- Debug("miplib") << " scrubbing miplib encoding..." << endl;
+ Trace("miplib") << " scrubbing miplib encoding..." << endl;
for (size_t i = 0, size = assertionsToPreprocess->getRealAssertionsEnd();
i < size;
++i)
Node assertion = (*assertionsToPreprocess)[i];
if (removeAssertions.find(assertion.getId()) != removeAssertions.end())
{
- Debug("miplib") << " - removing " << assertion << endl;
+ Trace("miplib") << " - removing " << assertion << endl;
assertionsToPreprocess->replace(i, trueNode);
++d_statistics.d_numMiplibAssertionsRemoved;
}
size_t removals = removeFromConjunction(assertion, removeAssertions);
if (removals > 0)
{
- Debug("miplib") << " - reduced " << assertion << endl;
- Debug("miplib") << " - by " << removals << " conjuncts" << endl;
+ Trace("miplib") << " - reduced " << assertion << endl;
+ Trace("miplib") << " - by " << removals << " conjuncts" << endl;
d_statistics.d_numMiplibAssertionsRemoved += removals;
}
}
- Debug("miplib") << "had: " << assertion << endl;
+ Trace("miplib") << "had: " << assertion << endl;
assertionsToPreprocess->replace(
i, rewrite(top_level_substs.apply(assertion)));
- Debug("miplib") << "now: " << assertion << endl;
+ Trace("miplib") << "now: " << assertion << endl;
}
}
else
{
- Debug("miplib") << " miplib pass found nothing." << endl;
+ Trace("miplib") << " miplib pass found nothing." << endl;
}
assertionsToPreprocess->updateRealAssertionsEnd();
return PreprocessingPassResult::NO_CONFLICT;
{
d_preprocContext->spendResource(Resource::PreprocessStep);
- if (Trace.isOn("non-clausal-simplify"))
+ if (TraceIsOn("non-clausal-simplify"))
{
for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
{
}
Trace("non-clausal-simplify")
<< "asserting " << (*assertionsToPreprocess)[i] << std::endl;
- Debug("cores") << "propagator->assertTrue: " << (*assertionsToPreprocess)[i]
+ Trace("cores") << "propagator->assertTrue: " << (*assertionsToPreprocess)[i]
<< std::endl;
propagator->assertTrue((*assertionsToPreprocess)[i]);
}
}
Assert(assertion.getKind() == kind::GEQ);
- Debug("pbs::rewrites") << "decomposeAssertion" << assertion << std::endl;
+ Trace("pbs::rewrites") << "decomposeAssertion" << assertion << std::endl;
Node l = assertion[0];
Node r = assertion[1];
if (!r.isConst())
{
- Debug("pbs::rewrites") << "not rhs constant" << assertion << std::endl;
+ Trace("pbs::rewrites") << "not rhs constant" << assertion << std::endl;
return false;
}
// don't bother matching on anything other than + on the left hand side
if (l.getKind() != kind::ADD)
{
- Debug("pbs::rewrites") << "not plus" << assertion << std::endl;
+ Trace("pbs::rewrites") << "not plus" << assertion << std::endl;
return false;
}
if (!Polynomial::isMember(l))
{
- Debug("pbs::rewrites") << "not polynomial" << assertion << std::endl;
+ Trace("pbs::rewrites") << "not polynomial" << assertion << std::endl;
return false;
}
Assert(!exp.isNull());
CDNode2PairMap::const_iterator ci = d_pbBounds.find(v);
- Debug("pbs::rewrites") << "addGeqZero " << v << std::endl;
+ Trace("pbs::rewrites") << "addGeqZero " << v << std::endl;
if (ci == d_pbBounds.end())
{
{
Assert(!p.second.isNull());
d_pbBounds.insert(v, std::make_pair(exp, p.second));
- Debug("pbs::rewrites") << "add pbs " << v << std::endl;
+ Trace("pbs::rewrites") << "add pbs " << v << std::endl;
Assert(isPseudoBoolean(v));
d_pbs = d_pbs + 1;
}
{
Assert(isIntVar(v));
Assert(!exp.isNull());
- Debug("pbs::rewrites") << "addLeqOne " << v << std::endl;
+ Trace("pbs::rewrites") << "addLeqOne " << v << std::endl;
CDNode2PairMap::const_iterator ci = d_pbBounds.find(v);
if (ci == d_pbBounds.end())
{
{
Assert(!p.first.isNull());
d_pbBounds.insert(v, std::make_pair(p.first, exp));
- Debug("pbs::rewrites") << "add pbs " << v << std::endl;
+ Trace("pbs::rewrites") << "add pbs " << v << std::endl;
Assert(isPseudoBoolean(v));
d_pbs = d_pbs + 1;
}
bool success = decomposeAssertion(geq, negated);
if (!success)
{
- Debug("pbs::rewrites") << "failed " << std::endl;
+ Trace("pbs::rewrites") << "failed " << std::endl;
return;
}
Assert(d_off.value().isIntegral());
Node assertion = rewrite(pre);
Node result = d_subCache.apply(assertion);
- if (Debug.isOn("pbs::rewrites") && result != assertion)
+ if (TraceIsOn("pbs::rewrites") && result != assertion)
{
- Debug("pbs::rewrites") << "applyReplacements" << assertion << "-> "
+ Trace("pbs::rewrites") << "applyReplacements" << assertion << "-> "
<< result << std::endl;
}
return result;
{
d_statistics.d_maxNonConstantsFolded.maxAssign(
search.nonConstants.size());
- Debug("ite::simpite") << "used " << search.nonConstants.size()
+ Trace("ite::simpite") << "used " << search.nonConstants.size()
<< " nonconstants" << endl;
NodeManager* nm = NodeManager::currentNM();
Node simpVar = getSimpVar(notIte.getType());
{
static int instance = 0;
++instance;
- Debug("ite::constantIteEqualsConstant")
+ Trace("ite::constantIteEqualsConstant")
<< instance << "constantIteEqualsConstant(" << cite << ", " << constant
<< ")" << endl;
if (cite.isConst())
{
Node res = (cite == constant) ? d_true : d_false;
- Debug("ite::constantIteEqualsConstant") << instance << "->" << res << endl;
+ Trace("ite::constantIteEqualsConstant") << instance << "->" << res << endl;
return res;
}
std::pair<Node, Node> pair = make_pair(cite, constant);
d_constantIteEqualsConstantCache.find(pair);
if (eq_pos != d_constantIteEqualsConstantCache.end())
{
- Debug("ite::constantIteEqualsConstant")
+ Trace("ite::constantIteEqualsConstant")
<< instance << "->" << (*eq_pos).second << endl;
return (*eq_pos).second;
}
{
// probably unreachable
d_constantIteEqualsConstantCache[pair] = d_true;
- Debug("ite::constantIteEqualsConstant")
+ Trace("ite::constantIteEqualsConstant")
<< instance << "->" << d_true << endl;
return d_true;
}
}
++itesMade;
d_constantIteEqualsConstantCache[pair] = boolIte;
- // Debug("ite::constantIteEqualsConstant") << instance << "->" << boolIte
+ // Trace("ite::constantIteEqualsConstant") << instance << "->" << boolIte
// << endl;
return boolIte;
}
else
{
d_constantIteEqualsConstantCache[pair] = d_false;
- Debug("ite::constantIteEqualsConstant")
+ Trace("ite::constantIteEqualsConstant")
<< instance << "->" << d_false << endl;
return d_false;
}
unsigned preNumBranches = numBranches;
unsigned preNumFalseBranches = numFalseBranches;
Node bterm = constantIteEqualsConstant(cite, constant);
- Debug("intersectConstantIte") << (numBranches - preNumBranches) << " "
+ Trace("intersectConstantIte") << (numBranches - preNumBranches) << " "
<< (numFalseBranches - preNumFalseBranches)
<< " " << (itesMade - preItesMade) << endl;
return bterm;
Node ITESimplifier::simpITEAtom(TNode atom)
{
CVC5_UNUSED static int instance = 0;
- Debug("ite::atom") << "still simplifying " << (++instance) << endl;
+ Trace("ite::atom") << "still simplifying " << (++instance) << endl;
Node attempt = transformAtom(atom);
- Debug("ite::atom") << " finished " << instance << endl;
+ Trace("ite::atom") << " finished " << instance << endl;
if (!attempt.isNull())
{
Node rewritten = rewrite(attempt);
- Debug("ite::print-success")
+ Trace("ite::print-success")
<< instance << " "
<< "rewriting " << countReachable(rewritten, kind::ITE) << " from "
<< countReachable(atom, kind::ITE) << endl
{
Assert(leavesAreConst(simpContext) && !containsTermITE(simpContext));
++(d_statistics.d_unexpected);
- Debug("ite::simpite") << instance << " "
+ Trace("ite::simpite") << instance << " "
<< "how about?" << atom << endl;
- Debug("ite::simpite") << instance << " "
+ Trace("ite::simpite") << instance << " "
<< "\t" << simpContext << endl;
return rewrite(simpContext);
}
if (!n.isNull())
{
++(d_statistics.d_unexpected);
- Debug("ite::simpite") << instance << " "
+ Trace("ite::simpite") << instance << " "
<< "here?" << atom << endl;
- Debug("ite::simpite") << instance << " "
+ Trace("ite::simpite") << instance << " "
<< "\t" << n << endl;
return n;
}
}
}
- if (Debug.isOn("ite::simpite"))
+ if (TraceIsOn("ite::simpite"))
{
if (countReachable(atom, kind::ITE) > 0)
{
- Debug("ite::simpite") << instance << " "
+ Trace("ite::simpite") << instance << " "
<< "remaining " << atom << endl;
}
}
Node conc = getProofForRewriting(f[0], lpf, d_tcontext);
if (conc != f)
{
- bool debugTraceEnabled = Trace.isOn("tconv-pf-gen-debug");
+ bool debugTraceEnabled = TraceIsOn("tconv-pf-gen-debug");
Assert(conc.getKind() == EQUAL && conc[0] == f[0]);
std::stringstream serr;
serr << "TConvProofGenerator::getProofFor: " << toStringDebug()
serr << "expected after conversions: " << f[1] << std::endl;
serr << " actual after conversions: " << curr << std::endl;
- if (Trace.isOn("tconv-seq-pf-gen-debug"))
+ if (TraceIsOn("tconv-seq-pf-gen-debug"))
{
Trace("tconv-pf-gen-debug")
<< "Printing conversion steps..." << std::endl;
visited[cur] = true;
continue;
}
- if (Trace.isOn("lazy-cdproofchain"))
+ if (TraceIsOn("lazy-cdproofchain"))
{
unsigned alreadyToVisit = 0;
Trace("lazy-cdproofchain")
{
allowedLeaves.push_back(link.first);
}
- if (Trace.isOn("lazy-cdproofchain"))
+ if (TraceIsOn("lazy-cdproofchain"))
{
Trace("lazy-cdproofchain") << "Checking relative to leaves...\n";
for (const Node& n : allowedLeaves)
return Node::null();
}
cchildren.push_back(cres);
- if (Trace.isOn("pfcheck"))
+ if (TraceIsOn("pfcheck"))
{
std::stringstream ssc;
pc->printDebug(ssc);
const char* traceTag)
{
std::stringstream out;
- bool traceEnabled = Trace.isOn(traceTag);
+ bool traceEnabled = TraceIsOn(traceTag);
// Since we are debugging, we want to treat trusted (null) checkers as
// a failure. We only enable output if the trace is enabled for efficiency.
Node res =
if (enableOutput)
{
out << serr.str() << std::endl;
- if (Trace.isOn("proof-pedantic"))
+ if (TraceIsOn("proof-pedantic"))
{
Trace("proof-pedantic")
<< "Failed pedantic check for " << id << std::endl;
out << "pedantic level for " << id << " not met (rule level is "
<< itp->second << " which is at or below the pedantic level "
<< d_pclevel << ")";
- bool pedanticTraceEnabled = Trace.isOn("proof-pedantic");
+ bool pedanticTraceEnabled = TraceIsOn("proof-pedantic");
if (!pedanticTraceEnabled)
{
out << ", use -t proof-pedantic for details";
// proofs not enabled, do not do check
return;
}
- bool isTraceDebug = Trace.isOn(c);
+ bool isTraceDebug = TraceIsOn(c);
if (options::proofCheck() != options::ProofCheckMode::EAGER && !isTraceDebug)
{
// trace is off and proof new eager checking is off, do not do check
return;
}
std::stringstream sdiag;
- bool isTraceOn = Trace.isOn(c);
+ bool isTraceOn = TraceIsOn(c);
if (!isTraceOn)
{
sdiag << ", use -t " << c << " for details";
}
- bool dumpProofTraceOn = Trace.isOn("dump-proof-error");
+ bool dumpProofTraceOn = TraceIsOn("dump-proof-error");
if (!dumpProofTraceOn)
{
sdiag << ", use -t dump-proof-error for details on proof";
// should be arguments to SCOPE.
std::stringstream ss;
- bool dumpProofTraceOn = Trace.isOn("dump-proof-error");
+ bool dumpProofTraceOn = TraceIsOn("dump-proof-error");
if (dumpProofTraceOn)
{
ss << "The proof : " << *pf << std::endl;
{
if (d_debugFreeAssumps)
{
- if (Trace.isOn("pfnu-debug"))
+ if (TraceIsOn("pfnu-debug"))
{
Trace("pfnu-debug2") << "Initial proof: " << *pf.get() << std::endl;
Trace("pfnu-debug") << "ProofNodeUpdater::process" << std::endl;
UnsatCore::UnsatCore(const std::vector<Node>& core)
: d_useNames(false), d_core(core), d_names()
{
- Debug("core") << "UnsatCore size " << d_core.size() << std::endl;
+ Trace("core") << "UnsatCore size " << d_core.size() << std::endl;
}
UnsatCore::UnsatCore(std::vector<std::string>& names)
: d_useNames(true), d_core(), d_names(names)
{
- Debug("core") << "UnsatCore (names) size " << d_names.size() << std::endl;
+ Trace("core") << "UnsatCore (names) size " << d_names.size() << std::endl;
}
const std::vector<Node>& UnsatCore::getCore() const { return d_core; }
bool rhs,
bool removable)
{
- Debug("sat::cryptominisat") << "Add xor clause " << clause <<" = " << rhs << "\n";
+ Trace("sat::cryptominisat") << "Add xor clause " << clause <<" = " << rhs << "\n";
if (!d_okay) {
- Debug("sat::cryptominisat") << "Solver unsat: not adding clause.\n";
+ Trace("sat::cryptominisat") << "Solver unsat: not adding clause.\n";
return ClauseIdError;
}
}
ClauseId CryptoMinisatSolver::addClause(SatClause& clause, bool removable){
- Debug("sat::cryptominisat") << "Add clause " << clause <<"\n";
+ Trace("sat::cryptominisat") << "Add clause " << clause <<"\n";
if (!d_okay) {
- Debug("sat::cryptominisat") << "Solver unsat: not adding clause.\n";
+ Trace("sat::cryptominisat") << "Solver unsat: not adding clause.\n";
return ClauseIdError;
}
setDecisionVar(v, dvar);
- Debug("minisat") << "new var " << v << std::endl;
+ Trace("minisat") << "new var " << v << std::endl;
// If the variable is introduced at non-zero level, we need to reintroduce it on backtracks
if (preRegister)
{
- Debug("minisat") << " To register at level " << decisionLevel()
+ Trace("minisat") << " To register at level " << decisionLevel()
<< std::endl;
variables_to_register.push(VarIntroInfo(v, decisionLevel()));
}
theory.shrink(shrinkSize);
}
- if (Debug.isOn("minisat::pop")) {
+ if (TraceIsOn("minisat::pop")) {
for (int i = 0; i < trail.size(); ++ i) {
Assert(var(trail[i]) < nVars());
}
// If we already have a reason, just return it
if (vardata[x].d_reason != CRef_Lazy)
{
- if (Trace.isOn("pf::sat"))
+ if (TraceIsOn("pf::sat"))
{
Trace("pf::sat") << " Solver::reason: " << vardata[x].d_reason << ", ";
if (vardata[x].d_reason == CRef_Undef)
if(assigns[var(ps[0])] == l_Undef) {
Assert(assigns[var(ps[0])] != l_False);
uncheckedEnqueue(ps[0], cr);
- Debug("cores") << "i'm registering a unit clause, maybe input"
+ Trace("cores") << "i'm registering a unit clause, maybe input"
<< std::endl;
if (ps.size() == 1)
{
void Solver::attachClause(CRef cr) {
const Clause& c = ca[cr];
- if (Debug.isOn("minisat"))
+ if (TraceIsOn("minisat"))
{
- Debug("minisat") << "Solver::attachClause(" << c << "): ";
+ Trace("minisat") << "Solver::attachClause(" << c << "): ";
for (unsigned i = 0, size = c.size(); i < size; ++i)
{
- Debug("minisat") << c[i] << " ";
+ Trace("minisat") << c[i] << " ";
}
- Debug("minisat") << ", level " << c.level() << "\n";
+ Trace("minisat") << ", level " << c.level() << "\n";
}
Assert(c.size() > 1);
watches[~c[0]].push(Watcher(cr, c[1]));
void Solver::detachClause(CRef cr, bool strict) {
const Clause& c = ca[cr];
- Debug("minisat") << "Solver::detachClause(" << c << ")" << std::endl;
- if (Debug.isOn("minisat"))
+ Trace("minisat") << "Solver::detachClause(" << c << ")" << std::endl;
+ if (TraceIsOn("minisat"))
{
- Debug("minisat") << "Solver::detachClause(" << c << "), CRef " << cr
+ Trace("minisat") << "Solver::detachClause(" << c << "), CRef " << cr
<< ", clause ";
for (unsigned i = 0, size = c.size(); i < size; ++i)
{
- Debug("minisat") << c[i] << " ";
+ Trace("minisat") << c[i] << " ";
}
- Debug("minisat") << "\n";
+ Trace("minisat") << "\n";
}
Assert(c.size() > 1);
void Solver::removeClause(CRef cr) {
Clause& c = ca[cr];
- if (Debug.isOn("minisat"))
+ if (TraceIsOn("minisat"))
{
- Debug("minisat") << "Solver::removeClause(" << c << "), CRef " << cr
+ Trace("minisat") << "Solver::removeClause(" << c << "), CRef " << cr
<< ", clause ";
for (unsigned i = 0, size = c.size(); i < size; ++i)
{
- Debug("minisat") << c[i] << " ";
+ Trace("minisat") << c[i] << " ";
}
- Debug("minisat") << "\n";
+ Trace("minisat") << "\n";
}
detachClause(cr);
// Don't leave pointers to free'd memory!
// Revert to the state at given level (keeping all assignment at 'level' but not beyond).
//
void Solver::cancelUntil(int level) {
- Debug("minisat") << "minisat::cancelUntil(" << level << ")" << std::endl;
+ Trace("minisat") << "minisat::cancelUntil(" << level << ")" << std::endl;
if (decisionLevel() > level){
// Pop the SMT context
MinisatSatSolver::toMinisatLit(d_proxy->getNextTheoryDecisionRequest());
while (nextLit != lit_Undef) {
if(value(var(nextLit)) == l_Undef) {
- Debug("theoryDecision")
+ Trace("theoryDecision")
<< "getNextTheoryDecisionRequest(): now deciding on " << nextLit
<< std::endl;
decisions++;
// org-mode tracing -- theory decision
- if (Trace.isOn("dtview"))
+ if (TraceIsOn("dtview"))
{
dtviewDecisionHelper(
d_context->getLevel(),
options().base.incrementalSolving);
}
- if (Trace.isOn("dtview::prop"))
+ if (TraceIsOn("dtview::prop"))
{
dtviewPropagationHeaderHelper(d_context->getLevel(),
options().base.incrementalSolving);
return nextLit;
} else {
- Debug("theoryDecision")
+ Trace("theoryDecision")
<< "getNextTheoryDecisionRequest(): would decide on " << nextLit
<< " but it already has an assignment" << std::endl;
}
nextLit = MinisatSatSolver::toMinisatLit(
d_proxy->getNextTheoryDecisionRequest());
}
- Debug("theoryDecision")
+ Trace("theoryDecision")
<< "getNextTheoryDecisionRequest(): decide on another literal"
<< std::endl;
}
// org-mode tracing -- decision engine decision
- if (Trace.isOn("dtview"))
+ if (TraceIsOn("dtview"))
{
dtviewDecisionHelper(
d_context->getLevel(),
options().base.incrementalSolving);
}
- if (Trace.isOn("dtview::prop"))
+ if (TraceIsOn("dtview::prop"))
{
dtviewPropagationHeaderHelper(d_context->getLevel(),
options().base.incrementalSolving);
}
// org-mode tracing -- decision engine decision
- if (Trace.isOn("dtview"))
+ if (TraceIsOn("dtview"))
{
dtviewDecisionHelper(
d_context->getLevel(),
options().base.incrementalSolving);
}
- if (Trace.isOn("dtview::prop"))
+ if (TraceIsOn("dtview::prop"))
{
dtviewPropagationHeaderHelper(d_context->getLevel(),
options().base.incrementalSolving);
if (c.removable()) claBumpActivity(c);
}
- if (Trace.isOn("pf::sat"))
+ if (TraceIsOn("pf::sat"))
{
Trace("pf::sat") << "Solver::analyze: conflict clause ";
for (unsigned i = 0, size = ca[confl].size(); i < size; ++i)
} while (pathC > 0);
out_learnt[0] = ~p;
- if (Debug.isOn("newproof::sat"))
+ if (TraceIsOn("newproof::sat"))
{
- Debug("newproof::sat") << "finished with learnt clause ";
+ Trace("newproof::sat") << "finished with learnt clause ";
for (unsigned i = 0, size = out_learnt.size(); i < size; ++i)
{
prop::SatLiteral satLit = toSatLiteral<Minisat::Solver>(out_learnt[i]);
- Debug("newproof::sat") << satLit << " ";
+ Trace("newproof::sat") << satLit << " ";
}
- Debug("newproof::sat") << "\n";
+ Trace("newproof::sat") << "\n";
}
// Simplify conflict clause:
} else {
if (needProof())
{
- Debug("newproof::sat")
+ Trace("newproof::sat")
<< "Solver::analyze: redundant lit "
<< toSatLiteral<Minisat::Solver>(out_learnt[i]) << "\n";
d_pfManager->addResolutionStep(out_learnt[i], true);
void Solver::uncheckedEnqueue(Lit p, CRef from)
{
- if (Debug.isOn("minisat"))
+ if (TraceIsOn("minisat"))
{
- Debug("minisat") << "unchecked enqueue of " << p << " ("
+ Trace("minisat") << "unchecked enqueue of " << p << " ("
<< trail_index(var(p)) << ") trail size is "
<< trail.size() << " cap is " << trail.capacity()
<< ", reason is " << from << ", ";
if (from == CRef_Lazy)
{
- Debug("minisat") << "CRef_Lazy";
+ Trace("minisat") << "CRef_Lazy";
}
else if (from == CRef_Undef)
{
- Debug("minisat") << "CRef_Undef";
+ Trace("minisat") << "CRef_Undef";
}
else
{
for (unsigned i = 0, size = ca[from].size(); i < size; ++i)
{
- Debug("minisat") << ca[from][i] << " ";
+ Trace("minisat") << ca[from][i] << " ";
}
}
- Debug("minisat") << "\n";
+ Trace("minisat") << "\n";
}
Assert(value(p) == l_Undef);
Assert(var(p) < nVars());
}
} else {
// if dumping decision tree, print the conflict
- if (Trace.isOn("dtview::conflict"))
+ if (TraceIsOn("dtview::conflict"))
{
if (confl != CRef_Undef)
{
MinisatSatSolver::toMinisatClause(propagatedLiteralsClause, propagatedLiterals);
int oldTrailSize = trail.size();
- Debug("minisat") << "old trail size is " << oldTrailSize << ", propagating " << propagatedLiterals.size() << " lits..." << std::endl;
+ Trace("minisat") << "old trail size is " << oldTrailSize << ", propagating " << propagatedLiterals.size() << " lits..." << std::endl;
for (unsigned i = 0, i_end = propagatedLiterals.size(); i < i_end; ++ i) {
- Debug("minisat") << "Theory propagated: " << propagatedLiterals[i] << std::endl;
+ Trace("minisat") << "Theory propagated: " << propagatedLiterals[i] << std::endl;
// multiple theories can propagate the same literal
Lit p = propagatedLiterals[i];
if (value(p) == l_Undef) {
uncheckedEnqueue(p, CRef_Lazy);
} else {
if (value(p) == l_False) {
- Debug("minisat") << "Conflict in theory propagation" << std::endl;
+ Trace("minisat") << "Conflict in theory propagation" << std::endl;
SatClause explanation_cl;
d_proxy->explainPropagation(MinisatSatSolver::toSatLiteral(p),
explanation_cl);
num_props++;
// if propagation tracing enabled, print boolean propagation
- if (Trace.isOn("dtview::prop"))
+ if (TraceIsOn("dtview::prop"))
{
dtviewBoolPropagationHelper(
decisionLevel(), p, d_proxy, options().base.incrementalSolving);
if (next == lit_Undef)
{
// We need to do a full theory check to confirm
- Debug("minisat::search")
+ Trace("minisat::search")
<< "Doing a full theory check..." << std::endl;
check_type = CHECK_FINAL;
continue;
// NOTE: assumptions passed in member-variable 'assumptions'.
lbool Solver::solve_()
{
- Debug("minisat") << "nvars = " << nVars() << std::endl;
+ Trace("minisat") << "nvars = " << nVars() << std::endl;
ScopedBool scoped_bool(minisat_busy, true);
model.growTo(nVars());
for (int i = 0; i < nVars(); i++) {
model[i] = value(i);
- Debug("minisat") << i << " = " << model[i] << std::endl;
+ Trace("minisat") << i << " = " << model[i] << std::endl;
}
}
else if (status == l_False && d_conflict.size() == 0)
Assert(decisionLevel() == 0);
++assertionLevel;
- Debug("minisat") << "in user push, increasing assertion level to " << assertionLevel << std::endl;
+ Trace("minisat") << "in user push, increasing assertion level to " << assertionLevel << std::endl;
trail_ok.push(ok);
assigns_lim.push(assigns.size());
d_context->push(); // SAT context for cvc5
- Debug("minisat") << "MINISAT PUSH assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << std::endl;
+ Trace("minisat") << "MINISAT PUSH assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << std::endl;
}
void Solver::pop()
// Pop the trail below the user level
--assertionLevel;
- Debug("minisat") << "in user pop, decreasing assertion level to "
+ Trace("minisat") << "in user pop, decreasing assertion level to "
<< assertionLevel << "\n"
<< cvc5::push;
while (true) {
- Debug("minisat") << "== unassigning " << trail.last() << std::endl;
+ Trace("minisat") << "== unassigning " << trail.last() << std::endl;
Var x = var(trail.last());
if (user_level(x) > assertionLevel) {
assigns[x] = l_Undef;
// Remove the clauses
removeClausesAboveLevel(clauses_persistent, assertionLevel);
removeClausesAboveLevel(clauses_removable, assertionLevel);
- Debug("minisat") << cvc5::pop;
+ Trace("minisat") << cvc5::pop;
// Pop the SAT context to notify everyone
d_context->pop(); // SAT context for cvc5
- Debug("minisat") << "MINISAT POP assertionLevel is " << assertionLevel
+ Trace("minisat") << "MINISAT POP assertionLevel is " << assertionLevel
<< ", trail.size is " << trail.size() << "\n";
// Pop the created variables
resizeVars(assigns_lim.last());
CRef Solver::updateLemmas() {
- Debug("minisat::lemmas") << "Solver::updateLemmas() begin" << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas() begin" << std::endl;
// Avoid adding lemmas indefinitely without resource-out
d_proxy->spendResource(Resource::LemmaStep);
Assert(!options().smt.unsatCores && !needProof());
conflict = CRef_Lazy;
backtrackLevel = 0;
- Debug("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl;
continue;
}
// Sort the lemma to be able to attach
sort(lemma, lt);
// See if the lemma propagates something
if (lemma.size() == 1 || value(lemma[1]) == l_False) {
- Debug("minisat::lemmas") << "found unit " << lemma.size() << std::endl;
+ Trace("minisat::lemmas") << "found unit " << lemma.size() << std::endl;
// This lemma propagates, see which level we need to backtrack to
int currentBacktrackLevel = lemma.size() == 1 ? 0 : level(var(lemma[1]));
// Even if the first literal is true, we should propagate it at this level (unless it's set at a lower level)
}
// Pop so that propagation would be current
- Debug("minisat::lemmas") << "Solver::updateLemmas(): backtracking to " << backtrackLevel << " from " << decisionLevel() << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas(): backtracking to " << backtrackLevel << " from " << decisionLevel() << std::endl;
cancelUntil(backtrackLevel);
}
if (value(lemma[0]) == l_False) {
// We have a conflict
if (lemma.size() > 1) {
- Debug("minisat::lemmas") << "Solver::updateLemmas(): conflict" << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas(): conflict" << std::endl;
conflict = lemma_ref;
} else {
- Debug("minisat::lemmas") << "Solver::updateLemmas(): unit conflict or empty clause" << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas(): unit conflict or empty clause" << std::endl;
conflict = CRef_Lazy;
if (needProof())
{
}
}
} else {
- Debug("minisat::lemmas") << "lemma size is " << lemma.size() << std::endl;
- Debug("minisat::lemmas") << "lemma ref is " << lemma_ref << std::endl;
+ Trace("minisat::lemmas") << "lemma size is " << lemma.size() << std::endl;
+ Trace("minisat::lemmas") << "lemma ref is " << lemma_ref << std::endl;
uncheckedEnqueue(lemma[0], lemma_ref);
}
}
theoryConflict = true;
}
- Debug("minisat::lemmas") << "Solver::updateLemmas() end" << std::endl;
+ Trace("minisat::lemmas") << "Solver::updateLemmas() end" << std::endl;
return conflict;
}
void ClauseAllocator::reloc(CRef& cr, ClauseAllocator& to)
{
- Debug("minisat") << "ClauseAllocator::reloc: cr " << cr << std::endl;
+ Trace("minisat") << "ClauseAllocator::reloc: cr " << cr << std::endl;
// FIXME what is this CRef_lazy
if (cr == CRef_Lazy) return;
inline bool Solver::isDecision(Var x) const
{
- Debug("minisat") << "var " << x << " is a decision iff "
+ Trace("minisat") << "var " << x << " is a decision iff "
<< (vardata[x].d_reason == CRef_Undef) << " && " << level(x)
<< " > 0" << std::endl;
return vardata[x].d_reason == CRef_Undef && level(x) > 0;
void MinisatSatSolver::requirePhase(SatLiteral lit) {
Assert(!d_minisat->rnd_pol);
- Debug("minisat") << "requirePhase(" << lit << ")" << " " << lit.getSatVariable() << " " << lit.isNegated() << std::endl;
+ Trace("minisat") << "requirePhase(" << lit << ")" << " " << lit.getSatVariable() << " " << lit.isNegated() << std::endl;
SatVariable v = lit.getSatVariable();
d_minisat->freezePolarity(v, lit.isNegated());
}
void SimpSolver::removeClause(CRef cr)
{
const Clause& c = ca[cr];
- Debug("minisat") << "SimpSolver::removeClause(" << c << ")" << std::endl;
+ Trace("minisat") << "SimpSolver::removeClause(" << c << ")" << std::endl;
if (use_simplification)
for (int i = 0; i < c.size(); i++){
++it;
continue;
}
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "Should remove from map pfs of [" << it->first
<< "]:\n";
Node ProofCnfStream::normalizeAndRegister(TNode clauseNode)
{
Node normClauseNode = d_psb.factorReorderElimDoubleNeg(clauseNode);
- if (Trace.isOn("cnf") && normClauseNode != clauseNode)
+ if (TraceIsOn("cnf") && normClauseNode != clauseNode)
{
Trace("cnf") << push
<< "ProofCnfStream::normalizeAndRegister: steps to normalized "
// get proof from proof cnf stream
pfn = d_proofCnfStream->getProofFor(f);
Assert(pfn != nullptr && pfn->getResult() == f);
- if (Trace.isOn("prop-proof-pp"))
+ if (TraceIsOn("prop-proof-pp"))
{
Trace("prop-proof-pp") << "=== Connect CNF proof for: " << f << "\n";
Trace("prop-proof-pp") << *pfn.get() << "\n";
d_interrupted(false),
d_assumptions(d_env.getUserContext())
{
- Debug("prop") << "Constructing the PropEngine" << std::endl;
+ Trace("prop") << "Constructing the PropEngine" << std::endl;
context::UserContext* userContext = d_env.getUserContext();
ProofNodeManager* pnm = d_env.getProofNodeManager();
}
PropEngine::~PropEngine() {
- Debug("prop") << "Destructing the PropEngine" << std::endl;
+ Trace("prop") << "Destructing the PropEngine" << std::endl;
d_decisionEngine.reset(nullptr);
delete d_cnfStream;
delete d_satSolver;
d_theoryProxy->notifyInputFormulas(assertions, skolemMap);
for (const Node& node : assertions)
{
- Debug("prop") << "assertFormula(" << node << ")" << std::endl;
+ Trace("prop") << "assertFormula(" << node << ")" << std::endl;
assertInternal(node, false, false, true);
}
}
}
}
- if (Trace.isOn("te-lemma"))
+ if (TraceIsOn("te-lemma"))
{
Trace("te-lemma") << "Lemma, output: " << tplemma.getProven() << std::endl;
for (const theory::SkolemLemma& lem : ppLemmas)
void PropEngine::assertTrustedLemmaInternal(TrustNode trn, bool removable)
{
Node node = trn.getNode();
- Debug("prop::lemmas") << "assertLemma(" << node << ")" << std::endl;
+ Trace("prop::lemmas") << "assertLemma(" << node << ")" << std::endl;
bool negated = trn.getKind() == TrustNodeKind::CONFLICT;
// should have a proof generator if the theory engine is proof producing
Assert(!d_env.isTheoryProofProducing() || trn.getGenerator() != nullptr);
}
void PropEngine::requirePhase(TNode n, bool phase) {
- Debug("prop") << "requirePhase(" << n << ", " << phase << ")" << std::endl;
+ Trace("prop") << "requirePhase(" << n << ", " << phase << ")" << std::endl;
Assert(n.getType().isBoolean());
SatLiteral lit = d_cnfStream->getLiteral(n);
void PropEngine::printSatisfyingAssignment(){
const CnfStream::NodeToLiteralMap& transCache =
d_cnfStream->getTranslationCache();
- Debug("prop-value") << "Literal | Value | Expr" << std::endl
+ Trace("prop-value") << "Literal | Value | Expr" << std::endl
<< "----------------------------------------"
<< "-----------------" << std::endl;
for(CnfStream::NodeToLiteralMap::const_iterator i = transCache.begin(),
if(!l.isNegated()) {
Node n = curr.first;
SatValue value = d_satSolver->modelValue(l);
- Debug("prop-value") << "'" << l << "' " << value << " " << n << std::endl;
+ Trace("prop-value") << "'" << l << "' " << value << " " << n << std::endl;
}
}
}
Result PropEngine::checkSat() {
Assert(!d_inCheckSat) << "Sat solver in solve()!";
- Debug("prop") << "PropEngine::checkSat()" << std::endl;
+ Trace("prop") << "PropEngine::checkSat()" << std::endl;
// Mark that we are in the checkSat
ScopedBool scopedBool(d_inCheckSat);
return Result(Result::SAT_UNKNOWN, why);
}
- if( result == SAT_VALUE_TRUE && Debug.isOn("prop") ) {
+ if( result == SAT_VALUE_TRUE && TraceIsOn("prop") ) {
printSatisfyingAssignment();
}
- Debug("prop") << "PropEngine::checkSat() => " << result << std::endl;
+ Trace("prop") << "PropEngine::checkSat() => " << result << std::endl;
if (result == SAT_VALUE_TRUE && d_theoryProxy->isIncomplete())
{
return Result(Result::SAT_UNKNOWN, Result::INCOMPLETE);
{
Assert(!d_inCheckSat) << "Sat solver in solve()!";
d_satSolver->push();
- Debug("prop") << "push()" << std::endl;
+ Trace("prop") << "push()" << std::endl;
}
void PropEngine::pop()
{
Assert(!d_inCheckSat) << "Sat solver in solve()!";
d_satSolver->pop();
- Debug("prop") << "pop()" << std::endl;
+ Trace("prop") << "pop()" << std::endl;
}
void PropEngine::resetTrail()
{
d_satSolver->resetTrail();
- Debug("prop") << "resetTrail()" << std::endl;
+ Trace("prop") << "resetTrail()" << std::endl;
}
unsigned PropEngine::getAssertionLevel() const
d_interrupted = true;
d_satSolver->interrupt();
- Debug("prop") << "interrupt()" << std::endl;
+ Trace("prop") << "interrupt()" << std::endl;
}
void PropEngine::spendResource(Resource r)
<< "PropPfManager::getProof: Getting resolution proof of false\n";
std::shared_ptr<ProofNode> conflictProof = d_satSolver->getProof();
Assert(conflictProof);
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
std::vector<Node> fassumps;
expr::getFreeAssumptions(conflictProof.get(), fassumps);
}
// connect it with CNF proof
d_pfpp->process(conflictProof);
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
std::vector<Node> fassumps;
expr::getFreeAssumptions(conflictProof.get(), fassumps);
void SatProofManager::startResChain(const Minisat::Clause& start)
{
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "SatProofManager::startResChain: ";
printClause(start);
// negation in the first clause, which means that the third argument of the
// tuple must be false
d_resLinks.emplace_back(clauseNode, negated ? litNode[0] : litNode, negated);
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "SatProofManager::addResolutionStep: {"
<< satLit.isNegated() << "} [" << ~satLit << "] ";
void SatProofManager::endResChain(const Minisat::Clause& clause)
{
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "SatProofManager::endResChain: chain_res for ";
printClause(clause);
<< "reasonRef " << reasonRef << " and d_satSolver->ca.size() "
<< d_solver->ca.size() << "\n";
const Minisat::Clause& reason = d_solver->ca[reasonRef];
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "reason: ";
printClause(reason);
<< d_solver->ca.size() << "\n";
const Minisat::Clause& reason = d_solver->ca[reasonRef];
unsigned size = reason.size();
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "SatProofManager::explainLit: with clause: ";
printClause(reason);
premises.insert(childPremises.begin(), childPremises.end());
premises.insert(d_cnfStream->getNodeCache()[~currLit]);
}
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << pop << "SatProofManager::explainLit: chain_res for "
<< lit << ", " << litNode << " with clauses:\n";
{
return;
}
- if (Trace.isOn("sat-proof-debug2"))
+ if (TraceIsOn("sat-proof-debug2"))
{
Trace("sat-proof-debug2")
<< push << "SatProofManager::finalizeProof: saved proofs in chain:\n";
premises.insert(negatedLitNode);
Trace("sat-proof") << "===========\n";
}
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof") << "SatProofManager::finalizeProof: chain_res for false "
"with clauses:\n";
Trace("sat-proof-debug") << "sat proof of flase: " << *pfn.get() << "\n";
std::vector<Node> fassumps;
expr::getFreeAssumptions(pfn.get(), fassumps);
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
for (const Node& fa : fassumps)
{
void SatProofManager::finalizeProof(const Minisat::Clause& inConflict,
bool adding)
{
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
Trace("sat-proof")
<< "SatProofManager::finalizeProof: conflicting clause: ";
std::vector<TNode> outputNodes;
d_theoryEngine->getPropagatedLiterals(outputNodes);
for (unsigned i = 0, i_end = outputNodes.size(); i < i_end; ++ i) {
- Debug("prop-explain") << "theoryPropagate() => " << outputNodes[i] << std::endl;
+ Trace("prop-explain") << "theoryPropagate() => " << outputNodes[i] << std::endl;
output.push_back(d_cnfStream->getLiteral(outputNodes[i]));
}
}
void TheoryProxy::explainPropagation(SatLiteral l, SatClause& explanation) {
TNode lNode = d_cnfStream->getNode(l);
- Debug("prop-explain") << "explainPropagation(" << lNode << ")" << std::endl;
+ Trace("prop-explain") << "explainPropagation(" << lNode << ")" << std::endl;
TrustNode tte = d_theoryEngine->getExplanation(lNode);
Node theoryExplanation = tte.getNode();
|| tte.getGenerator());
d_propEngine->getProofCnfStream()->convertPropagation(tte);
}
- Debug("prop-explain") << "explainPropagation() => " << theoryExplanation
+ Trace("prop-explain") << "explainPropagation() => " << theoryExplanation
<< std::endl;
explanation.push_back(l);
if (theoryExplanation.getKind() == kind::AND)
{
explanation.push_back(~d_cnfStream->getLiteral(theoryExplanation));
}
- if (Trace.isOn("sat-proof"))
+ if (TraceIsOn("sat-proof"))
{
std::stringstream ss;
ss << "TheoryProxy::explainPropagation: clause for lit is ";
void TheoryProxy::enqueueTheoryLiteral(const SatLiteral& l) {
Node literalNode = d_cnfStream->getNode(l);
- Debug("prop") << "enqueueing theory literal " << l << " " << literalNode << std::endl;
+ Trace("prop") << "enqueueing theory literal " << l << " " << literalNode << std::endl;
Assert(!literalNode.isNull());
d_queue.push(literalNode);
}
// Working upwards
// Reconstruct the node from it's (now rewritten) children on the stack
- Debug("expand") << "cons : " << node << std::endl;
+ Trace("expand") << "cons : " << node << std::endl;
if (node.getNumChildren() > 0)
{
// cout << "cons : " << node << std::endl;
NodeBuilder nb(node.getKind());
if (node.getMetaKind() == metakind::PARAMETERIZED)
{
- Debug("expand") << "op : " << node.getOperator() << std::endl;
+ Trace("expand") << "op : " << node.getOperator() << std::endl;
// cout << "op : " << node.getOperator() << std::endl;
nb << node.getOperator();
}
Node expanded = result.top();
result.pop();
// cout << "exchld : " << expanded << std::endl;
- Debug("expand") << "exchld : " << expanded << std::endl;
+ Trace("expand") << "exchld : " << expanded << std::endl;
nb << expanded;
}
node = nb;
// already computed
return true;
}
- if (Trace.isOn("model-core"))
+ if (TraceIsOn("model-core"))
{
Trace("model-core") << "Compute model core, assertions:" << std::endl;
for (const Node& a : assertions)
Trace("smt-proc") << "ProcessAssertions::processAssertions() begin" << endl;
Trace("smt") << "ProcessAssertions::processAssertions()" << endl;
- Debug("smt") << "#Assertions : " << assertions.size() << endl;
- Debug("smt") << "#Assumptions: " << assertions.getNumAssumptions() << endl;
+ Trace("smt") << "#Assertions : " << assertions.size() << endl;
+ Trace("smt") << "#Assumptions: " << assertions.getNumAssumptions() << endl;
if (assertions.size() == 0)
{
<< "ProcessAssertions::processAssertions() : post-definition-expansion"
<< endl;
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
if (options().quantifiers.globalNegate)
{
applyPass("ackermann", as);
}
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
bool noConflict = true;
{
applyPass("static-learning", as);
}
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
if (options().smt.learnedRewrite)
{
// begin: INVARIANT to maintain: no reordering of assertions or
// introducing new ones
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
- Debug("smt") << "ProcessAssertions::processAssertions() POST SIMPLIFICATION"
+ Trace("smt") << "ProcessAssertions::processAssertions() POST SIMPLIFICATION"
<< endl;
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
// ensure rewritten
applyPass("rewrite", as);
}
}
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
// ITE simplification
if (options().smt.doITESimp
}
}
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
// Unconstrained simplification
if (options().smt.unconstrainedSimp)
dumpAssertions("post-repeatsimp", as);
Trace("smt") << "POST repeatSimp" << endl;
- Debug("smt") << " assertions : " << assertions.size() << endl;
+ Trace("smt") << " assertions : " << assertions.size() << endl;
}
catch (TypeCheckingExceptionPrivate& tcep)
{
void ProcessAssertions::dumpAssertions(const std::string& key, Assertions& as)
{
- bool isTraceOn = Trace.isOn(key);
+ bool isTraceOn = TraceIsOn(key);
if (!isTraceOn)
{
return;
}
}
// print for debugging
- if (Trace.isOn("final-pf-hole"))
+ if (TraceIsOn("final-pf-hole"))
{
// currently only track theory rewrites
if (r == PfRule::THEORY_REWRITE)
// response. This method would need to cache its result otherwise.
Trace("smt-proof") << "SolverEngine::setFinalProof(): get proof body...\n";
- if (Trace.isOn("smt-proof-debug"))
+ if (TraceIsOn("smt-proof-debug"))
{
Trace("smt-proof-debug")
<< "SolverEngine::setFinalProof(): Proof node for false:\n";
std::vector<Node> assertions;
getAssertions(as, assertions);
- if (Trace.isOn("smt-proof"))
+ if (TraceIsOn("smt-proof"))
{
Trace("smt-proof")
<< "SolverEngine::setFinalProof(): get free assumptions..."
else
{
Assert(pfn->getResult() == f);
- if (Trace.isOn("smt-proof-pp"))
+ if (TraceIsOn("smt-proof-pp"))
{
Trace("smt-proof-pp")
<< "=== Connect proof for preprocessing: " << f << std::endl;
std::sort(lastInclusion.begin(), lastInclusion.end(), cmp);
// order eliminators
std::sort(eliminators.begin(), eliminators.end());
- if (Trace.isOn("smt-proof-pp-debug"))
+ if (TraceIsOn("smt-proof-pp-debug"))
{
Trace("smt-proof-pp-debug") << "crowding lits last inclusion:\n";
for (const auto& pair : lastInclusion)
}
else if (id == PfRule::MACRO_ARITH_SCALE_SUM_UB)
{
- Debug("macro::arith") << "Expand MACRO_ARITH_SCALE_SUM_UB" << std::endl;
- if (Debug.isOn("macro::arith"))
+ Trace("macro::arith") << "Expand MACRO_ARITH_SCALE_SUM_UB" << std::endl;
+ if (TraceIsOn("macro::arith"))
{
for (const auto& child : children)
{
- Debug("macro::arith") << " child: " << child << std::endl;
+ Trace("macro::arith") << " child: " << child << std::endl;
}
- Debug("macro::arith") << " args: " << args << std::endl;
+ Trace("macro::arith") << " args: " << args << std::endl;
}
Assert(args.size() == children.size());
NodeManager* nm = NodeManager::currentNM();
Node sumBounds = steps.tryStep(PfRule::ARITH_SUM_UB, scaledRels, {});
cdp->addSteps(steps);
- Debug("macro::arith") << "Expansion done. Proved: " << sumBounds
+ Trace("macro::arith") << "Expansion done. Proved: " << sumBounds
<< std::endl;
return sumBounds;
}
{
Assert(smt != nullptr);
s_slvEngine_current = const_cast<SolverEngine*>(smt);
- Debug("current") << "smt scope: " << s_slvEngine_current << std::endl;
+ Trace("current") << "smt scope: " << s_slvEngine_current << std::endl;
}
SolverEngineScope::~SolverEngineScope()
{
s_slvEngine_current = d_oldSlvEngine;
- Debug("current") << "smt scope: returning to " << s_slvEngine_current
+ Trace("current") << "smt scope: returning to " << s_slvEngine_current
<< std::endl;
}
TrustNode newLem;
bool inQuant, inTerm;
RtfTermContext::getFlags(nodeVal, inQuant, inTerm);
- Debug("ite") << "removeITEs(" << node << ")"
+ Trace("ite") << "removeITEs(" << node << ")"
<< " " << inQuant << " " << inTerm << std::endl;
Assert(!inQuant);
Node currt =
core.push_back(a);
}
}
- if (Trace.isOn("unsat-core"))
+ if (TraceIsOn("unsat-core"))
{
Trace("unsat-core") << "UCManager::getUnsatCore():\n";
for (const Node& n : core)
mods.push_back(Integer());
Integer& back = mods.back();
back = carry.floor();
- Debug("rationalToCfe") << " cfe["<<i<<"]: " << back << endl;
+ Trace("rationalToCfe") << " cfe["<<i<<"]: " << back << endl;
carry -= back;
if(carry.isZero()){
break;
Rational ApproximateSimplex::estimateWithCFE(const Rational& r, const Integer& K){
- Debug("estimateWithCFE") << "estimateWithCFE(" << r << ", " << K << ")" <<endl;
+ Trace("estimateWithCFE") << "estimateWithCFE(" << r << ", " << K << ")" <<endl;
// references
// page 4: http://carlossicoli.free.fr/C/Cassels_J.W.S.-An_introduction_to_diophantine_approximation-University_Press(1965).pdf
// http://en.wikipedia.org/wiki/Continued_fraction
q[2] = q[0] + quot*q[1];
p[2] = p[0] + quot*p[1];
- Debug("estimateWithCFE") << " cfe["<<t<<"]: " << p[2] <<"/"<< q[2] << endl;
+ Trace("estimateWithCFE") << " cfe["<<t<<"]: " << p[2] <<"/"<< q[2] << endl;
while( q[2] <= K ){
p[0] = p[1]; p[1] = p[2];
q[0] = q[1]; q[1] = q[2];
p[2] = p[0]+quot*p[1];
q[2] = q[0]+quot*q[1];
++t;
- Debug("estimateWithCFE") << " cfe["<<t<<"]: " << p[2] <<"/"<< q[2] << endl;
+ Trace("estimateWithCFE") << " cfe["<<t<<"]: " << p[2] <<"/"<< q[2] << endl;
}
Integer k = (K-q[0]).floorDivideQuotient(q[1]);
Rational dist_prev = (cand_prev - r).abs();
Rational dist_curr = (cand_curr - r).abs();
if(dist_prev <= dist_curr){
- Debug("estimateWithCFE") << cand_prev << " is closer than " << cand_curr << endl;
+ Trace("estimateWithCFE") << cand_prev << " is closer than " << cand_curr << endl;
return cand_prev;
}else{
- Debug("estimateWithCFE") << cand_curr << " is closer than " << cand_prev << endl;
+ Trace("estimateWithCFE") << cand_curr << " is closer than " << cand_prev << endl;
return cand_curr;
}
}
//mapRowId(d_log.getRootId(), numRows, v);
d_rootRowIds.insert(make_pair(numRows, v));
//d_rowToArithVar.set(numRows, v);
- Debug("approx") << "Row vars: " << v << "<->" << numRows << endl;
+ Trace("approx") << "Row vars: " << v << "<->" << numRows << endl;
}else{
++numCols;
d_colIndices.set(v, numCols);
d_colToArithVar.set(numCols, v);
- Debug("approx") << "Col vars: " << v << "<->" << numCols << endl;
+ Trace("approx") << "Col vars: " << v << "<->" << numCols << endl;
}
}
Assert(numRows > 0);
if(newAssign > ub){
double ubinf = newAssign - ub;
infeas += ubinf;
- Debug("approx::soi") << "ub inf" << vi << " " << ubinf << " " << infeas << endl;
+ Trace("approx::soi") << "ub inf" << vi << " " << ubinf << " " << infeas << endl;
}
}
if(lb != -DBL_MAX){
double lbinf = lb - newAssign;
infeas += lbinf;
- Debug("approx::soi") << "lb inf" << vi << " " << lbinf << " " << infeas << endl;
+ Trace("approx::soi") << "lb inf" << vi << " " << lbinf << " " << infeas << endl;
}
}
}
static MirInfo* mirCut(glp_tree *tree, int exec_ord, int cut_ord){
- Debug("approx::mirCut") << "mirCut()" << exec_ord << endl;
+ Trace("approx::mirCut") << "mirCut()" << exec_ord << endl;
MirInfo* mir;
mir = new MirInfo(exec_ord, cut_ord);
glp_ios_cut_get_mir_subst(tree, cut_ord, mir->subst);
glp_ios_cut_get_mir_virtual_rows(tree, cut_ord, mir->vlbRows, mir->vubRows);
- if(Debug.isOn("approx::mirCut")){
- Debug("approx::mirCut") << "mir_id: " << exec_ord << endl;
- row_sum.print(Debug("approx::mirCut"));
+ if(TraceIsOn("approx::mirCut")){
+ Trace("approx::mirCut") << "mir_id: " << exec_ord << endl;
+ row_sum.print(Trace("approx::mirCut"));
}
return mir;
}
static GmiInfo* gmiCut(glp_tree *tree, int exec_ord, int cut_ord){
- Debug("approx::gmiCut") << "gmiCut()" << exec_ord << endl;
+ Trace("approx::gmiCut") << "gmiCut()" << exec_ord << endl;
int gmi_var;
int write_pos;
gmi->init_tab(N);
gmi->basic = M+gmi_var;
- Debug("approx::gmiCut")
+ Trace("approx::gmiCut")
<< gmi <<" " << gmi->basic << " "
<< cut_ord<<" " << M <<" " << gmi_var << endl;
PrimitiveVec& tab_row = gmi->tab_row;
- Debug("approx::gmiCut") << "Is N sufficient here?" << endl;
+ Trace("approx::gmiCut") << "Is N sufficient here?" << endl;
tab_row.len = glp_eval_tab_row(lp, gmi->basic, tab_row.inds, tab_row.coeffs);
- Debug("approx::gmiCut") << "gmi_var " << gmi_var << endl;
+ Trace("approx::gmiCut") << "gmi_var " << gmi_var << endl;
- Debug("approx::gmiCut") << "tab_pos " << tab_row.len << endl;
+ Trace("approx::gmiCut") << "tab_pos " << tab_row.len << endl;
write_pos = 1;
for(read_pos = 1; read_pos <= tab_row.len; ++read_pos){
if (fabs(tab_row.coeffs[read_pos]) < 1e-10){
}
}
tab_row.len = write_pos-1;
- Debug("approx::gmiCut") << "write_pos " << write_pos << endl;
+ Trace("approx::gmiCut") << "write_pos " << write_pos << endl;
Assert(tab_row.len > 0);
for(i = 1; i <= tab_row.len; ++i){
ind = tab_row.inds[i];
- Debug("approx::gmiCut") << "ind " << i << " " << ind << endl;
+ Trace("approx::gmiCut") << "ind " << i << " " << ind << endl;
stat = (ind <= M) ?
glp_get_row_stat(lp, ind) : glp_get_col_stat(lp, ind - M);
- Debug("approx::gmiCut") << "ind " << i << " " << ind << " stat " << stat << endl;
+ Trace("approx::gmiCut") << "ind " << i << " " << ind << " stat " << stat << endl;
switch (stat){
case GLP_NL:
case GLP_NU:
}
}
- if(Debug.isOn("approx::gmiCut")){
- gmi->print(Debug("approx::gmiCut"));
+ if(TraceIsOn("approx::gmiCut")){
+ gmi->print(Trace("approx::gmiCut"));
}
return gmi;
}
glpk_node_p = glp_ios_curr_node(tree);
node_ord = glp_ios_node_ord(tree, glpk_node_p);
Assert(cut_ord > 0);
- Debug("approx") << "curr node " << glpk_node_p
+ Trace("approx") << "curr node " << glpk_node_p
<< " cut ordinal " << cut_ord
<< " node depth " << glp_ios_node_level(tree, glpk_node_p)
<< endl;
}
break;
case GLP_RF_COV:
- Debug("approx") << "GLP_RF_COV" << endl;
+ Trace("approx") << "GLP_RF_COV" << endl;
break;
case GLP_RF_CLQ:
- Debug("approx") << "GLP_RF_CLQ" << endl;
+ Trace("approx") << "GLP_RF_CLQ" << endl;
break;
default:
break;
int N = glp_ios_selected_cuts(tree, ords, rows);
NodeLog& nl = tl.getNode(node_ord);
- Debug("approx") << glpk_node_p << " " << node_ord << " " << cuts << " " << N << std::endl;
+ Trace("approx") << glpk_node_p << " " << node_ord << " " << cuts << " " << N << std::endl;
for(int i = 1; i <= N; ++i){
- Debug("approx") << "adding to " << node_ord <<" @ i= " << i
+ Trace("approx") << "adding to " << node_ord <<" @ i= " << i
<< " ords[i] = " << ords[i]
<< " rows[i] = " << rows[i] << endl;
nl.addSelected(ords[i], rows[i]);
dn_ord = (dn >= 0) ? glp_ios_node_ord(tree, dn) : -1;
up_ord = (up >= 0) ? glp_ios_node_ord(tree, up) : -1;
- Debug("approx::") << "branch: "<< br_var << " " << br_val << " tree " << p << " " << dn << " " << up << endl;
- Debug("approx::") << "\t " << p_ord << " " << dn_ord << " " << up_ord << endl;
+ Trace("approx::") << "branch: "<< br_var << " " << br_val << " tree " << p << " " << dn << " " << up << endl;
+ Trace("approx::") << "\t " << p_ord << " " << dn_ord << " " << up_ord << endl;
if(dn < 0 && up < 0){
- Debug("approx::") << "branch close " << exec << endl;
+ Trace("approx::") << "branch close " << exec << endl;
NodeLog& node = tl.getNode(p_ord);
BranchCutInfo* cut_br = branchCut(tree, exec, br_var, br_val, dn < 0);
node.addCut(cut_br);
tl.close(p_ord);
}else if(dn < 0 || up < 0){
- Debug("approx::") << "branch cut" << exec << endl;
+ Trace("approx::") << "branch cut" << exec << endl;
NodeLog& node = tl.getNode(p_ord);
BranchCutInfo* cut_br = branchCut(tree, exec, br_var, br_val, dn < 0);
node.addCut(cut_br);
}else{
- Debug("approx::") << "normal branch" << endl;
+ Trace("approx::") << "normal branch" << endl;
tl.branch(p_ord, br_var, br_val, dn_ord, up_ord);
}
}
{
glpk_node_p = glp_ios_curr_node(tree);
node_ord = glp_ios_node_ord(tree, glpk_node_p);
- Debug("approx::") << "close " << glpk_node_p << endl;
+ Trace("approx::") << "close " << glpk_node_p << endl;
tl.close(node_ord);
}
break;
switch(glp_ios_reason(tree)){
case GLP_IBINGO:
- Debug("approx::") << "bingo" << endl;
+ Trace("approx::") << "bingo" << endl;
aux->term = MipBingo;
glp_ios_terminate(tree);
break;
int res = glp_intopt(d_mipProb, &parm);
- Debug("approx::solveMIP") << "res "<<res<<" aux.term "<< aux.term << endl;
+ Trace("approx::solveMIP") << "res "<<res<<" aux.term "<< aux.term << endl;
switch(res){
case 0:
case GLP_ESTOP:
{
int status = glp_mip_status(d_mipProb);
- Debug("approx::") << "status " << status << endl;
+ Trace("approx::") << "status " << status << endl;
switch(status){
case GLP_OPT:
case GLP_FEAS:
d_solvedMIP = true;
- Debug("approx::") << "bingo here!" << endl;
+ Trace("approx::") << "bingo here!" << endl;
return MipBingo;
case GLP_NOFEAS:
d_solvedMIP = true;
default:
if(aux.term == MipBingo){
d_solvedMIP = true;
- Debug("approx::") << "bingo here?" << endl;
+ Trace("approx::") << "bingo here?" << endl;
}
return aux.term;
}
iter = xs.begin();
end = xs.end();
- Debug("approx::sumConstraints") << "sumConstraints";
+ Trace("approx::sumConstraints") << "sumConstraints";
for(; iter != end; ++iter){
ArithVar x = *iter;
const Rational& psi = xs[x];
const DeltaRational& bound = c->getValue();
beta += bound * psi;
- Debug("approx::sumConstraints") << " +("<<bound << "*" << psi <<")";
+ Trace("approx::sumConstraints") << " +("<<bound << "*" << psi <<")";
if(anyinf != NULL ){
*anyinf = *anyinf || !bound.infinitesimalIsZero();
}
}
- Debug("approx::sumConstraints") << "= " << beta << endl;
+ Trace("approx::sumConstraints") << "= " << beta << endl;
return beta;
}
std::pair<ConstraintP, ConstraintP> p = vars.explainEqualBounds(x);
exp.insert(p.first);
- Debug("removeFixed") << "remove fixed " << p.first << endl;
+ Trace("removeFixed") << "remove fixed " << p.first << endl;
if(p.second != NullConstraint){
exp.insert(p.second);
- Debug("removeFixed") << "remove fixed " << p.second << endl;
+ Trace("removeFixed") << "remove fixed " << p.second << endl;
}
}
}
DenseMap<Rational> g = guess;
removeAuxillaryVariables(d_vars, g);
- if(Debug.isOn("guessIsConstructable")){
+ if(TraceIsOn("guessIsConstructable")){
if(!g.empty()){
- Debug("approx::guessIsConstructable") << "guessIsConstructable failed " << g.size() << endl;
- DenseVector::print(Debug("approx::guessIsConstructable"), g);
- Debug("approx::guessIsConstructable") << endl;
+ Trace("approx::guessIsConstructable") << "guessIsConstructable failed " << g.size() << endl;
+ DenseVector::print(Trace("approx::guessIsConstructable"), g);
+ Trace("approx::guessIsConstructable") << endl;
}
}
return g.empty();
return true;
}
if(c == NullConstraint){
- Debug("approx::") << "couldn't find " << v << " @ " << nid << endl;
+ Trace("approx::") << "couldn't find " << v << " @ " << nid << endl;
return true;
}
Assert(c != NullConstraint);
bool ApproxGLPK::checkCutOnPad(int nid, const CutInfo& cut) const{
- Debug("approx::checkCutOnPad") << "checkCutOnPad(" << nid <<", " << cut.getId() <<")"<<endl;
+ Trace("approx::checkCutOnPad") << "checkCutOnPad(" << nid <<", " << cut.getId() <<")"<<endl;
const DenseMap<Rational>& constructedLhs = d_pad.d_cut.lhs;
const Rational& constructedRhs = d_pad.d_cut.rhs;
std::unordered_set<ArithVar> visited;
if(constructedLhs.empty()){
- Debug("approx::checkCutOnPad") << "its empty?" <<endl;
+ Trace("approx::checkCutOnPad") << "its empty?" <<endl;
return true;
}
if(cut.getKind() != d_pad.d_cutKind) {
- Debug("approx::checkCutOnPad") << "rel doesn't match" << endl;
+ Trace("approx::checkCutOnPad") << "rel doesn't match" << endl;
return true;
}
if(!constructedLhs.isKey(x)){
- if(Debug.isOn("approx::checkCutOnPad")){
- Debug("approx::checkCutOnPad") << " didn't find key for " << x << std::endl;
- cut.print(Debug("approx::checkCutOnPad"));
- Debug("approx::checkCutOnPad") << endl;
- d_pad.d_cut.print(Debug("approx::checkCutOnPad"));
- Debug("approx::checkCutOnPad") << endl;
+ if(TraceIsOn("approx::checkCutOnPad")){
+ Trace("approx::checkCutOnPad") << " didn't find key for " << x << std::endl;
+ cut.print(Trace("approx::checkCutOnPad"));
+ Trace("approx::checkCutOnPad") << endl;
+ d_pad.d_cut.print(Trace("approx::checkCutOnPad"));
+ Trace("approx::checkCutOnPad") << endl;
}
return true;
}
const Rational& onConstructed = constructedLhs[x];
- Debug("approx::checkCutOnPad") << ind << " " << coeff << " " << endl;
- Debug("approx::checkCutOnPad") << " " << x << " " << onConstructed << endl;
+ Trace("approx::checkCutOnPad") << ind << " " << coeff << " " << endl;
+ Trace("approx::checkCutOnPad") << " " << x << " " << onConstructed << endl;
if(!roughlyEqual(coeff, onConstructed.getDouble())){
- Debug("approx::checkCutOnPad") << "coeff failure" << endl;
+ Trace("approx::checkCutOnPad") << "coeff failure" << endl;
return true;
}
}
if(visited.size() != constructedLhs.size()){
- Debug("approx::checkCutOnPad") << "size mismatch" << endl;
+ Trace("approx::checkCutOnPad") << "size mismatch" << endl;
return true;
}
if(!roughlyEqual(cut.getRhs(), constructedRhs.getDouble())){
- Debug("approx::checkCutOnPad")
+ Trace("approx::checkCutOnPad")
<< "norm rhs is off " << cut.getRhs() << " " << constructedRhs << endl;
return true;
}
d_pad.d_failure = (delta->sgn() <= 0);
if(d_pad.d_failure){ return true; }
- Debug("approx::mir") << "applyCMIRRule() " << delta << " " << mir.delta << endl;
+ Trace("approx::mir") << "applyCMIRRule() " << delta << " " << mir.delta << endl;
DenseMap<Rational>::const_iterator iter, iend;
iter = alpha.begin(), iend = alpha.end();
bool ApproxGLPK::loadVB(int nid, int M, int j, int ri, bool wantUb, VirtualBound& tmp){
if(ri <= 0) { return true; }
- Debug("glpk::loadVB") << "loadVB()" << endl;
+ Trace("glpk::loadVB") << "loadVB()" << endl;
ArithVar rowVar = _getArithVar(nid, M, ri);
ArithVar contVar = _getArithVar(nid, M, j);
if(rowVar == ARITHVAR_SENTINEL){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " rowVar is ARITHVAR_SENTINEL " << rowVar << endl;
return true;
}
if(contVar == ARITHVAR_SENTINEL){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " contVar is ARITHVAR_SENTINEL " << contVar
<< endl;
return true; }
if(!d_vars.isAuxiliary(rowVar)){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " rowVar is not auxilliary " << rowVar << endl;
return true;
}
// is integer is correct here
if(d_vars.isInteger(contVar)){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " contVar is integer " << contVar << endl;
return true;
}
ConstraintP ub = d_vars.getUpperBoundConstraint(rowVar);
if(lb != NullConstraint && ub != NullConstraint){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " lb and ub are both NULL " << lb << " " << ub
<< endl;
return true;
ConstraintP rcon = lb == NullConstraint ? ub : lb;
if(rcon == NullConstraint) {
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " rcon is NULL " << rcon << endl;
return true;
}
if(!rcon->getValue().isZero()){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " rcon value is not 0 " << rcon->getValue()
<< endl;
return true;
}
if(!d_vars.hasNode(rowVar)){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " does not have node " << rowVar << endl;
return true;
}
Polynomial p = Polynomial::parsePolynomial(d_vars.asNode(rowVar));
if (p.size() != 2)
{
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " polynomial is not binary: " << p.getNode()
<< endl;
return true;
Node nx2 = second.getVarList().getNode();
if(!d_vars.hasArithVar(nx1)) {
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " does not have a variable for nx1: " << nx1
<< endl;
return true;
}
if(!d_vars.hasArithVar(nx2)) {
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " does not have a variable for nx2 " << nx2
<< endl;
return true;
Assert(!c1.isZero());
Assert(!c2.isZero());
- Debug("glpk::loadVB")
+ Trace("glpk::loadVB")
<< " lb " << lb
<< " ub " << ub
<< " rcon " << rcon
Rational& cc = (x1 == contVar) ? c1 : c2;
Rational& ic = (x1 == contVar) ? c2 : c1;
- Debug("glpk::loadVB")
+ Trace("glpk::loadVB")
<< " cv " << contVar
<< " cc " << cc
<< " iv " << iv
<< " c2 " << ic << endl;
if(!d_vars.isIntegerInput(iv)){
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " iv is not an integer input variable " << iv
<< endl;
return true;
if(rcon == ub){ // multiply by -1
cc = -cc; ic = - ic;
}
- Debug("glpk::loadVB") << " cv " << contVar
+ Trace("glpk::loadVB") << " cv " << contVar
<< " cc " << cc
<< " iv " << iv
<< " c2 " << ic << endl;
// cv >= -ic/cc * iv
Assert(!cc.isZero());
Rational d = -ic/cc;
- Debug("glpk::loadVB") << d << " " << cc.sgn() << endl;
+ Trace("glpk::loadVB") << d << " " << cc.sgn() << endl;
bool nowUb = cc.sgn() < 0;
if(wantUb != nowUb) {
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " wantUb is not nowUb " << wantUb << " " << nowUb
<< endl;
Kind rel = wantUb ? kind::LEQ : kind::GEQ;
tmp = VirtualBound(contVar, rel, d, iv, rcon);
- Debug("glpk::loadVB") << "loadVB()"
+ Trace("glpk::loadVB") << "loadVB()"
<< " was successful" << endl;
return false;
}
if(d_pad.d_vlb.isKey(tmp.x)){ return true; }
d_pad.d_vlb.set(tmp.x, tmp);
}else if(mir.vlbRows[j] > 0){
- Debug("approx::mir") << "expected vlb to work" << endl;
+ Trace("approx::mir") << "expected vlb to work" << endl;
}
if(!loadVB(nid, M, j, mir.vubRows[j], true, tmp)){
if(d_pad.d_vub.isKey(tmp.x)){ return true; }
d_pad.d_vub.set(tmp.x, tmp);
}else if(mir.vubRows[j] > 0){
- Debug("approx::mir") << "expected vub to work" << endl;
+ Trace("approx::mir") << "expected vub to work" << endl;
}
}
return false;
SlackReplace rep;
bool lb;
ConstraintP b;
- Debug("approx::mir") << "loadSlacksIntoPad(): N="<<N<<", M=" << M << std::endl;
+ Trace("approx::mir") << "loadSlacksIntoPad(): N="<<N<<", M=" << M << std::endl;
for(int j=1; j <= N+M; ++j){
ArithVar v = _getArithVar(nid, M, j);
if(v == ARITHVAR_SENTINEL){
- Debug("approx::mir") << " for: " << j << " no variable" << endl;
+ Trace("approx::mir") << " for: " << j << " no variable" << endl;
continue;
}
rep = SlackUndef;
}
}
- Debug("approx::mir") << " for: " << j << ", " << v;
- Debug("approx::mir") << " " << ((rep != SlackUndef) ? "succ" : "fail") << " ";
- Debug("approx::mir") << sub << " " << rep << " " << mir.vlbRows[j] << " " << mir.vubRows[j]
+ Trace("approx::mir") << " for: " << j << ", " << v;
+ Trace("approx::mir") << " " << ((rep != SlackUndef) ? "succ" : "fail") << " ";
+ Trace("approx::mir") << sub << " " << rep << " " << mir.vlbRows[j] << " " << mir.vubRows[j]
<< endl;
if(rep != SlackUndef){
d_pad.d_slacks.set(v,rep);
case '?':
continue;
default:
- Debug("approx::mir") << " for: " << j << " got subst " << (int)sub << endl;
+ Trace("approx::mir") << " for: " << j << " got subst " << (int)sub << endl;
continue;
}
}
}
}
- Debug("approx::mir") << "beg loadRowSumIntoAgg() 1" << endl;
- if(Debug.isOn("approx::mir")) { DenseVector::print(Debug("approx::mir"), lhs); }
+ Trace("approx::mir") << "beg loadRowSumIntoAgg() 1" << endl;
+ if(TraceIsOn("approx::mir")) { DenseVector::print(Trace("approx::mir"), lhs); }
removeAuxillaryVariables(d_vars, lhs);
- Debug("approx::mir") << "end loadRowSumIntoAgg() 1" << endl;
+ Trace("approx::mir") << "end loadRowSumIntoAgg() 1" << endl;
- if(Debug.isOn("approx::mir")){
- Debug("approx::mir") << "loadRowSumIntoAgg() 2" << endl;
- DenseVector::print(Debug("approx::mir"), lhs);
- Debug("approx::mir") << "end loadRowSumIntoAgg() 2" << endl;
+ if(TraceIsOn("approx::mir")){
+ Trace("approx::mir") << "loadRowSumIntoAgg() 2" << endl;
+ DenseVector::print(Trace("approx::mir"), lhs);
+ Trace("approx::mir") << "end loadRowSumIntoAgg() 2" << endl;
}
for(int i = 1; i <= len; ++i){
lhs.set(x, *c);
}
- if(Debug.isOn("approx::mir")){
- Debug("approx::mir") << "loadRowSumIntoAgg() 2" << endl;
- DenseVector::print(Debug("approx::mir"), lhs);
- Debug("approx::mir") << "end loadRowSumIntoAgg() 3" << endl;
+ if(TraceIsOn("approx::mir")){
+ Trace("approx::mir") << "loadRowSumIntoAgg() 2" << endl;
+ DenseVector::print(Trace("approx::mir"), lhs);
+ Trace("approx::mir") << "end loadRowSumIntoAgg() 3" << endl;
}
return false;
}
DenseMap<Rational>& mod = d_pad.d_mod.lhs;
Rational& modRhs = d_pad.d_mod.rhs;
- Debug("approx::mir")
+ Trace("approx::mir")
<< "buildModifiedRow()"
<< " |agg|=" << d_pad.d_agg.lhs.size()
<< " |mod|=" << d_pad.d_mod.lhs.size()
ArithVar x = *iter;
const Rational& c = mod[x];
if(!d_pad.d_slacks.isKey(x)){
- Debug("approx::mir") << "missed x: " << x << endl;
+ Trace("approx::mir") << "missed x: " << x << endl;
return true;
}
SlackReplace rep = d_pad.d_slacks[x];
}
}
- Debug("approx::mir") << "makeRangeForComplemented()" << complemented << endl;
+ Trace("approx::mir") << "makeRangeForComplemented()" << complemented << endl;
return false;
}
}
}
- Debug("approx::mir")
+ Trace("approx::mir")
<< "constructMixedKnapsack() "
<<" dropped " << dropped
<<" remain " << remain
if(d_vars.isAuxiliary(basic)) { return true; }
- if(Debug.isOn("gaussianElimConstructTableRow")){
- Debug("gaussianElimConstructTableRow") << "1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
- vec.print(Debug("gaussianElimConstructTableRow"));
- Debug("gaussianElimConstructTableRow") << "match " << basic << "("<<d_vars.asNode(basic)<<")"<<endl;
+ if(TraceIsOn("gaussianElimConstructTableRow")){
+ Trace("gaussianElimConstructTableRow") << "1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ vec.print(Trace("gaussianElimConstructTableRow"));
+ Trace("gaussianElimConstructTableRow") << "match " << basic << "("<<d_vars.asNode(basic)<<")"<<endl;
}
set<ArithVar> onrow;
int ind = vec.inds[i];
ArithVar var = _getArithVar(nid, M, ind);
if(var == ARITHVAR_SENTINEL){
- Debug("gaussianElimConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl;
+ Trace("gaussianElimConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl;
return true;
}
onrow.insert(var);
}
- Debug("gaussianElimConstructTableRow") << "2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
Matrix<Rational> A;
A.increaseSizeTo(d_vars.getNumberOfVariables());
rows.push_back(make_pair(rid, ARITHVAR_SENTINEL));
}
}
- Debug("gaussianElimConstructTableRow") << "3 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "3 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
for(size_t i=0; i < rows.size(); ++i){
RowIndex rid = rows[i].first;
Assert(!e.getCoefficient().isZero());
Rational cp = e.getCoefficient();
- Debug("gaussianElimConstructTableRow")
+ Trace("gaussianElimConstructTableRow")
<< "on " << rid << " subst " << cp << "*" << prevRow << " " << other << endl;
A.rowPlusRowTimesConstant(rid, prevRow, cp);
}
}
- if(Debug.isOn("gaussianElimConstructTableRow")){
- A.printMatrix(Debug("gaussianElimConstructTableRow"));
+ if(TraceIsOn("gaussianElimConstructTableRow")){
+ A.printMatrix(Trace("gaussianElimConstructTableRow"));
}
// solve the row for anything other than non-basics
}
}
if(s == ARITHVAR_SENTINEL || q.isZero()){
- Debug("gaussianElimConstructTableRow") << "3 fail gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "3 fail gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}else{
// 0 = q * s + sum c_i * x_i
Rational mult = -(q.inverse());
- Debug("gaussianElimConstructTableRow") << "selecting " << s << " : " << mult << endl;
- Debug("gaussianElimConstructTableRow") << "selecting " << rid << " " << s << endl;
+ Trace("gaussianElimConstructTableRow") << "selecting " << s << " : " << mult << endl;
+ Trace("gaussianElimConstructTableRow") << "selecting " << rid << " " << s << endl;
//cout << "selecting " << s << " : complexity " << mult.complexity() << " " << mult << endl;
//cout << "selecting " << rid << " " << s << endl;
A.multiplyRowByConstant(rid, mult);
rows[i].second = s;
}
}
- Debug("gaussianElimConstructTableRow") << "4 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "4 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
if(rows.empty()) {
- Debug("gaussianElimConstructTableRow") << "4 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "4 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
RowIndex rid_last = rows.back().first;
ArithVar rid_var = rows.back().second;
if(rid_var != basic){
- Debug("gaussianElimConstructTableRow") << "4 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "4 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
const Matrix<Rational>::Entry& e = *k;
tab.set(e.getColVar(), e.getCoefficient());
}
- Debug("gaussianElimConstructTableRow") << "5 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "5 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
if(!tab.isKey(basic)){
- Debug("gaussianElimConstructTableRow") << "5 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "5 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
if(tab[basic] != Rational(-1)){
- Debug("gaussianElimConstructTableRow") << "5 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "5 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
tab.remove(basic);
- Debug("gaussianElimConstructTableRow") << "6 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "6 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
if(vec.len < 0 ){
- Debug("gaussianElimConstructTableRow") << "6 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "6 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
if(tab.size() != ((unsigned)vec.len) ) {
- Debug("gaussianElimConstructTableRow") << "6 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<< tab.size() << " " << vec.len << endl;
+ Trace("gaussianElimConstructTableRow") << "6 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<< tab.size() << " " << vec.len << endl;
return true;
}
- Debug("gaussianElimConstructTableRow") << "7 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "7 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
for(int i = 1; i <= vec.len; ++i){
int ind = vec.inds[i];
ArithVar var = _getArithVar(nid, M, ind);
Assert(var != ARITHVAR_SENTINEL);
if(!tab.isKey(var)){
- Debug("gaussianElimConstructTableRow") << "7 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
+ Trace("gaussianElimConstructTableRow") << "7 fail 1 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"<<endl;
return true;
}
double est = tab[var].getDouble();
if(!ApproximateSimplex::roughlyEqual(coeff, est)){
- Debug("gaussianElimConstructTableRow") << "7 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"
+ Trace("gaussianElimConstructTableRow") << "7 fail 2 gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"
<< " boink on " << ind << " " << var << " " << est <<endl;
return true;
}
- Debug("gaussianElimConstructTableRow") << var << " cfe " << coeff << endl;
+ Trace("gaussianElimConstructTableRow") << var << " cfe " << coeff << endl;
}
- Debug("gaussianElimConstructTableRow")
+ Trace("gaussianElimConstructTableRow")
<< "gaussianElimConstructTableRow("<<nid <<", "<< basic<< ")"
<< " superduper" << endl;
const Integer& D = d_denomGuesses[i];
if(!guessCoefficientsConstructTableRow(nid, M, vec, D)){
d_stats.d_averageGuesses << i+1;
- Debug("approx::gmi") << "guesseditat " << i << " D=" << D << endl;
+ Trace("approx::gmi") << "guesseditat " << i << " D=" << D << endl;
return false;
}
}
Assert(tab.empty());
Assert(d_pad.d_tabRow.rhs.isZero());
- if(Debug.isOn("guessCoefficientsConstructTableRow")){
- Debug("guessCoefficientsConstructTableRow") << "attemptConstructTableRow("<<nid <<", "<< basic<<",...," << D<< ")"<<endl;
- vec.print(Debug("guessCoefficientsConstructTableRow"));
- Debug("guessCoefficientsConstructTableRow") << "match " << basic << "("<<d_vars.asNode(basic)<<")"<<endl;
+ if(TraceIsOn("guessCoefficientsConstructTableRow")){
+ Trace("guessCoefficientsConstructTableRow") << "attemptConstructTableRow("<<nid <<", "<< basic<<",...," << D<< ")"<<endl;
+ vec.print(Trace("guessCoefficientsConstructTableRow"));
+ Trace("guessCoefficientsConstructTableRow") << "match " << basic << "("<<d_vars.asNode(basic)<<")"<<endl;
}
tab.set(basic, Rational(-1));
double coeff = vec.coeffs[i];
ArithVar var = _getArithVar(nid, M, ind);
if(var == ARITHVAR_SENTINEL){
- Debug("guessCoefficientsConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl;
+ Trace("guessCoefficientsConstructTableRow") << "couldn't find" << ind << " " << M << " " << nid << endl;
return true;
}
- Debug("guessCoefficientsConstructTableRow") << "match " << ind << "," << var << "("<<d_vars.asNode(var)<<")"<<endl;
+ Trace("guessCoefficientsConstructTableRow") << "match " << ind << "," << var << "("<<d_vars.asNode(var)<<")"<<endl;
std::optional<Rational> cfe = estimateWithCFE(coeff, D);
if (!cfe)
return true;
}
tab.set(var, *cfe);
- Debug("guessCoefficientsConstructTableRow") << var << " cfe " << cfe << endl;
+ Trace("guessCoefficientsConstructTableRow") << var << " cfe " << cfe << endl;
}
if(!guessIsConstructable(tab)){
- Debug("guessCoefficientsConstructTableRow") << "failed to construct with " << D << endl;
+ Trace("guessCoefficientsConstructTableRow") << "failed to construct with " << D << endl;
return true;
}
tab.remove(basic);
bool anyInf;
DeltaRational dbeta = sumConstraints(tabRow, toBound, &anyInf);
const Rational& beta = dbeta.getNoninfinitesimalPart();
- Debug("approx::gmi") << dbeta << endl;
+ Trace("approx::gmi") << dbeta << endl;
if(anyInf || beta.isIntegral()){ return true; }
Rational one = Rational(1);
}else if(d_vars.isIntegerInput(x) && psi.isIntegral()){
// do not add a coefficient
// nothing to explain
- Debug("approx::gmi") << "skipping " << x << endl;
+ Trace("approx::gmi") << "skipping " << x << endl;
}else{
explanation.insert(c);
Rational phi;
}
}
}
- if(Debug.isOn("approx::gmi")){
- Debug("approx::gmi") << "pre removeSlackVariables";
- d_pad.d_cut.print(Debug("approx::gmi"));
- Debug("approx::gmi") << endl;
+ if(TraceIsOn("approx::gmi")){
+ Trace("approx::gmi") << "pre removeSlackVariables";
+ d_pad.d_cut.print(Trace("approx::gmi"));
+ Trace("approx::gmi") << endl;
}
removeAuxillaryVariables(d_vars, cut);
- if(Debug.isOn("approx::gmi")){
- Debug("approx::gmi") << "post removeAuxillaryVariables";
- d_pad.d_cut.print(Debug("approx::gmi"));
- Debug("approx::gmi") << endl;
+ if(TraceIsOn("approx::gmi")){
+ Trace("approx::gmi") << "post removeAuxillaryVariables";
+ d_pad.d_cut.print(Trace("approx::gmi"));
+ Trace("approx::gmi") << endl;
}
removeFixed(d_vars, d_pad.d_cut, explanation);
- if(Debug.isOn("approx::gmi")){
- Debug("approx::gmi") << "post removeFixed";
- d_pad.d_cut.print(Debug("approx::gmi"));
- Debug("approx::gmi") << endl;
+ if(TraceIsOn("approx::gmi")){
+ Trace("approx::gmi") << "post removeFixed";
+ d_pad.d_cut.print(Trace("approx::gmi"));
+ Trace("approx::gmi") << endl;
}
return false;
}
cut.swapExplanation(asvec);
}
}else{
- Debug("approx") << "failure " << cut.getKlass() << endl;
+ Trace("approx") << "failure " << cut.getKlass() << endl;
}
}
}
void ArithIteUtils::addSubstitution(TNode f, TNode t){
- Debug("arith::ite") << "adding " << f << " -> " << t << endl;
+ Trace("arith::ite") << "adding " << f << " -> " << t << endl;
d_subcount = d_subcount + 1;
d_subs.addSubstitution(f, t);
}
Assert(l.getKind() == kind::EQUAL);
Assert(r.getKind() == kind::EQUAL);
- Debug("arith::ite") << "bin or " << n << endl;
+ Trace("arith::ite") << "bin or " << n << endl;
bool lArithEq = l.getKind() == kind::EQUAL && l[0].getType().isInteger();
bool rArithEq = r.getKind() == kind::EQUAL && r[0].getType().isInteger();
}else if(l[1] == r[1]){
sel = l[1]; otherL = l[0]; otherR = r[0];
}
- Debug("arith::ite") << "selected " << sel << endl;
+ Trace("arith::ite") << "selected " << sel << endl;
if(sel.isVar() && sel.getKind() != kind::SKOLEM){
- Debug("arith::ite") << "others l:" << otherL << " r " << otherR << endl;
+ Trace("arith::ite") << "others l:" << otherL << " r " << otherR << endl;
Node useForCmpL = selectForCmp(otherL);
Node useForCmpR = selectForCmp(otherR);
Polynomial rside = Polynomial::parsePolynomial( useForCmpR );
Polynomial diff = lside-rside;
- Debug("arith::ite") << "diff: " << diff.getNode() << endl;
+ Trace("arith::ite") << "diff: " << diff.getNode() << endl;
if(diff.isConstant()){
// a: (sel = otherL) or (sel = otherR), otherL-otherR = c
NodeBuilder& learned,
const TNodeSet& defTrue)
{
- Debug("arith::static") << "===================== looking at " << n << endl;
+ Trace("arith::static") << "===================== looking at " << n << endl;
switch(n.getKind()){
case ITE:
if (expr::hasBoundVar(n))
{
// Unsafe with non-ground ITEs; do nothing
- Debug("arith::static")
+ Trace("arith::static")
<< "(potentially) non-ground ITE, ignoring..." << endl;
break;
}
case LEQ: { // (ite (<= x y) x y)
Node nLeqX = NodeBuilder(LEQ) << n << t;
Node nLeqY = NodeBuilder(LEQ) << n << e;
- Debug("arith::static") << n << "is a min =>" << nLeqX << nLeqY << endl;
+ Trace("arith::static") << n << "is a min =>" << nLeqX << nLeqY << endl;
learned << nLeqX << nLeqY;
++(d_statistics.d_iteMinMaxApplications);
break;
case GEQ: { // (ite (>= x y) x y)
Node nGeqX = NodeBuilder(GEQ) << n << t;
Node nGeqY = NodeBuilder(GEQ) << n << e;
- Debug("arith::static") << n << "is a max =>" << nGeqX << nGeqY << endl;
+ Trace("arith::static") << n << "is a max =>" << nGeqX << nGeqY << endl;
learned << nGeqX << nGeqY;
++(d_statistics.d_iteMinMaxApplications);
break;
{
Assert(n.getKind() == ITE);
- Debug("arith::static") << "iteConstant(" << n << ")" << endl;
+ Trace("arith::static") << "iteConstant(" << n << ")" << endl;
if (d_minMap.find(n[1]) != d_minMap.end() && d_minMap.find(n[2]) != d_minMap.end()) {
const DeltaRational& first = d_minMap[n[1]];
n,
nm->mkConstRealOrInt(n.getType(), min.getNoninfinitesimalPart()));
learned << nGeqMin;
- Debug("arith::static") << n << " iteConstant" << nGeqMin << endl;
+ Trace("arith::static") << n << " iteConstant" << nGeqMin << endl;
++(d_statistics.d_iteConstantApplications);
}
}
n,
nm->mkConstRealOrInt(n.getType(), max.getNoninfinitesimalPart()));
learned << nLeqMax;
- Debug("arith::static") << n << " iteConstant" << nLeqMax << endl;
+ Trace("arith::static") << n << " iteConstant" << nLeqMax << endl;
++(d_statistics.d_iteConstantApplications);
}
}
if (maxFind == d_maxMap.end() || (*maxFind).second > bound)
{
d_maxMap.insert(n[0], bound);
- Debug("arith::static") << "adding bound " << n << endl;
+ Trace("arith::static") << "adding bound " << n << endl;
}
break;
case kind::GT: bound = DeltaRational(constant, 1); CVC5_FALLTHROUGH;
if (minFind == d_minMap.end() || (*minFind).second < bound)
{
d_minMap.insert(n[0], bound);
- Debug("arith::static") << "adding bound " << n << endl;
+ Trace("arith::static") << "adding bound " << n << endl;
}
break;
default: Unhandled() << k; break;
d_errorSet.setSelectionRule(options::ErrorSelectionRule::VAR_ORDER);
if(processSignals()){
- Debug("arith::findModel") << "attemptSolution() early conflict" << endl;
+ Trace("arith::findModel") << "attemptSolution() early conflict" << endl;
d_conflictVariables.purge();
return Result::UNSAT;
}else if(d_errorSet.errorEmpty()){
- Debug("arith::findModel") << "attemptSolution() fixed itself" << endl;
+ Trace("arith::findModel") << "attemptSolution() fixed itself" << endl;
return Result::SAT;
}
Node less = nm->mkNode(LT, var, nm->mkConstInt(nearest));
Node greater = nm->mkNode(GT, var, nm->mkConstInt(nearest));
// TODO (project #37): justify. Thread proofs through *ensureLiteral*.
- Debug("integers::pf") << "less: " << less << std::endl;
- Debug("integers::pf") << "greater: " << greater << std::endl;
- Debug("integers::pf") << "literal: " << literal << std::endl;
- Debug("integers::pf") << "eq: " << eq << std::endl;
- Debug("integers::pf") << "rawEq: " << rawEq << std::endl;
+ Trace("integers::pf") << "less: " << less << std::endl;
+ Trace("integers::pf") << "greater: " << greater << std::endl;
+ Trace("integers::pf") << "literal: " << literal << std::endl;
+ Trace("integers::pf") << "eq: " << eq << std::endl;
+ Trace("integers::pf") << "rawEq: " << rawEq << std::endl;
Pf pfNotLit = d_pnm->mkAssume(literal.negate());
// rewrite notLiteral to notRawEq, using teq.
Pf pfNotRawEq =
TNode predicate, bool value)
{
Assert(predicate.getKind() == kind::EQUAL);
- Debug("arith::congruences")
+ Trace("arith::congruences")
<< "ArithCongruenceNotify::eqNotifyTriggerPredicate(" << predicate << ", "
<< (value ? "true" : "false") << ")" << std::endl;
if (value) {
}
bool ArithCongruenceManager::ArithCongruenceNotify::eqNotifyTriggerTermEquality(TheoryId tag, TNode t1, TNode t2, bool value) {
- Debug("arith::congruences") << "ArithCongruenceNotify::eqNotifyTriggerTermEquality(" << t1 << ", " << t2 << ", " << (value ? "true" : "false") << ")" << std::endl;
+ Trace("arith::congruences") << "ArithCongruenceNotify::eqNotifyTriggerTermEquality(" << t1 << ", " << t2 << ", " << (value ? "true" : "false") << ")" << std::endl;
if (value) {
return d_acm.propagate(t1.eqNode(t2));
} else {
}
}
void ArithCongruenceManager::ArithCongruenceNotify::eqNotifyConstantTermMerge(TNode t1, TNode t2) {
- Debug("arith::congruences") << "ArithCongruenceNotify::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << std::endl;
+ Trace("arith::congruences") << "ArithCongruenceNotify::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << std::endl;
d_acm.propagate(t1.eqNode(t2));
}
void ArithCongruenceManager::ArithCongruenceNotify::eqNotifyNewClass(TNode t) {
std::shared_ptr<ProofNode> pf)
{
Assert(!inConflict());
- Debug("arith::conflict") << "difference manager conflict " << conflict << std::endl;
+ Trace("arith::conflict") << "difference manager conflict " << conflict << std::endl;
d_inConflict.raise();
d_raiseConflict.raiseEEConflict(conflict, pf);
}
}
void ArithCongruenceManager::watchedVariableIsZero(ConstraintCP eq){
- Debug("arith::cong") << "Cong::watchedVariableIsZero: " << *eq << std::endl;
+ Trace("arith::cong") << "Cong::watchedVariableIsZero: " << *eq << std::endl;
Assert(eq->isEquality());
Assert(eq->getValue().sgn() == 0);
//These will be safe for propagation later as well
NodeBuilder nb(Kind::AND);
// An open proof of eq from literals now in reason.
- if (Debug.isOn("arith::cong"))
+ if (TraceIsOn("arith::cong"))
{
- eq->printProofTree(Debug("arith::cong"));
+ eq->printProofTree(Trace("arith::cong"));
}
auto pf = eq->externalExplainByAssertions(nb);
if (isProofEnabled())
}
void ArithCongruenceManager::watchedVariableCannotBeZero(ConstraintCP c){
- Debug("arith::cong::notzero")
+ Trace("arith::cong::notzero")
<< "Cong::watchedVariableCannotBeZero " << *c << std::endl;
++(d_statistics.d_watchedVariableIsNotZero);
NodeBuilder nb(Kind::AND);
// An open proof of eq from literals now in reason.
auto pf = c->externalExplainByAssertions(nb);
- if (Debug.isOn("arith::cong::notzero"))
+ if (TraceIsOn("arith::cong::notzero"))
{
- Debug("arith::cong::notzero") << " original proof ";
- pf->printDebug(Debug("arith::cong::notzero"));
- Debug("arith::cong::notzero") << std::endl;
+ Trace("arith::cong::notzero") << " original proof ";
+ pf->printDebug(Trace("arith::cong::notzero"));
+ Trace("arith::cong::notzero") << std::endl;
}
Node reason = mkAndFromBuilder(nb);
if (isProofEnabled())
}
else
{
- Debug("arith::cong::notzero")
+ Trace("arith::cong::notzero")
<< " proof modification needed" << std::endl;
// Four cases:
PfRule::MACRO_SR_PRED_TRANSFORM, {sumPf}, {nm->mkConst(false)});
std::vector<Node> assumption = {isZero};
pf = d_pnm->mkScope(botPf, assumption, false);
- Debug("arith::cong::notzero") << " new proof ";
- pf->printDebug(Debug("arith::cong::notzero"));
- Debug("arith::cong::notzero") << std::endl;
+ Trace("arith::cong::notzero") << " new proof ";
+ pf->printDebug(Trace("arith::cong::notzero"));
+ Trace("arith::cong::notzero") << std::endl;
}
Assert(pf->getResult() == disEq);
}
bool ArithCongruenceManager::propagate(TNode x){
- Debug("arith::congruenceManager")<< "ArithCongruenceManager::propagate("<<x<<")"<<std::endl;
+ Trace("arith::congruenceManager")<< "ArithCongruenceManager::propagate("<<x<<")"<<std::endl;
if(inConflict()){
return true;
}
++(d_statistics.d_conflicts);
TrustNode trn = explainInternal(x);
Node conf = flattenAnd(trn.getNode());
- Debug("arith::congruenceManager") << "rewritten to false "<<x<<" with explanation "<< conf << std::endl;
+ Trace("arith::congruenceManager") << "rewritten to false "<<x<<" with explanation "<< conf << std::endl;
if (isProofEnabled())
{
auto pf = trn.getGenerator()->getProofFor(trn.getProven());
Assert(c != NullConstraint);
}
- Debug("arith::congruenceManager")<< "x is "
+ Trace("arith::congruenceManager")<< "x is "
<< c->hasProof() << " "
<< (x == rewritten) << " "
<< c->canBePropagated() << " "
++(d_statistics.d_conflicts);
raiseConflict(final);
- Debug("arith::congruenceManager") << "congruenceManager found a conflict " << final << std::endl;
+ Trace("arith::congruenceManager") << "congruenceManager found a conflict " << final << std::endl;
return false;
}
void ArithCongruenceManager::addWatchedPair(ArithVar s, TNode x, TNode y){
Assert(!isWatchedVariable(s));
- Debug("arith::congruenceManager")
+ Trace("arith::congruenceManager")
<< "addWatchedPair(" << s << ", " << x << ", " << y << ")" << std::endl;
{
setProofFor(lit, pf);
Trace("arith-pfee") << "Actually asserting" << std::endl;
- if (Debug.isOn("arith-pfee"))
+ if (TraceIsOn("arith-pfee"))
{
Trace("arith-pfee") << "Proof: ";
pf->printDebug(Trace("arith-pfee"));
Assert(c->isEquality());
++(d_statistics.d_equalsConstantCalls);
- Debug("equalsConstant") << "equals constant " << c << std::endl;
+ Trace("equalsConstant") << "equals constant " << c << std::endl;
ArithVar x = c->getVariable();
Node xAsNode = d_avariables.asNode(x);
Assert(lb->getVariable() == ub->getVariable());
++(d_statistics.d_equalsConstantCalls);
- Debug("equalsConstant") << "equals constant " << lb << std::endl
+ Trace("equalsConstant") << "equals constant " << lb << std::endl
<< ub << std::endl;
ArithVar x = lb->getVariable();
void ValueCollection::push_into(std::vector<ConstraintP>& vec) const {
- Debug("arith::constraint") << "push_into " << *this << endl;
+ Trace("arith::constraint") << "push_into " << *this << endl;
if(hasEquality()){
vec.push_back(d_equality);
}
if(initialized()){
ValueCollection& vc = d_variablePosition->second;
- Debug("arith::constraint") << "removing" << vc << endl;
+ Trace("arith::constraint") << "removing" << vc << endl;
vc.remove(getType());
if(vc.empty()){
- Debug("arith::constraint") << "erasing" << vc << endl;
+ Trace("arith::constraint") << "erasing" << vc << endl;
SortedConstraintMap& perVariable = d_database->getVariableSCM(getVariable());
perVariable.erase(d_variablePosition);
}
ConstraintP Constraint::getCeiling() {
- Debug("getCeiling") << "Constraint_::getCeiling on " << *this << endl;
+ Trace("getCeiling") << "Constraint_::getCeiling on " << *this << endl;
Assert(getValue().getInfinitesimalPart().sgn() > 0);
const DeltaRational ceiling(getValue().ceiling());
Assert(negationHasProof() == nowInConflict);
d_database->pushAssertionOrderWatch(this, witness);
- if(Debug.isOn("constraint::conflictCommit") && nowInConflict ){
- Debug("constraint::conflictCommit") << "inConflict@setAssertedToTheTheory";
- Debug("constraint::conflictCommit") << "\t" << this << std::endl;
- Debug("constraint::conflictCommit") << "\t" << getNegation() << std::endl;
- Debug("constraint::conflictCommit") << "\t" << getNegation()->externalExplainByAssertions() << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && nowInConflict ){
+ Trace("constraint::conflictCommit") << "inConflict@setAssertedToTheTheory";
+ Trace("constraint::conflictCommit") << "\t" << this << std::endl;
+ Trace("constraint::conflictCommit") << "\t" << getNegation() << std::endl;
+ Trace("constraint::conflictCommit") << "\t" << getNegation()->externalExplainByAssertions() << std::endl;
}
}
bool Constraint::hasSimpleFarkasProof() const
{
- Debug("constraints::hsfp") << "hasSimpleFarkasProof " << this << std::endl;
+ Trace("constraints::hsfp") << "hasSimpleFarkasProof " << this << std::endl;
if (!hasFarkasProof())
{
- Debug("constraints::hsfp") << "There is no simple Farkas proof because "
+ Trace("constraints::hsfp") << "There is no simple Farkas proof because "
"there is no farkas proof."
<< std::endl;
return false;
}
// ... otherwise, we do not have a simple Farkas proof.
- if (Debug.isOn("constraints::hsfp"))
+ if (TraceIsOn("constraints::hsfp"))
{
- Debug("constraints::hsfp") << "There is no simple Farkas proof b/c there "
+ Trace("constraints::hsfp") << "There is no simple Farkas proof b/c there "
"is an antecdent w/ rule ";
- a->getConstraintRule().print(Debug("constraints::hsfp"), d_produceProofs);
- Debug("constraints::hsfp") << std::endl;
+ a->getConstraintRule().print(Trace("constraints::hsfp"), d_produceProofs);
+ Trace("constraints::hsfp") << std::endl;
}
return false;
const ArithVariables& avariables = d_database->getArithVariables();
- Debug("Constraint::sanityChecking") << cmp.getNode() << endl;
- Debug("Constraint::sanityChecking") << k << endl;
- Debug("Constraint::sanityChecking") << pleft.getNode() << endl;
- Debug("Constraint::sanityChecking") << left << endl;
- Debug("Constraint::sanityChecking") << right << endl;
- Debug("Constraint::sanityChecking") << getValue() << endl;
- Debug("Constraint::sanityChecking") << avariables.hasArithVar(left) << endl;
- Debug("Constraint::sanityChecking") << avariables.asArithVar(left) << endl;
- Debug("Constraint::sanityChecking") << getVariable() << endl;
+ Trace("Constraint::sanityChecking") << cmp.getNode() << endl;
+ Trace("Constraint::sanityChecking") << k << endl;
+ Trace("Constraint::sanityChecking") << pleft.getNode() << endl;
+ Trace("Constraint::sanityChecking") << left << endl;
+ Trace("Constraint::sanityChecking") << right << endl;
+ Trace("Constraint::sanityChecking") << getValue() << endl;
+ Trace("Constraint::sanityChecking") << avariables.hasArithVar(left) << endl;
+ Trace("Constraint::sanityChecking") << avariables.asArithVar(left) << endl;
+ Trace("Constraint::sanityChecking") << getVariable() << endl;
if(avariables.hasArithVar(left) &&
} else {
lhs = Node::null();
}
- Debug("constraints::wffp") << "running sum: " << lhs << " <= " << rhs << endl;
+ Trace("constraints::wffp") << "running sum: " << lhs << " <= " << rhs << endl;
switch( antecedent->getType() ){
case LowerBound:
default:
return false;
}
- Debug("constraints::wffp") << "final sum: " << lhs << " <= " << rhs << endl;
+ Trace("constraints::wffp") << "final sum: " << lhs << " <= " << rhs << endl;
// 0 = lhs <= rhs < 0
return (lhs.isNull() || (Constant::isMember(lhs) && Constant(lhs).isZero()))
&& rhs.sgn() < 0;
d_reclaimable.remove(v);
}else{
- Debug("arith::constraint") << "about to fail" << v << " " << d_varDatabases.size() << endl;
+ Trace("arith::constraint") << "about to fail" << v << " " << d_varDatabases.size() << endl;
Assert(v == d_varDatabases.size());
d_varDatabases.push_back(new PerVariableDatabase(v));
}
ConstraintP posC =
new Constraint(v, posType, posDR, options().smt.produceProofs);
- Debug("arith::constraint") << "addliteral( literal ->" << literal << ")" << endl;
- Debug("arith::constraint") << "addliteral( posC ->" << posC << ")" << endl;
+ Trace("arith::constraint") << "addliteral( literal ->" << literal << ")" << endl;
+ Trace("arith::constraint") << "addliteral( posC ->" << posC << ")" << endl;
SortedConstraintMap& scm = getVariableSCM(posC->getVariable());
pair<SortedConstraintMapIterator, bool> insertAttempt;
//This is the situation where the ConstraintP exists, but
//the literal has not been associated with it.
ConstraintP hit = posI->second.getConstraintOfType(posC->getType());
- Debug("arith::constraint") << "hit " << hit << endl;
- Debug("arith::constraint") << "posC " << posC << endl;
+ Trace("arith::constraint") << "hit " << hit << endl;
+ Trace("arith::constraint") << "posC " << posC << endl;
delete posC;
pair<SortedConstraintMapIterator, bool> negInsertAttempt;
negInsertAttempt = scm.insert(make_pair(negC->getValue(), ValueCollection()));
- Debug("nf::tmp") << "sdhjfgdhjkldfgljkhdfg" << endl;
- Debug("nf::tmp") << negC << endl;
- Debug("nf::tmp") << negC->getValue() << endl;
+ Trace("nf::tmp") << "sdhjfgdhjkldfgljkhdfg" << endl;
+ Trace("nf::tmp") << negC << endl;
+ Trace("nf::tmp") << negC->getValue() << endl;
//This should always succeed as the DeltaRational for the negation is unique!
Assert(negInsertAttempt.second);
}
void Constraint::setAssumption(bool nowInConflict){
- Debug("constraints::pf") << "setAssumption(" << this << ")" << std::endl;
+ Trace("constraints::pf") << "setAssumption(" << this << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(hasLiteral());
d_database->pushConstraintRule(ConstraintRule(this, AssumeAP));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@setAssumption " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@setAssumption " << this << std::endl;
}
}
* 1*(x <= a) + (-1)*(x > b) => (0 <= a-b)
*/
void Constraint::impliedByUnate(ConstraintCP imp, bool nowInConflict){
- Debug("constraints::pf") << "impliedByUnate(" << this << ", " << *imp << ")" << std::endl;
+ Trace("constraints::pf") << "impliedByUnate(" << this << ", " << *imp << ")" << std::endl;
Assert(!hasProof());
Assert(imp->hasProof());
Assert(negationHasProof() == nowInConflict);
d_database->pushConstraintRule(ConstraintRule(this, FarkasAP, antecedentEnd, coeffs));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@impliedByUnate " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@impliedByUnate " << this << std::endl;
}
- if(Debug.isOn("constraints::wffp") && !wellFormedFarkasProof()){
- getConstraintRule().print(Debug("constraints::wffp"), d_produceProofs);
+ if(TraceIsOn("constraints::wffp") && !wellFormedFarkasProof()){
+ getConstraintRule().print(Trace("constraints::wffp"), d_produceProofs);
}
Assert(wellFormedFarkasProof());
}
void Constraint::impliedByTrichotomy(ConstraintCP a, ConstraintCP b, bool nowInConflict){
- Debug("constraints::pf") << "impliedByTrichotomy(" << this << ", " << *a << ", ";
- Debug("constraints::pf") << *b << ")" << std::endl;
+ Trace("constraints::pf") << "impliedByTrichotomy(" << this << ", " << *a << ", ";
+ Trace("constraints::pf") << *b << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(a->hasProof());
d_database->pushConstraintRule(ConstraintRule(this, TrichotomyAP, antecedentEnd));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@impliedByTrichotomy " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@impliedByTrichotomy " << this << std::endl;
}
}
}
void Constraint::impliedByIntTighten(ConstraintCP a, bool nowInConflict){
- Debug("constraints::pf") << "impliedByIntTighten(" << this << ", " << *a << ")" << std::endl;
+ Trace("constraints::pf") << "impliedByIntTighten(" << this << ", " << *a << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(a->hasProof());
- Debug("pf::arith") << "impliedByIntTighten(" << this << ", " << a << ")"
+ Trace("pf::arith") << "impliedByIntTighten(" << this << ", " << a << ")"
<< std::endl;
d_database->d_antecedents.push_back(NullConstraint);
Assert(inConflict() == nowInConflict);
if(inConflict()){
- Debug("constraint::conflictCommit") << "inConflict impliedByIntTighten" << this << std::endl;
+ Trace("constraint::conflictCommit") << "inConflict impliedByIntTighten" << this << std::endl;
}
}
void Constraint::impliedByIntHole(ConstraintCP a, bool nowInConflict){
- Debug("constraints::pf") << "impliedByIntHole(" << this << ", " << *a << ")" << std::endl;
+ Trace("constraints::pf") << "impliedByIntHole(" << this << ", " << *a << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(a->hasProof());
- Debug("pf::arith") << "impliedByIntHole(" << this << ", " << a << ")"
+ Trace("pf::arith") << "impliedByIntHole(" << this << ", " << a << ")"
<< std::endl;
d_database->d_antecedents.push_back(NullConstraint);
d_database->pushConstraintRule(ConstraintRule(this, IntHoleAP, antecedentEnd));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict impliedByIntHole" << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict impliedByIntHole" << this << std::endl;
}
}
void Constraint::impliedByIntHole(const ConstraintCPVec& b, bool nowInConflict){
- Debug("constraints::pf") << "impliedByIntHole(" << this;
- if (Debug.isOn("constraints::pf")) {
+ Trace("constraints::pf") << "impliedByIntHole(" << this;
+ if (TraceIsOn("constraints::pf")) {
for (const ConstraintCP& p : b)
{
- Debug("constraints::pf") << ", " << p;
+ Trace("constraints::pf") << ", " << p;
}
}
- Debug("constraints::pf") << ")" << std::endl;
+ Trace("constraints::pf") << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
d_database->pushConstraintRule(ConstraintRule(this, IntHoleAP, antecedentEnd));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@impliedByIntHole[vec] " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@impliedByIntHole[vec] " << this << std::endl;
}
}
* coeff.back() corresponds to the current constraint.
*/
void Constraint::impliedByFarkas(const ConstraintCPVec& a, RationalVectorCP coeffs, bool nowInConflict){
- Debug("constraints::pf") << "impliedByFarkas(" << this;
- if (Debug.isOn("constraints::pf")) {
+ Trace("constraints::pf") << "impliedByFarkas(" << this;
+ if (TraceIsOn("constraints::pf")) {
for (const ConstraintCP& p : a)
{
- Debug("constraints::pf") << ", " << p;
+ Trace("constraints::pf") << ", " << p;
}
}
- Debug("constraints::pf") << ", <coeffs>";
- Debug("constraints::pf") << ")" << std::endl;
+ Trace("constraints::pf") << ", <coeffs>";
+ Trace("constraints::pf") << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(allHaveProof(a));
d_database->pushConstraintRule(ConstraintRule(this, FarkasAP, antecedentEnd, coeffsCopy));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@impliedByFarkas " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@impliedByFarkas " << this << std::endl;
}
- if(Debug.isOn("constraints::wffp") && !wellFormedFarkasProof()){
- getConstraintRule().print(Debug("constraints::wffp"), d_produceProofs);
+ if(TraceIsOn("constraints::wffp") && !wellFormedFarkasProof()){
+ getConstraintRule().print(Trace("constraints::wffp"), d_produceProofs);
}
Assert(wellFormedFarkasProof());
}
void Constraint::setInternalAssumption(bool nowInConflict){
- Debug("constraints::pf") << "setInternalAssumption(" << this;
- Debug("constraints::pf") << ")" << std::endl;
+ Trace("constraints::pf") << "setInternalAssumption(" << this;
+ Trace("constraints::pf") << ")" << std::endl;
Assert(!hasProof());
Assert(negationHasProof() == nowInConflict);
Assert(!assertedToTheTheory());
d_database->pushConstraintRule(ConstraintRule(this, InternalAssumeAP));
Assert(inConflict() == nowInConflict);
- if(Debug.isOn("constraint::conflictCommit") && inConflict()){
- Debug("constraint::conflictCommit") << "inConflict@setInternalAssumption " << this << std::endl;
+ if(TraceIsOn("constraint::conflictCommit") && inConflict()){
+ Trace("constraint::conflictCommit") << "inConflict@setInternalAssumption " << this << std::endl;
}
}
void Constraint::setEqualityEngineProof(){
- Debug("constraints::pf") << "setEqualityEngineProof(" << this;
- Debug("constraints::pf") << ")" << std::endl;
+ Trace("constraints::pf") << "setEqualityEngineProof(" << this;
+ Trace("constraints::pf") << ")" << std::endl;
Assert(truthIsUnknown());
Assert(hasLiteral());
d_database->pushConstraintRule(ConstraintRule(this, EqualityEngineAP));
TrustNode Constraint::externalExplainConflict() const
{
- Debug("pf::arith::explain") << this << std::endl;
+ Trace("pf::arith::explain") << this << std::endl;
Assert(inConflict());
NodeBuilder nb(kind::AND);
auto pf1 = externalExplainByAssertions(nb);
{
lits.push_back(n);
}
- if (Debug.isOn("arith::pf::externalExplainConflict"))
+ if (TraceIsOn("arith::pf::externalExplainConflict"))
{
- Debug("arith::pf::externalExplainConflict") << "Lits:" << std::endl;
+ Trace("arith::pf::externalExplainConflict") << "Lits:" << std::endl;
for (const auto& l : lits)
{
- Debug("arith::pf::externalExplainConflict") << " : " << l << std::endl;
+ Trace("arith::pf::externalExplainConflict") << " : " << l << std::endl;
}
}
std::vector<Node> contraLits = {getProofLiteral(),
not2.getKind() == Kind::NOT
? d_database->d_pnm->mkNode(PfRule::CONTRA, {pf2, pfNot2}, {})
: d_database->d_pnm->mkNode(PfRule::CONTRA, {pfNot2, pf2}, {});
- if (Debug.isOn("arith::pf::tree"))
+ if (TraceIsOn("arith::pf::tree"))
{
- Debug("arith::pf::tree") << *this << std::endl;
- Debug("arith::pf::tree") << *getNegation() << std::endl;
- Debug("arith::pf::tree") << "\n\nTree:\n";
- printProofTree(Debug("arith::pf::tree"));
- getNegation()->printProofTree(Debug("arith::pf::tree"));
+ Trace("arith::pf::tree") << *this << std::endl;
+ Trace("arith::pf::tree") << *getNegation() << std::endl;
+ Trace("arith::pf::tree") << "\n\nTree:\n";
+ printProofTree(Trace("arith::pf::tree"));
+ getNegation()->printProofTree(Trace("arith::pf::tree"));
}
auto confPf = d_database->d_pnm->mkScope(bot, lits);
return d_database->d_pfGen->mkTrustNode(
std::shared_ptr<ProofNode> Constraint::externalExplain(
NodeBuilder& nb, AssertionOrder order) const
{
- if (Debug.isOn("pf::arith::explain"))
+ if (TraceIsOn("pf::arith::explain"))
{
- this->printProofTree(Debug("arith::pf::tree"));
- Debug("pf::arith::explain") << "Explaining: " << this << " with rule ";
- getConstraintRule().print(Debug("pf::arith::explain"), d_produceProofs);
- Debug("pf::arith::explain") << std::endl;
+ this->printProofTree(Trace("arith::pf::tree"));
+ Trace("pf::arith::explain") << "Explaining: " << this << " with rule ";
+ getConstraintRule().print(Trace("pf::arith::explain"), d_produceProofs);
+ Trace("pf::arith::explain") << std::endl;
}
Assert(hasProof());
Assert(!isAssumption() || assertedToTheTheory());
if (assertedBefore(order))
{
- Debug("pf::arith::explain") << " already asserted" << std::endl;
+ Trace("pf::arith::explain") << " already asserted" << std::endl;
nb << getWitness();
if (d_database->isProofEnabled())
{
}
else if (hasEqualityEngineProof())
{
- Debug("pf::arith::explain") << " going to ee:" << std::endl;
+ Trace("pf::arith::explain") << " going to ee:" << std::endl;
TrustNode exp = d_database->eeExplain(this);
if (d_database->isProofEnabled())
{
pf = pnm->mkNode(
PfRule::MACRO_SR_PRED_TRANSFORM, {hypotheses}, {getProofLiteral()});
}
- Debug("pf::arith::explain")
+ Trace("pf::arith::explain")
<< " explanation: " << exp.getNode() << std::endl;
if (exp.getNode().getKind() == Kind::AND)
{
}
else
{
- Debug("pf::arith::explain") << " recursion!" << std::endl;
+ Trace("pf::arith::explain") << " recursion!" << std::endl;
Assert(!isAssumption());
AntecedentId p = getEndAntecedent();
ConstraintCP antecedent = d_database->d_antecedents[p];
while (antecedent != NullConstraint)
{
- Debug("pf::arith::explain") << "Explain " << antecedent << std::endl;
+ Trace("pf::arith::explain") << "Explain " << antecedent << std::endl;
auto pn = antecedent->externalExplain(nb, order);
if (d_database->isProofEnabled())
{
if(i == i_end){
--i;
- Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
+ Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
}else if( (i->first) > r){
if(i == i_begin){
return NullConstraint;
}else{
--i;
- Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
+ Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
}
}
do{
- Debug("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
+ Trace("getBestImpliedBound") << fdj++ << " " << r << " " << i->first << endl;
Assert(r >= i->first);
const ValueCollection& vc = i->second;
void Constraint::setLiteral(Node n) {
- Debug("arith::constraint") << "Mapping " << *this << " to " << n << std::endl;
+ Trace("arith::constraint") << "Mapping " << *this << " to " << n << std::endl;
Assert(Comparison::isNormalAtom(n));
Assert(!hasLiteral());
Assert(sanityChecking(n));
bool ConstraintDatabase::handleUnateProp(ConstraintP ant, ConstraintP cons){
if(cons->negationHasProof()){
- Debug("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl;
+ Trace("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl;
cons->impliedByUnate(ant, true);
d_raiseConflict.raiseConflict(cons, InferenceId::ARITH_CONF_UNATE_PROP);
return true;
}else if(!cons->isTrue()){
++d_statistics.d_unatePropagateImplications;
- Debug("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl;
+ Trace("arith::unate") << "handleUnate: " << ant << " implies " << cons << endl;
cons->impliedByUnate(ant, false);
cons->tryToPropagate();
return false;
}
void ConstraintDatabase::unatePropLowerBound(ConstraintP curr, ConstraintP prev){
- Debug("arith::unate") << "unatePropLowerBound " << curr << " " << prev << endl;
+ Trace("arith::unate") << "unatePropLowerBound " << curr << " " << prev << endl;
Assert(curr != prev);
Assert(curr != NullConstraint);
bool hasPrev = ! (prev == NullConstraint);
}
void ConstraintDatabase::unatePropUpperBound(ConstraintP curr, ConstraintP prev){
- Debug("arith::unate") << "unatePropUpperBound " << curr << " " << prev << endl;
+ Trace("arith::unate") << "unatePropUpperBound " << curr << " " << prev << endl;
Assert(curr != prev);
Assert(curr != NullConstraint);
bool hasPrev = ! (prev == NullConstraint);
}
void ConstraintDatabase::unatePropEquality(ConstraintP curr, ConstraintP prevLB, ConstraintP prevUB){
- Debug("arith::unate") << "unatePropEquality " << curr << " " << prevLB << " " << prevUB << endl;
+ Trace("arith::unate") << "unatePropEquality " << curr << " " << prevLB << " " << prevUB << endl;
Assert(curr != prevLB);
Assert(curr != prevUB);
Assert(curr != NullConstraint);
Assert(a_sgn != 0);
Assert(b_sgn != 0);
- Debug("arith::unateFarkasSigns") << "Constraint::unateFarkasSigns("<<a <<", " << b << ") -> "
+ Trace("arith::unateFarkasSigns") << "Constraint::unateFarkasSigns("<<a <<", " << b << ") -> "
<< "("<<a_sgn<<", "<< b_sgn <<")"<< endl;
return make_pair(a_sgn, b_sgn);
}
void NodeLog::addSelected(int ord, int sel){
Assert(d_rowIdsSelected.find(ord) == d_rowIdsSelected.end());
d_rowIdsSelected[ord] = sel;
- Debug("approx::nodelog") << "addSelected("<< ord << ", "<< sel << ")" << endl;
+ Trace("approx::nodelog") << "addSelected("<< ord << ", "<< sel << ")" << endl;
}
void NodeLog::applySelected() {
CutSet::iterator iter = d_cuts.begin(), iend = d_cuts.end(), todelete;
d_cuts.erase(todelete);
delete curr;
}else{
- Debug("approx::nodelog") << "applySelected " << curr->getId() << " " << poolOrd << "->" << d_rowIdsSelected[poolOrd] << endl;
+ Trace("approx::nodelog") << "applySelected " << curr->getId() << " " << poolOrd << "->" << d_rowIdsSelected[poolOrd] << endl;
curr->setRowId( d_rowIdsSelected[poolOrd] );
++iter;
}
sortedRemoved.push_back(INT_MAX);
std::sort(sortedRemoved.begin(), sortedRemoved.end());
- if(Debug.isOn("approx::nodelog")){
- Debug("approx::nodelog") << "Removing #" << sortedRemoved.size()<< "...";
+ if(TraceIsOn("approx::nodelog")){
+ Trace("approx::nodelog") << "Removing #" << sortedRemoved.size()<< "...";
for(unsigned k = 0; k<sortedRemoved.size(); k++){
- Debug("approx::nodelog") << ", " << sortedRemoved[k];
+ Trace("approx::nodelog") << ", " << sortedRemoved[k];
}
- Debug("approx::nodelog") << endl;
- Debug("approx::nodelog") << "cv.len" << cv.len << endl;
+ Trace("approx::nodelog") << endl;
+ Trace("approx::nodelog") << "cv.len" << cv.len << endl;
}
int min = sortedRemoved.front();
if(headRemovedOrd == origOrd){
if(ci == NULL){
- Debug("approx::nodelog") << "deleting from above because of " << rd << endl;
- Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "deleting from above because of " << rd << endl;
+ Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
d_rowId2ArithVar.erase(origOrd);
}else{
- Debug("approx::nodelog") << "deleting " << ci << " because of " << rd << endl;
- Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "deleting " << ci << " because of " << rd << endl;
+ Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
d_rowId2ArithVar.erase(origOrd);
ci->setRowId(-1);
}
int newOrd = origOrd - posInSorted;
Assert(newOrd > 0);
if(ci == NULL){
- Debug("approx::nodelog") << "shifting above down due to " << rd << endl;
- Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
- Debug("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "shifting above down due to " << rd << endl;
+ Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl;
d_rowId2ArithVar.erase(origOrd);
mapRowId(newOrd, v);
}else{
- Debug("approx::nodelog") << "shifting " << ci << " down due to " << rd << endl;
- Debug("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
- Debug("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "shifting " << ci << " down due to " << rd << endl;
+ Trace("approx::nodelog") << "had " << origOrd << " <-> " << v << endl;
+ Trace("approx::nodelog") << "now have " << newOrd << " <-> " << v << endl;
ci->setRowId(newOrd);
d_rowId2ArithVar.erase(origOrd);
mapRowId(newOrd, v);
void NodeLog::mapRowId(int rowId, ArithVar v){
Assert(lookupRowId(rowId) == ARITHVAR_SENTINEL);
- Debug("approx::nodelog")
+ Trace("approx::nodelog")
<< "On " << getNodeId()
<< " adding row id " << rowId << " <-> " << v << endl;
d_rowId2ArithVar[rowId] = v;
}
bool DioSolver::queueConditions(TrailIndex t){
- Debug("queueConditions") << !inConflict() << std::endl;
- Debug("queueConditions") << gcdIsOne(t) << std::endl;
- Debug("queueConditions") << !debugAnySubstitionApplies(t) << std::endl;
- Debug("queueConditions") << !triviallySat(t) << std::endl;
- Debug("queueConditions") << !triviallyUnsat(t) << std::endl;
+ Trace("queueConditions") << !inConflict() << std::endl;
+ Trace("queueConditions") << gcdIsOne(t) << std::endl;
+ Trace("queueConditions") << !debugAnySubstitionApplies(t) << std::endl;
+ Trace("queueConditions") << !triviallySat(t) << std::endl;
+ Trace("queueConditions") << !triviallyUnsat(t) << std::endl;
return
!inConflict() &&
//Variable proofVariable(makeIntegerVariable());
TrailIndex posInTrail = d_trail.size();
- Debug("dio::pushInputConstraint") << "pushInputConstraint @ " << posInTrail
+ Trace("dio::pushInputConstraint") << "pushInputConstraint @ " << posInTrail
<< " " << eq.getNode()
<< " " << reason << endl;
d_trail.push_back(Constraint(sp,Polynomial::mkPolynomial(proofVariable)));
d_trail.push_back(Constraint(newSP, newProof));
- Debug("arith::dio") << "scaleEqAtIndex(" << i <<","<<g<<")"<<endl;
- Debug("arith::dio") << "derived "<< newSP.getNode()
+ Trace("arith::dio") << "scaleEqAtIndex(" << i <<","<<g<<")"<<endl;
+ Trace("arith::dio") << "derived "<< newSP.getNode()
<<" with proof " << newProof.getNode() << endl;
return j;
}
}
Node result = (nb.getNumChildren() == 1) ? nb[0] : (Node)nb;
- Debug("arith::dio") << "Proof at " << i << " is "
+ Trace("arith::dio") << "Proof at " << i << " is "
<< d_trail[i].d_eq.getNode() << endl
<< d_trail[i].d_proof.getNode() << endl
<< " which becomes " << result << endl;
bool result =
nmonos >= 2 &&
length > d_maxInputCoefficientLength + MAX_GROWTH_RATE;
- if(Debug.isOn("arith::dio::max") && result){
+ if(TraceIsOn("arith::dio::max") && result){
const SumPair& eq = d_trail[j].d_eq;
const Polynomial& proof = d_trail[j].d_proof;
- Debug("arith::dio::max") << "about to drop:" << std::endl;
- Debug("arith::dio::max") << "d_trail[" << j << "].d_eq = " << eq.getNode() << std::endl;
- Debug("arith::dio::max") << "d_trail[" << j << "].d_proof = " << proof.getNode() << std::endl;
+ Trace("arith::dio::max") << "about to drop:" << std::endl;
+ Trace("arith::dio::max") << "d_trail[" << j << "].d_eq = " << eq.getNode() << std::endl;
+ Trace("arith::dio::max") << "d_trail[" << j << "].d_proof = " << proof.getNode() << std::endl;
}
return result;
}
//For the rest of the equations keep reducing until the coefficient is one
for(; iter != end; ++iter){
- Debug("arith::dio") << "next round : " << currentCoeff << " " << currentGcd << endl;
+ Trace("arith::dio") << "next round : " << currentCoeff << " " << currentGcd << endl;
TrailIndex inQueue = *iter;
Constant iqc = d_trail[inQueue].d_eq.getPolynomial().getCoefficient(vl);
if(!iqc.isZero()){
// g = a*s + b*t
Integer::extendedGcd(g, s, t, currentCoeff, inQueueCoeff);
- Debug("arith::dio") << "extendedReduction : " << endl;
- Debug("arith::dio") << g << " = " << s <<"*"<< currentCoeff << " + " << t <<"*"<< inQueueCoeff << endl;
+ Trace("arith::dio") << "extendedReduction : " << endl;
+ Trace("arith::dio") << g << " = " << s <<"*"<< currentCoeff << " + " << t <<"*"<< inQueueCoeff << endl;
Assert(g <= currentGcd);
if(g < currentGcd){
if(s.sgn() == 0){
- Debug("arith::dio") << "extendedReduction drop" << endl;
+ Trace("arith::dio") << "extendedReduction drop" << endl;
Assert(inQueueCoeff.divides(currentGcd));
current = *iter;
currentCoeff = inQueueCoeff;
currentGcd = inQueueCoeff.abs();
}else{
- Debug("arith::dio") << "extendedReduction combine" << endl;
+ Trace("arith::dio") << "extendedReduction combine" << endl;
TrailIndex next = combineEqAtIndexes(current, s, inQueue, t);
Assert(d_trail[next]
Assert(inRange(minimum));
Assert(!inConflict());
- Debug("arith::dio") << "processEquations " << minimum << " : " << d_trail[minimum].d_eq.getNode() << endl;
+ Trace("arith::dio") << "processEquations " << minimum << " : " << d_trail[minimum].d_eq.getNode() << endl;
Assert(queueConditions(minimum));
const SumPair& si = d_trail[i].d_eq;
const SumPair& sj = d_trail[j].d_eq;
- Debug("arith::dio") << "combineEqAtIndexes(" << i <<","<<q<<","<<j<<","<<r<<")"<<endl;
- Debug("arith::dio") << "d_facts[i] = " << si.getNode() << endl
+ Trace("arith::dio") << "combineEqAtIndexes(" << i <<","<<q<<","<<j<<","<<r<<")"<<endl;
+ Trace("arith::dio") << "d_facts[i] = " << si.getNode() << endl
<< "d_facts[j] = " << sj.getNode() << endl;
d_trail.push_back(Constraint(newSi, newPi));
- Debug("arith::dio") << "derived "<< newSi.getNode()
+ Trace("arith::dio") << "derived "<< newSi.getNode()
<<" with proof " << newPi.getNode() << endl;
return k;
}
void DioSolver::printQueue(){
- Debug("arith::dio") << "DioSolver::printQueue()" << endl;
+ Trace("arith::dio") << "DioSolver::printQueue()" << endl;
for(TrailIndex i = 0, last = d_trail.size(); i < last; ++i){
- Debug("arith::dio") << "d_trail[i].d_eq = " << d_trail[i].d_eq.getNode() << endl;
- Debug("arith::dio") << "d_trail[i].d_proof = " << d_trail[i].d_proof.getNode() << endl;
+ Trace("arith::dio") << "d_trail[i].d_eq = " << d_trail[i].d_eq.getNode() << endl;
+ Trace("arith::dio") << "d_trail[i].d_proof = " << d_trail[i].d_proof.getNode() << endl;
}
- Debug("arith::dio") << "DioSolver::printSubs()" << endl;
+ Trace("arith::dio") << "DioSolver::printSubs()" << endl;
for(SubIndex si=0, sN=d_subs.size(); si < sN; ++si){
- Debug("arith::dio") << "d_subs[i] = {"
+ Trace("arith::dio") << "d_subs[i] = {"
<< "d_fresh="<< d_subs[si].d_fresh <<","
<< "d_eliminated="<< d_subs[si].d_eliminated.getNode() <<","
<< "d_constraint="<< d_subs[si].d_constraint <<"}" << endl;
- Debug("arith::dio") << "d_trail[d_subs[i].d_constraint].d_eq="
+ Trace("arith::dio") << "d_trail[d_subs[i].d_constraint].d_eq="
<< d_trail[d_subs[si].d_constraint].d_eq.getNode() << endl;
}
}
std::pair<DioSolver::SubIndex, DioSolver::TrailIndex> DioSolver::solveIndex(DioSolver::TrailIndex i){
const SumPair& si = d_trail[i].d_eq;
- Debug("arith::dio") << "before solveIndex("<<i<<":"<<si.getNode()<< ")" << endl;
+ Trace("arith::dio") << "before solveIndex("<<i<<":"<<si.getNode()<< ")" << endl;
#ifdef CVC5_ASSERTIONS
const Polynomial& p = si.getPolynomial();
SubIndex subBy = d_subs.size();
d_subs.push_back(Substitution(Node::null(), var, ci));
- Debug("arith::dio") << "after solveIndex " << d_trail[ci].d_eq.getNode() << " for " << av.getNode() << endl;
+ Trace("arith::dio") << "after solveIndex " << d_trail[ci].d_eq.getNode() << " for " << av.getNode() << endl;
Assert(d_trail[ci].d_eq.getPolynomial().getCoefficient(vl)
== Constant::mkConstant(-1));
d_usedDecomposeIndex = true;
- Debug("arith::dio") << "before decomposeIndex("<<i<<":"<<si.getNode()<< ")" << endl;
+ Trace("arith::dio") << "before decomposeIndex("<<i<<":"<<si.getNode()<< ")" << endl;
#ifdef CVC5_ASSERTIONS
const Polynomial& p = si.getPolynomial();
// no longer reference av safely!
addTrailElementAsLemma(ci);
- Debug("arith::dio") << "Decompose ci(" << ci <<":" << d_trail[ci].d_eq.getNode()
+ Trace("arith::dio") << "Decompose ci(" << ci <<":" << d_trail[ci].d_eq.getNode()
<< ") for " << d_trail[i].d_minimalMonomial.getNode() << endl;
Assert(d_trail[ci].d_eq.getPolynomial().getCoefficient(vl)
== Constant::mkConstant(-1));
SubIndex subBy = d_subs.size();
d_subs.push_back(Substitution(freshNode, var, ci));
- Debug("arith::dio") << "Decompose nextIndex " << d_trail[nextIndex].d_eq.getNode() << endl;
+ Trace("arith::dio") << "Decompose nextIndex " << d_trail[nextIndex].d_eq.getNode() << endl;
return make_pair(subBy, nextIndex);
}
Polynomial vsum = sp.getPolynomial();
Constant c = sp.getConstant();
- Debug("arith::dio") << "reduceByGCD " << vsum.getNode() << endl;
+ Trace("arith::dio") << "reduceByGCD " << vsum.getNode() << endl;
Assert(!vsum.isConstant());
Integer g = vsum.gcd();
Assert(g >= 1);
- Debug("arith::dio") << "gcd("<< vsum.getNode() <<")=" << g << " " << c.getValue() << endl;
+ Trace("arith::dio") << "gcd("<< vsum.getNode() <<")=" << g << " " << c.getValue() << endl;
if(g.divides(c.getValue().getNumerator())){
if(g > 1){
return scaleEqAtIndex(ti, g);
/** Solves the index at ti for the value in minimumMonomial. */
std::pair<SubIndex, TrailIndex> solveIndex(TrailIndex ti);
- /** Prints the queue for debugging purposes to Debug("arith::dio"). */
+ /** Prints the queue for debugging purposes to Trace("arith::dio"). */
void printQueue();
/**
d_pivots = 0;
if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){
- Debug("arith::findModel") << "dualFindModel() trivial" << endl;
+ Trace("arith::findModel") << "dualFindModel() trivial" << endl;
return Result::SAT;
}
if(processSignals()){
d_conflictVariables.purge();
- Debug("arith::findModel") << "dualFindModel() early conflict" << endl;
+ Trace("arith::findModel") << "dualFindModel() early conflict" << endl;
return Result::UNSAT;
}else if(d_errorSet.errorEmpty()){
- Debug("arith::findModel") << "dualFindModel() fixed itself" << endl;
+ Trace("arith::findModel") << "dualFindModel() fixed itself" << endl;
Assert(!d_errorSet.moreSignals());
return Result::SAT;
}
- Debug("arith::findModel") << "dualFindModel() start non-trivial" << endl;
+ Trace("arith::findModel") << "dualFindModel() start non-trivial" << endl;
Result::Sat result = Result::SAT_UNKNOWN;
// ensure that the conflict variable is still in the queue.
d_conflictVariables.purge();
- Debug("arith::findModel") << "end findModel() " << result << endl;
+ Trace("arith::findModel") << "end findModel() " << result << endl;
return result;
}
bool DualSimplexDecisionProcedure::searchForFeasibleSolution(uint32_t remainingIterations){
TimerStat::CodeTimer codeTimer(d_statistics.d_searchTime);
- Debug("arith") << "searchForFeasibleSolution" << endl;
+ Trace("arith") << "searchForFeasibleSolution" << endl;
Assert(remainingIterations > 0);
while(remainingIterations > 0 && !d_errorSet.focusEmpty()){
- if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
+ if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
Assert(d_conflictVariables.empty());
ArithVar x_i = d_errorSet.topFocusVariable();
- Debug("arith::update::select") << "selectSmallestInconsistentVar()=" << x_i << endl;
+ Trace("arith::update::select") << "selectSmallestInconsistentVar()=" << x_i << endl;
if(x_i == ARITHVAR_SENTINEL){
- Debug("arith::update") << "No inconsistent variables" << endl;
+ Trace("arith::update") << "No inconsistent variables" << endl;
return false; //sat
}
d_pivotsInRound.add(x_i);
}
- Debug("arith::update") << "pivots in rounds: " << d_pivotsInRound.count(x_i)
+ Trace("arith::update") << "pivots in rounds: " << d_pivotsInRound.count(x_i)
<< " use " << useVarOrderPivot << " threshold "
<< options().arith.arithPivotThreshold << std::endl;
int32_t currErrorSize CVC5_UNUSED = d_errorSet.errorSize();
d_pivots++;
- if(Debug.isOn("arith::dual")){
- Debug("arith::dual")
+ if(TraceIsOn("arith::dual")){
+ Trace("arith::dual")
<< "#" << d_pivots
<< " c" << conflict
<< " d" << (prevErrorSize - currErrorSize)
d_amount(nullptr),
d_metric(0)
{
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "def constructor " << d_variable << " " << d_amount.get() << endl;
}
d_metric(0)
{
Assert(debugInitialized());
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "constructor " << d_variable << " " << d_amount.get() << endl;
}
Assert(d_relaxed != true);
if (d_amount != nullptr)
{
- Debug("arith::error::mem") << d_amount.get() << endl;
- Debug("arith::error::mem")
+ Trace("arith::error::mem") << d_amount.get() << endl;
+ Trace("arith::error::mem")
<< "destroy " << d_variable << " " << d_amount.get() << endl;
d_amount = nullptr;
}
{
d_amount = std::make_unique<DeltaRational>(*ei.d_amount);
}
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "copy const " << d_variable << " " << d_amount.get() << endl;
}
d_metric = ei.d_metric;
if (d_amount != nullptr && ei.d_amount != nullptr)
{
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "assignment assign " << d_variable << " " << d_amount.get() << endl;
*d_amount = *ei.d_amount;
}
else if (ei.d_amount != nullptr)
{
d_amount = std::make_unique<DeltaRational>(*ei.d_amount);
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "assignment alloc " << d_variable << " " << d_amount.get() << endl;
}
else if (d_amount != nullptr)
{
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "assignment release " << d_variable << " " << d_amount.get() << endl;
d_amount = nullptr;
}
if (d_amount != nullptr)
{
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "reset " << d_variable << " " << d_amount.get() << endl;
d_amount = nullptr;
}
if (d_amount == nullptr)
{
d_amount = std::make_unique<DeltaRational>();
- Debug("arith::error::mem")
+ Trace("arith::error::mem")
<< "setAmount " << d_variable << " " << d_amount.get() << endl;
}
(*d_amount) = am;
d_pivots = 0;
if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){
- Debug("arith::findModel") << "fcFindModel() trivial" << endl;
+ Trace("arith::findModel") << "fcFindModel() trivial" << endl;
Assert(d_conflictVariables.empty());
return Result::SAT;
}
if(initialProcessSignals()){
d_conflictVariables.purge();
- Debug("arith::findModel") << "fcFindModel() early conflict" << endl;
+ Trace("arith::findModel") << "fcFindModel() early conflict" << endl;
Assert(d_conflictVariables.empty());
return Result::UNSAT;
}else if(d_errorSet.errorEmpty()){
- Debug("arith::findModel") << "fcFindModel() fixed itself" << endl;
+ Trace("arith::findModel") << "fcFindModel() fixed itself" << endl;
Assert(d_conflictVariables.empty());
return Result::SAT;
}
- Debug("arith::findModel") << "fcFindModel() start non-trivial" << endl;
+ Trace("arith::findModel") << "fcFindModel() start non-trivial" << endl;
exactResult |= d_varOrderPivotLimit < 0;
// ensure that the conflict variable is still in the queue.
d_conflictVariables.purge();
- Debug("arith::findModel") << "end findModel() " << result << endl;
+ Trace("arith::findModel") << "end findModel() " << result << endl;
Assert(d_conflictVariables.empty());
return result;
d_leavingCountSinceImprovement.purge();
}
- Debug("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl;
+ Trace("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl;
}
UpdateInfo FCSimplexDecisionProcedure::selectPrimalUpdate(ArithVar basic, LinearEqualityModule::UpdatePreferenceFunction upf, LinearEqualityModule::VarPreferenceFunction bpf) {
UpdateInfo selected;
- Debug("arith::selectPrimalUpdate")
+ Trace("arith::selectPrimalUpdate")
<< "selectPrimalUpdate" << endl
<< basic << " " << d_tableau.basicRowLength(basic) << " "
<< d_linEq.debugBasicAtBoundCount(basic) << endl;
(curr_movement > 0 && d_variables.cmpAssignmentUpperBound(curr) < 0) ||
(curr_movement < 0 && d_variables.cmpAssignmentLowerBound(curr) > 0);
- Debug("arith::selectPrimalUpdate")
+ Trace("arith::selectPrimalUpdate")
<< "storing " << basic
<< " " << curr
<< " " << candidate
const Rational& focusC = focusCoefficient(curr);
Assert(dualLike || !focusC.isZero());
if(dualLike && curr_movement != focusC.sgn()){
- Debug("arith::selectPrimalUpdate") << "sgn disagreement " << curr << endl;
+ Trace("arith::selectPrimalUpdate") << "sgn disagreement " << curr << endl;
d_sgnDisagreements.push_back(curr);
continue;
}else{
LinearEqualityModule::UpdatePreferenceFunction leavingPrefFunc = selectLeavingFunction(curr);
UpdateInfo currProposal = d_linEq.speculativeUpdate(curr, coeff, leavingPrefFunc);
- Debug("arith::selectPrimalUpdate")
+ Trace("arith::selectPrimalUpdate")
<< "selected " << selected << endl
<< "currProp " << currProposal << endl
<< "coeff " << coeff << endl;
selected = currProposal;
WitnessImprovement w = selected.getWitness(false);
- Debug("arith::selectPrimalUpdate") << "selected " << w << endl;
+ Trace("arith::selectPrimalUpdate") << "selected " << w << endl;
setPenalty(curr, w);
if(improvement(w)){
bool exitEarly;
case ErrorDropped:
if(checkEverything){
exitEarly = d_errorSize + selected.errorsChange() == 0;
- Debug("arith::selectPrimalUpdate")
+ Trace("arith::selectPrimalUpdate")
<< "ee " << d_errorSize << " "
<< selected.errorsChange() << " "
<< d_errorSize + selected.errorsChange() << endl;
if(exitEarly){ break; }
}
}else{
- Debug("arith::selectPrimalUpdate") << "dropped "<< endl;
+ Trace("arith::selectPrimalUpdate") << "dropped "<< endl;
}
}
Assert(!d_sgnDisagreements.empty());
Assert(d_errorSet.focusSize() >= 2);
- if(Debug.isOn("arith::focus")){
- d_errorSet.debugPrint(Debug("arith::focus"));
+ if(TraceIsOn("arith::focus")){
+ d_errorSet.debugPrint(Trace("arith::focus"));
}
ArithVar nb = d_linEq.minBy(d_sgnDisagreements, &LinearEqualityModule::minColLength);
const Tableau::Entry& e_evar_nb = d_tableau.basicFindEntry(basic, nb);
int oppositeSgn = - (e_evar_nb.getCoefficient().sgn());
- Debug("arith::focus") << "focusUsingSignDisagreements " << basic << " " << oppositeSgn << endl;
+ Trace("arith::focus") << "focusUsingSignDisagreements " << basic << " " << oppositeSgn << endl;
ArithVarVec dropped;
Assert(entry.getColVar() == nb);
int sgn = entry.getCoefficient().sgn();
- Debug("arith::focus")
+ Trace("arith::focus")
<< "on row "
<< d_tableau.rowIndexToBasic(entry.getRowIndex())
<< " "
if(errSgn * sgn == oppositeSgn){
dropped.push_back(currRow);
- Debug("arith::focus") << "dropping from focus " << currRow << endl;
+ Trace("arith::focus") << "dropping from focus " << currRow << endl;
}
}
}
}
void FCSimplexDecisionProcedure::debugPrintSignal(ArithVar updated) const{
- Debug("updateAndSignal") << "updated basic " << updated;
- Debug("updateAndSignal") << " length " << d_tableau.basicRowLength(updated);
- Debug("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated);
+ Trace("updateAndSignal") << "updated basic " << updated;
+ Trace("updateAndSignal") << " length " << d_tableau.basicRowLength(updated);
+ Trace("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated);
int dir = !d_variables.assignmentIsConsistent(updated) ?
d_errorSet.getSgn(updated) : 0;
- Debug("updateAndSignal") << " dir " << dir;
- Debug("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl;
+ Trace("updateAndSignal") << " dir " << dir;
+ Trace("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl;
}
bool debugUpdatedBasic(const UpdateInfo& selected, ArithVar updated){
void FCSimplexDecisionProcedure::updateAndSignal(const UpdateInfo& selected, WitnessImprovement w){
ArithVar nonbasic = selected.nonbasic();
- Debug("updateAndSignal") << "updateAndSignal " << selected << endl;
+ Trace("updateAndSignal") << "updateAndSignal " << selected << endl;
stringstream ss;
if(d_tableau.isBasic(updated)){
Assert(!d_variables.assignmentIsConsistent(updated)
== d_errorSet.inError(updated));
- if(Debug.isOn("updateAndSignal")){debugPrintSignal(updated);}
+ if(TraceIsOn("updateAndSignal")){debugPrintSignal(updated);}
if(!d_variables.assignmentIsConsistent(updated)){
if(checkBasicForConflict(updated)){
reportConflict(updated);
}
}
}else{
- Debug("updateAndSignal") << "updated nonbasic " << updated << endl;
+ Trace("updateAndSignal") << "updated nonbasic " << updated << endl;
}
int currFocusSgn = d_errorSet.focusSgn(updated);
if(currFocusSgn != prevFocusSgn){
}
}
- if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); }
+ if(TraceIsOn("error")){ d_errorSet.debugPrint(Trace("error")); }
Assert(
debugSelectedErrorDropped(selected, d_errorSize, d_errorSet.errorSize()));
d_prevWitnessImprovement == HeuristicDegenerate &&
d_witnessImprovementInARow >= s_focusThreshold){
- Debug("focusDownToJust") << "focusDownToJust " << errorVar << endl;
+ Trace("focusDownToJust") << "focusDownToJust " << errorVar << endl;
return focusDownToJust(errorVar);
}else{
WitnessImprovement FCSimplexDecisionProcedure::focusDownToLastHalf(){
Assert(d_focusSize >= 2);
- Debug("focusDownToLastHalf") << "focusDownToLastHalf "
+ Trace("focusDownToLastHalf") << "focusDownToLastHalf "
<< d_errorSet.errorSize() << " "
<< d_errorSet.focusSize() << " ";
}
}
WitnessImprovement w = adjustFocusShrank(buf);
- Debug("focusDownToLastHalf") << "-> " << d_errorSet.focusSize() << endl;
+ Trace("focusDownToLastHalf") << "-> " << d_errorSet.focusSize() << endl;
return w;
}
UpdateInfo selected = selectPrimalUpdate(d_focusErrorVar, upf, bpf);
if(selected.uninitialized()){
- Debug("selectFocusImproving") << "focus is optimum, but we don't have sat/conflict yet" << endl;
+ Trace("selectFocusImproving") << "focus is optimum, but we don't have sat/conflict yet" << endl;
return focusDownToLastHalf();
}
Assert(debugCheckWitness(selected, w, false));
if(degenerate(w)){
- Debug("selectFocusImproving") << "only degenerate" << endl;
+ Trace("selectFocusImproving") << "only degenerate" << endl;
if(d_prevWitnessImprovement == HeuristicDegenerate &&
d_witnessImprovementInARow >= s_focusThreshold){
- Debug("selectFocusImproving") << "focus down been degenerate too long" << endl;
+ Trace("selectFocusImproving") << "focus down been degenerate too long" << endl;
return focusDownToLastHalf();
}else{
- Debug("selectFocusImproving") << "taking degenerate" << endl;
+ Trace("selectFocusImproving") << "taking degenerate" << endl;
}
}
- Debug("selectFocusImproving") << "selectFocusImproving did this " << selected << endl;
+ Trace("selectFocusImproving") << "selectFocusImproving did this " << selected << endl;
updateAndSignal(selected, w);
logPivot(w);
while(d_pivotBudget != 0 && d_errorSize > 0 && d_conflictVariables.empty()){
- Debug("dualLike") << "dualLike " << endl;
+ Trace("dualLike") << "dualLike " << endl;
Assert(d_errorSet.noSignals());
d_focusErrorVar = constructInfeasiblityFunction(d_statistics.d_fcFocusConstructionTimer);
- Debug("dualLike") << "blur " << d_focusSize << endl;
+ Trace("dualLike") << "blur " << d_focusSize << endl;
}else if(d_focusSize == 1){
// Possible outcomes:
// - errorSet size shrunk
// - budget was exhausted
ArithVar e = d_errorSet.topFocusVariable();
- Debug("dualLike") << "primalImproveError " << e << endl;
+ Trace("dualLike") << "primalImproveError " << e << endl;
w = primalImproveError(e);
}else{
ArithVar e = d_errorSet.topFocusVariable();
static constexpr unsigned s_sumMetricThreshold = 1;
if(d_errorSet.sumMetric(e) <= s_sumMetricThreshold){
- Debug("dualLike") << "dualLikeImproveError " << e << endl;
+ Trace("dualLike") << "dualLikeImproveError " << e << endl;
w = dualLikeImproveError(e);
}else{
- Debug("dualLike") << "selectFocusImproving " << endl;
+ Trace("dualLike") << "selectFocusImproving " << endl;
w = selectFocusImproving();
}
}
- Debug("dualLike") << "witnessImprovement: " << w << endl;
+ Trace("dualLike") << "witnessImprovement: " << w << endl;
Assert(d_focusSize == d_errorSet.focusSize());
Assert(d_errorSize == d_errorSet.errorSize());
- Assert(debugDualLike(w, Debug("dualLike"), prevFocusSize, prevErrorSize));
- Debug("dualLike") << "Focus size " << d_focusSize << " (was " << prevFocusSize << ")" << endl;
- Debug("dualLike") << "Error size " << d_errorSize << " (was " << prevErrorSize << ")" << endl;
+ Assert(debugDualLike(w, Trace("dualLike"), prevFocusSize, prevErrorSize));
+ Trace("dualLike") << "Focus size " << d_focusSize << " (was " << prevFocusSize << ")" << endl;
+ Trace("dualLike") << "Error size " << d_errorSize << " (was " << prevErrorSize << ")" << endl;
}
RowIndex ridx = entry.getRowIndex();
BoundsInfo& counts = d_btracking.get(ridx);
- Debug("includeBoundUpdate") << d_tableau.rowIndexToBasic(ridx) << " " << counts << " to " ;
+ Trace("includeBoundUpdate") << d_tableau.rowIndexToBasic(ridx) << " " << counts << " to " ;
counts.addInChange(a_ijSgn, prev, curr);
- Debug("includeBoundUpdate") << counts << " " << a_ijSgn << std::endl;
+ Trace("includeBoundUpdate") << counts << " " << a_ijSgn << std::endl;
}
}
++(d_statistics.d_statUpdates);
- Debug("arith") <<"update " << x_i << ": "
+ Trace("arith") <<"update " << x_i << ": "
<< assignment_x_i << "|-> " << v << endl;
DeltaRational diff = v - assignment_x_i;
d_variables.setAssignment(x_i, v);
- if(Debug.isOn("paranoid:check_tableau")){ debugCheckTableau(); }
+ if(TraceIsOn("paranoid:check_tableau")){ debugCheckTableau(); }
}
void LinearEqualityModule::updateTracked(ArithVar x_i, const DeltaRational& v){
++(d_statistics.d_statUpdates);
DeltaRational diff = v - d_variables.getAssignment(x_i);
- Debug("arith") <<"update " << x_i << ": "
+ Trace("arith") <<"update " << x_i << ": "
<< d_variables.getAssignment(x_i) << "|-> " << v << endl;
const DeltaRational& assignment = d_variables.getAssignment(x_j);
DeltaRational nAssignment = assignment+(diff * a_ji);
- Debug("update") << x_j << " " << a_ji << assignment << " -> " << nAssignment << endl;
+ Trace("update") << x_j << " " << a_ji << assignment << " -> " << nAssignment << endl;
BoundCounts xjBefore = d_variables.atBoundCounts(x_j);
d_variables.setAssignment(x_j, nAssignment);
BoundCounts xjAfter = d_variables.atBoundCounts(x_j);
d_basicVariableUpdates(x_j);
}
- if(Debug.isOn("paranoid:check_tableau")){ debugCheckTableau(); }
+ if(TraceIsOn("paranoid:check_tableau")){ debugCheckTableau(); }
}
void LinearEqualityModule::pivotAndUpdate(ArithVar x_i, ArithVar x_j, const DeltaRational& x_i_value){
TimerStat::CodeTimer codeTimer(d_statistics.d_pivotTime);
- if(Debug.isOn("arith::tracking::pre")){
- Debug("arith::tracking") << "pre update" << endl;
+ if(TraceIsOn("arith::tracking::pre")){
+ Trace("arith::tracking") << "pre update" << endl;
debugCheckTracking();
}
- if(Debug.isOn("arith::simplex:row")){ debugPivot(x_i, x_j); }
+ if(TraceIsOn("arith::simplex:row")){ debugPivot(x_i, x_j); }
RowIndex ridx = d_tableau.basicToRowIndex(x_i);
const Tableau::Entry& entry_ij = d_tableau.findEntry(ridx, x_j);
updateTracked(x_j, x_j_value);
- if(Debug.isOn("arith::tracking::mid")){
- Debug("arith::tracking") << "postupdate prepivot" << endl;
+ if(TraceIsOn("arith::tracking::mid")){
+ Trace("arith::tracking") << "postupdate prepivot" << endl;
debugCheckTracking();
}
d_tableau.pivot(x_i, x_j, d_trackCallback);
- if(Debug.isOn("arith::tracking::post")){
- Debug("arith::tracking") << "postpivot" << endl;
+ if(TraceIsOn("arith::tracking::post")){
+ Trace("arith::tracking") << "postpivot" << endl;
debugCheckTracking();
}
d_basicVariableUpdates(x_j);
- if(Debug.isOn("matrix")){
+ if(TraceIsOn("matrix")){
d_tableau.printMatrix();
}
}
endIter = d_tableau.endBasic();
for(; basicIter != endIter; ++basicIter){
ArithVar basic = *basicIter;
- Debug("arith::tracking") << "arith::tracking row basic: " << basic << endl;
+ Trace("arith::tracking") << "arith::tracking row basic: " << basic << endl;
- for(Tableau::RowIterator iter = d_tableau.basicRowIterator(basic); !iter.atEnd() && Debug.isOn("arith::tracking"); ++iter){
+ for(Tableau::RowIterator iter = d_tableau.basicRowIterator(basic); !iter.atEnd() && TraceIsOn("arith::tracking"); ++iter){
const Tableau::Entry& entry = *iter;
ArithVar var = entry.getColVar();
const Rational& coeff = entry.getCoefficient();
DeltaRational beta = d_variables.getAssignment(var);
- Debug("arith::tracking") << var << " " << d_variables.boundsInfo(var)
+ Trace("arith::tracking") << var << " " << d_variables.boundsInfo(var)
<< " " << beta << coeff;
if(d_variables.hasLowerBound(var)){
- Debug("arith::tracking") << "(lb " << d_variables.getLowerBound(var) << ")";
+ Trace("arith::tracking") << "(lb " << d_variables.getLowerBound(var) << ")";
}
if(d_variables.hasUpperBound(var)){
- Debug("arith::tracking") << "(up " << d_variables.getUpperBound(var) << ")";
+ Trace("arith::tracking") << "(up " << d_variables.getUpperBound(var) << ")";
}
- Debug("arith::tracking") << endl;
+ Trace("arith::tracking") << endl;
}
- Debug("arith::tracking") << "end row"<< endl;
+ Trace("arith::tracking") << "end row"<< endl;
if(basicIsTracked(basic)){
RowIndex ridx = d_tableau.basicToRowIndex(basic);
BoundsInfo computed = computeRowBoundInfo(ridx, false);
- Debug("arith::tracking")
+ Trace("arith::tracking")
<< "computed " << computed
<< " tracking " << d_btracking[ridx] << endl;
Assert(computed == d_btracking[ridx]);
}
void LinearEqualityModule::debugPivot(ArithVar x_i, ArithVar x_j){
- Debug("arith::pivot") << "debugPivot("<< x_i <<"|->"<< x_j << ")" << endl;
+ Trace("arith::pivot") << "debugPivot("<< x_i <<"|->"<< x_j << ")" << endl;
for(Tableau::RowIterator iter = d_tableau.basicRowIterator(x_i); !iter.atEnd(); ++iter){
const Tableau::Entry& entry = *iter;
ArithVar var = entry.getColVar();
const Rational& coeff = entry.getCoefficient();
DeltaRational beta = d_variables.getAssignment(var);
- Debug("arith::pivot") << var << beta << coeff;
+ Trace("arith::pivot") << var << beta << coeff;
if(d_variables.hasLowerBound(var)){
- Debug("arith::pivot") << "(lb " << d_variables.getLowerBound(var) << ")";
+ Trace("arith::pivot") << "(lb " << d_variables.getLowerBound(var) << ")";
}
if(d_variables.hasUpperBound(var)){
- Debug("arith::pivot") << "(up " << d_variables.getUpperBound(var) << ")";
+ Trace("arith::pivot") << "(up " << d_variables.getUpperBound(var) << ")";
}
- Debug("arith::pivot") << endl;
+ Trace("arith::pivot") << endl;
}
- Debug("arith::pivot") << "end row"<< endl;
+ Trace("arith::pivot") << "end row"<< endl;
}
/**
* This check is quite expensive.
- * It should be wrapped in a Debug.isOn() guard.
- * if(Debug.isOn("paranoid:check_tableau")){
+ * It should be wrapped in a TraceIsOn() guard.
+ * if(TraceIsOn("paranoid:check_tableau")){
* checkTableau();
* }
*/
for(; basicIter != endIter; ++basicIter){
ArithVar basic = *basicIter;
DeltaRational sum;
- Debug("paranoid:check_tableau") << "starting row" << basic << endl;
+ Trace("paranoid:check_tableau") << "starting row" << basic << endl;
Tableau::RowIterator nonbasicIter = d_tableau.basicRowIterator(basic);
for(; !nonbasicIter.atEnd(); ++nonbasicIter){
const Tableau::Entry& entry = *nonbasicIter;
const Rational& coeff = entry.getCoefficient();
DeltaRational beta = d_variables.getAssignment(nonbasic);
- Debug("paranoid:check_tableau") << nonbasic << beta << coeff<<endl;
+ Trace("paranoid:check_tableau") << nonbasic << beta << coeff<<endl;
sum = sum + (beta*coeff);
}
DeltaRational shouldBe = d_variables.getAssignment(basic);
- Debug("paranoid:check_tableau") << "ending row" << sum
+ Trace("paranoid:check_tableau") << "ending row" << sum
<< "," << shouldBe << endl;
Assert(sum == shouldBe);
}
ArithVar v = c->getVariable();
- Debug("arith::propagateRow") << "LinearEqualityModule::propagateRow("
+ Trace("arith::propagateRow") << "LinearEqualityModule::propagateRow("
<< ridx << ", " << rowUp << ", " << v << ") start" << endl;
const Rational& multiple = rowUp ? d_one : d_negOne;
- Debug("arith::propagateRow") << "multiple: " << multiple << endl;
+ Trace("arith::propagateRow") << "multiple: " << multiple << endl;
Tableau::RowIterator iter = d_tableau.ridRowIterator(ridx);
for(; !iter.atEnd(); ++iter){
|| (!rowUp && a_ij.sgn() > 0 && c->isUpperBound())
|| (!rowUp && a_ij.sgn() < 0 && c->isLowerBound()));
- if(Debug.isOn("arith::propagateRow")){
+ if(TraceIsOn("arith::propagateRow")){
if(nonbasic == v){
- Debug("arith::propagateRow") << "(target) "
+ Trace("arith::propagateRow") << "(target) "
<< rowUp << " "
<< a_ij.sgn() << " "
<< c->isLowerBound() << " "
<< c->isUpperBound() << endl;
- Debug("arith::propagateRow") << "(target) ";
+ Trace("arith::propagateRow") << "(target) ";
}
- Debug("arith::propagateRow") << "propagateRow " << a_ij << " * " << nonbasic ;
+ Trace("arith::propagateRow") << "propagateRow " << a_ij << " * " << nonbasic ;
}
if(nonbasic == v){
if(farkas != RationalVectorPSentinel){
Assert(farkas->front().isZero());
Rational multAij = multiple * a_ij;
- Debug("arith::propagateRow") << "(" << multAij << ") ";
+ Trace("arith::propagateRow") << "(" << multAij << ") ";
farkas->front() = multAij;
}
- Debug("arith::propagateRow") << c << endl;
+ Trace("arith::propagateRow") << c << endl;
}else{
ConstraintCP bound = selectUb
if(farkas != RationalVectorPSentinel){
Rational multAij = multiple * a_ij;
- Debug("arith::propagateRow") << "(" << multAij << ") ";
+ Trace("arith::propagateRow") << "(" << multAij << ") ";
farkas->push_back(multAij);
}
Assert(bound != NullConstraint);
- Debug("arith::propagateRow") << bound << endl;
+ Trace("arith::propagateRow") << bound << endl;
into.push_back(bound);
}
}
- Debug("arith::propagateRow") << "LinearEqualityModule::propagateRow("
+ Trace("arith::propagateRow") << "LinearEqualityModule::propagateRow("
<< ridx << ", " << rowUp << ", " << v << ") done" << endl;
}
anyWeakening = true;
surplus = surplus - diff;
- Debug("arith::weak") << "found:" << endl;
+ Trace("arith::weak") << "found:" << endl;
if(v == basic){
- Debug("arith::weak") << " basic: ";
+ Trace("arith::weak") << " basic: ";
}
- Debug("arith::weak") << " " << surplus << " "<< diff << endl
+ Trace("arith::weak") << " " << surplus << " "<< diff << endl
<< " " << bound << c << endl
<< " " << weakerBound << weaker << endl;
Assert(!fcs.underConstruction());
TimerStat::CodeTimer codeTimer(d_statistics.d_weakenTime);
- Debug("arith::weak") << "LinearEqualityModule::minimallyWeakConflict("
+ Trace("arith::weak") << "LinearEqualityModule::minimallyWeakConflict("
<< aboveUpper <<", "<< basicVar << ", ...) start" << endl;
const Rational& adjustSgn = aboveUpper ? d_negOne : d_one;
const Rational& coeff = entry.getCoefficient();
bool weakening = false;
ConstraintP c = weakestExplanation(aboveUpper, surplus, v, coeff, weakening, basicVar);
- Debug("arith::weak") << "weak : " << weakening << " "
+ Trace("arith::weak") << "weak : " << weakening << " "
<< c->assertedToTheTheory() << " "
<< d_variables.getAssignment(v) << " "
<< c << endl;
if(anyWeakenings){
++d_statistics.d_weakeningSuccesses;
}
- Debug("arith::weak") << "LinearEqualityModule::minimallyWeakConflict("
+ Trace("arith::weak") << "LinearEqualityModule::minimallyWeakConflict("
<< aboveUpper <<", "<< basicVar << ", ...) done" << endl;
return conflicted;
}
void LinearEqualityModule::startTrackingBoundCounts(){
Assert(!d_areTracking);
d_areTracking = true;
- if(Debug.isOn("arith::tracking")){
+ if(TraceIsOn("arith::tracking")){
debugCheckTracking();
}
Assert(d_areTracking);
void LinearEqualityModule::stopTrackingBoundCounts(){
Assert(d_areTracking);
d_areTracking = false;
- if(Debug.isOn("arith::tracking")){
+ if(TraceIsOn("arith::tracking")){
debugCheckTracking();
}
Assert(!d_areTracking);
nonb = nonb.multiplyBySgn(-coeffSgn);
uint32_t length = d_tableau.basicRowLength(basic);
- Debug("basicsAtBounds")
+ Trace("basicsAtBounds")
<< "bcs " << bcs
<< "nonb " << nonb
<< "length " << length << endl;
// else, inc
if(increasing){
- Debug("handleBorders") << "push back increasing " << border << endl;
+ Trace("handleBorders") << "push back increasing " << border << endl;
d_increasing.push_back(border);
}else{
- Debug("handleBorders") << "push back decreasing " << border << endl;
+ Trace("handleBorders") << "push back decreasing " << border << endl;
d_decreasing.push_back(border);
}
return false;
int focusCoeffSgn = focusCoeff.sgn();
- Debug("speculativeUpdate") << "speculativeUpdate" << endl;
- Debug("speculativeUpdate") << "nb " << nb << endl;
- Debug("speculativeUpdate") << "focusCoeff " << focusCoeff << endl;
+ Trace("speculativeUpdate") << "speculativeUpdate" << endl;
+ Trace("speculativeUpdate") << "nb " << nb << endl;
+ Trace("speculativeUpdate") << "focusCoeff " << focusCoeff << endl;
if(d_variables.hasUpperBound(nb)){
ConstraintP ub = d_variables.getUpperBoundConstraint(nb);
d_upperBoundDifference = ub->getValue() - d_variables.getAssignment(nb);
Border border(ub, *d_upperBoundDifference, false, NULL, true);
- Debug("handleBorders") << "push back increasing " << border << endl;
+ Trace("handleBorders") << "push back increasing " << border << endl;
d_increasing.push_back(border);
}
if(d_variables.hasLowerBound(nb)){
ConstraintP lb = d_variables.getLowerBoundConstraint(nb);
d_lowerBoundDifference = lb->getValue() - d_variables.getAssignment(nb);
Border border(lb, *d_lowerBoundDifference, false, NULL, false);
- Debug("handleBorders") << "push back decreasing " << border << endl;
+ Trace("handleBorders") << "push back decreasing " << border << endl;
d_decreasing.push_back(border);
}
int fixesRemaining = heap.possibleFixes();
- Debug("handleBorders")
+ Trace("handleBorders")
<< "handleBorders "
<< "nb " << nb
<< "fc " << focusCoeff
DeltaRational blockChangeToFocus = diff * effectiveCoefficient;
totalFocusChange += blockChangeToFocus;
- Debug("handleBorders")
+ Trace("handleBorders")
<< "blockValue " << (blockValue)
<< "diff " << diff
<< "blockChangeToFocus " << totalFocusChange
for(BorderVec::const_iterator i = startBlock; i != endBlock; ++i){
const Border& b = *i;
- Debug("handleBorders") << b << endl;
+ Trace("handleBorders") << b << endl;
bool makesImprovement = negErrorChange > 0 ||
(negErrorChange == 0 && currFocusChangeSgn > 0);
protected:
void addEntry(RowIndex row, ArithVar col, const T& coeff){
- Debug("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl;
+ Trace("tableau") << "addEntry(" << row << "," << col <<"," << coeff << ")" << std::endl;
Assert(coeff != 0);
Assert(row < d_rows.size());
Assert(d_rowInMergeBuffer != ROW_INDEX_SENTINEL);
Assert(to != ROW_INDEX_SENTINEL);
- Debug("tableau") << "rowPlusRowTimesConstant("
+ Trace("tableau") << "rowPlusRowTimesConstant("
<< to << "," << mult << "," << d_rowInMergeBuffer << ")"
<< std::endl;
Assert(mergeBufferIsClear());
- if(Debug.isOn("matrix")) { printMatrix(); }
+ if(TraceIsOn("matrix")) { printMatrix(); }
}
/** to += mult * buffer. */
Assert(d_rowInMergeBuffer != ROW_INDEX_SENTINEL);
Assert(to != ROW_INDEX_SENTINEL);
- Debug("tableau") << "rowPlusRowTimesConstant("
+ Trace("tableau") << "rowPlusRowTimesConstant("
<< to << "," << mult << "," << d_rowInMergeBuffer << ")"
<< std::endl;
Assert(mergeBufferIsClear());
- if(Debug.isOn("matrix")) { printMatrix(); }
+ if(TraceIsOn("matrix")) { printMatrix(); }
}
bool mergeBufferIsClear() const{
}
/**
- * Prints the contents of the Matrix to Debug("matrix")
+ * Prints the contents of the Matrix to Trace("matrix")
*/
void printMatrix(std::ostream& out) const {
out << "Matrix::printMatrix" << std::endl;
}
}
void printMatrix() const {
- printMatrix(Debug("matrix"));
+ printMatrix(Trace("matrix"));
}
void printRow(RowIndex rid, std::ostream& out) const {
out << "}" << std::endl;
}
void printRow(RowIndex rid) const {
- printRow(rid, Debug("matrix"));
+ printRow(rid, Trace("matrix"));
}
void printEntry(const MatrixEntry<T>& entry, std::ostream& out) const {
out << entry.getColVar() << "*" << entry.getCoefficient();
}
void printEntry(const MatrixEntry<T>& entry) const {
- printEntry(entry, Debug("matrix"));
+ printEntry(entry, Trace("matrix"));
}
public:
uint32_t size() const {
const Entry& entry = *i;
ArithVar colVar = entry.getColVar();
uint32_t count = debugCountColLength(colVar);
- Debug("tableau") << "debugMatchingCountsForRow "
+ Trace("tableau") << "debugMatchingCountsForRow "
<< ridx << ":" << colVar << " " << count
<<" "<< getColLength(colVar) << std::endl;
if( count != getColLength(colVar) ){
}
uint32_t debugCountColLength(ArithVar var){
- Debug("tableau") << var << " ";
+ Trace("tableau") << var << " ";
uint32_t count = 0;
for(ColIterator i=getColumn(var).begin(); !i.atEnd(); ++i){
const Entry& entry = *i;
- Debug("tableau") << "(" << entry.getRowIndex() << ", " << i.getID() << ") ";
+ Trace("tableau") << "(" << entry.getRowIndex() << ", " << i.getID() << ") ";
++count;
}
- Debug("tableau") << std::endl;
+ Trace("tableau") << std::endl;
return count;
}
uint32_t debugCountRowLength(RowIndex ridx){
== options::nlCovLiftingMode::LAZARD)
{
intervals = le.infeasibleRegions(p, sc);
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
auto reference = poly::infeasible_regions(p, d_assignment, sc);
Trace("cdcac") << "Lazard: " << intervals << std::endl;
PolyVector CDCAC::requiredCoefficients(const poly::Polynomial& p)
{
- if (Trace.isOn("cdcac::projection"))
+ if (TraceIsOn("cdcac::projection"))
{
Trace("cdcac::projection")
<< "Poly: " << p << " over " << d_assignment << std::endl;
<< d_variableOrdering[curVariable] << std::endl;
std::vector<CACInterval> intervals = getUnsatIntervals(curVariable);
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
Trace("cdcac") << "Unsat intervals for " << d_variableOrdering[curVariable]
<< ":" << std::endl;
pruneRedundantIntervals(intervals);
}
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
Trace("cdcac") << "Returning intervals for "
<< d_variableOrdering[curVariable] << ":" << std::endl;
cleanIntervals(intervals);
if (options().arith.nlCovPrune)
{
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
auto copy = intervals;
removeRedundantIntervals(intervals);
// Simplifies removal of redundancies later on.
if (intervals.size() < 2) return;
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
Trace("cdcac") << "Before pruning:" << std::endl;
for (const auto& i : intervals)
intervals.pop_back();
}
}
- if (Trace.isOn("cdcac"))
+ if (TraceIsOn("cdcac"))
{
Trace("cdcac") << "After pruning:" << std::endl;
for (const auto& i : intervals)
void addR(const poly::Variable& var)
{
d_variables.emplace_back(var);
- if (Trace.isOn("nl-cov::lazard"))
+ if (TraceIsOn("nl-cov::lazard"))
{
std::string vname = lp_variable_db_get_name(
poly::Context::get_context().get_variable_db(), var.get_internal());
void CoveringsSolver::initLastCall(const std::vector<Node>& assertions)
{
#ifdef CVC5_POLY_IMP
- if (Trace.isOn("nl-cov"))
+ if (TraceIsOn("nl-cov"))
{
Trace("nl-cov") << "CoveringsSolver::initLastCall" << std::endl;
Trace("nl-cov") << "* Assertions: " << std::endl;
Trace("nl-cov") << "Found conflict: " << lem << std::endl;
return;
}
- if (Trace.isOn("nl-cov"))
+ if (TraceIsOn("nl-cov"))
{
Trace("nl-cov") << "After simplifications" << std::endl;
Trace("nl-cov") << "* Assertions: " << std::endl;
std::vector<Node> EqualitySubstitution::eliminateEqualities(
const std::vector<Node>& assertions)
{
- if (Trace.isOn("nl-eqs"))
+ if (TraceIsOn("nl-eqs"))
{
Trace("nl-eqs") << "Input:" << std::endl;
for (const auto& a : assertions)
asserts = std::move(next);
}
d_conflict.clear();
- if (Trace.isOn("nl-eqs"))
+ if (TraceIsOn("nl-eqs"))
{
Trace("nl-eqs") << "Output:" << std::endl;
for (const auto& a : asserts)
if (ArithMSum::getMonomialSumLit(atom, msum))
{
Trace("nl-ext-debug") << "got monomial sum: " << std::endl;
- if (Trace.isOn("nl-ext-debug"))
+ if (TraceIsOn("nl-ext-debug"))
{
ArithMSum::debugPrintMonomialSum(msum, "nl-ext-debug");
}
{
Trace("nl-ext-factor") << "Factoring for literal " << lit
<< ", monomial sum is : " << std::endl;
- if (Trace.isOn("nl-ext-factor"))
+ if (TraceIsOn("nl-ext-factor"))
{
ArithMSum::debugPrintMonomialSum(msum, "nl-ext-factor");
}
}
// add to status if maximal degree
d_ci_max[x][coeff][rhs] = d_cdb.isMaximal(atom, x);
- if (Trace.isOn("nl-ext-bound-debug2"))
+ if (TraceIsOn("nl-ext-bound-debug2"))
{
Node t = ArithMSum::mkCoeffTerm(coeff, x);
Trace("nl-ext-bound-debug2") << "Add Bound: " << t << " " << type << " "
updated = false;
}
}
- if (Trace.isOn("nl-ext-bound"))
+ if (TraceIsOn("nl-ext-bound"))
{
if (updated)
{
}
Kind type_b = itcbr->second;
exp.push_back(d_ci_exp[b][coeff_b][rhs_b]);
- if (Trace.isOn("nl-ext-rbound"))
+ if (TraceIsOn("nl-ext-rbound"))
{
Trace("nl-ext-rbound") << "* try bounds : ";
debugPrintBound("nl-ext-rbound", coeff_a, a, type_a, rhs_a);
if (d_ms_proc.find(a) == d_ms_proc.end())
{
std::vector<Node> exp;
- if (Trace.isOn("nl-ext-debug"))
+ if (TraceIsOn("nl-ext-debug"))
{
Node cmva = d_data->d_model.computeConcreteModelValue(a);
Trace("nl-ext-debug")
{
Node valAndXY = d_model.computeAbstractModelValue(i);
Node valAndXYC = d_model.computeConcreteModelValue(i);
- if (Trace.isOn("iand-check"))
+ if (TraceIsOn("iand-check"))
{
Node x = i[0];
Node y = i[1];
{
// set its exact model value in the substitution
Node curv = computeConcreteModelValue(cur);
- if (Trace.isOn("nl-ext-cm"))
+ if (TraceIsOn("nl-ext-cm"))
{
Trace("nl-ext-cm")
<< "check-model-bound : exact : " << cur << " = ";
Assert(u.isConst());
Assert(l.getConst<Rational>() <= u.getConst<Rational>());
d_check_model_bounds[v] = std::pair<Node, Node>(l, u);
- if (Trace.isOn("nl-ext-cm"))
+ if (TraceIsOn("nl-ext-cm"))
{
Trace("nl-ext-cm") << "check-model-bound : approximate : ";
printRationalApprox("nl-ext-cm", l);
if (uvf.isVar() && !hasAssignment(uvf))
{
Node uvfv = computeConcreteModelValue(uvf);
- if (Trace.isOn("nl-ext-cm"))
+ if (TraceIsOn("nl-ext-cm"))
{
Trace("nl-ext-cm") << "check-model-bound : exact : " << uvf << " = ";
printRationalApprox("nl-ext-cm", uvfv);
}
Node val = nm->mkConst(CONST_RATIONAL,
-c.getConst<Rational>() / b.getConst<Rational>());
- if (Trace.isOn("nl-ext-cm"))
+ if (TraceIsOn("nl-ext-cm"))
{
Trace("nl-ext-cm") << "check-model-bound : exact : " << var << " = ";
printRationalApprox("nl-ext-cm", val);
{
Node vc = vars[i];
unsigned vcfact = factors[i];
- if (Trace.isOn("nl-ext-cms-debug"))
+ if (TraceIsOn("nl-ext-cms-debug"))
{
Trace("nl-ext-cms-debug") << "-- " << vc;
if (vcfact > 1)
void NlModel::printModelValue(const char* c, Node n, unsigned prec) const
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
Trace(c) << " " << n << " -> ";
const Node& aval = d_abstractModelCache.at(n);
}
}
- if (Trace.isOn("nl-ext-debug"))
+ if (TraceIsOn("nl-ext-debug"))
{
Trace("nl-ext-debug") << " processing NonlinearExtension::check : "
<< std::endl;
{
++(d_stats.d_checkRuns);
- if (Trace.isOn("nl-strategy"))
+ if (TraceIsOn("nl-strategy"))
{
for (const auto& a : assertions)
{
Node valPow2xAbstract = d_model.computeAbstractModelValue(n);
Node valPow2xConcrete = d_model.computeConcreteModelValue(n);
Node valXConcrete = d_model.computeConcreteModelValue(n[0]);
- if (Trace.isOn("pow2-check"))
+ if (TraceIsOn("pow2-check"))
{
Trace("pow2-check") << "* " << i << ", value = " << valPow2xAbstract
<< std::endl;
void TranscendentalSolver::checkTranscendentalTangentPlanes()
{
- if (Trace.isOn("nl-ext"))
+ if (TraceIsOn("nl-ext"))
{
if (!d_tstate.d_funcMap.empty())
{
is_tangent = concavity == -1;
is_secant = concavity == 1;
}
- if (Trace.isOn("nl-ext-tftp"))
+ if (TraceIsOn("nl-ext-tftp"))
{
Trace("nl-ext-tftp") << "*** Outside boundary point (";
Trace("nl-ext-tftp") << (r == 0 ? "low" : "high") << ") ";
getCurrentPiBounds();
}
- if (Trace.isOn("nl-ext-mv"))
+ if (TraceIsOn("nl-ext-mv"))
{
Trace("nl-ext-mv") << "Arguments of trancendental functions : "
<< std::endl;
}
void Monomial::print() const {
- Debug("normal-form") << getNode() << std::endl;
+ Trace("normal-form") << getNode() << std::endl;
}
void Monomial::printList(const std::vector<Monomial>& list) {
return true;
}else{
Monomial minimum = minimumVariableMonomial();
- Debug("nf::tmp") << "minimum " << minimum.getNode() << endl;
- Debug("nf::tmp") << "m " << m.getNode() << endl;
+ Trace("nf::tmp") << "minimum " << minimum.getNode() << endl;
+ Trace("nf::tmp") << "m " << m.getNode() << endl;
return m < minimum;
}
}
{
Polynomial left = getLeft();
Polynomial right = getRight();
- Debug("nf::tmp") << "left: " << left.getNode() << endl;
- Debug("nf::tmp") << "right: " << right.getNode() << endl;
+ Trace("nf::tmp") << "left: " << left.getNode() << endl;
+ Trace("nf::tmp") << "right: " << right.getNode() << endl;
if(right.isConstant()){
return SumPair(left, -right.getHead().getConstant());
}else if(right.containsConstant()){
}
Comparison Comparison::parseNormalForm(TNode n) {
- Debug("polynomial") << "Comparison::parseNormalForm(" << n << ")";
+ Trace("polynomial") << "Comparison::parseNormalForm(" << n << ")";
Comparison result(n);
Assert(result.isNormalForm());
return result;
bool Comparison::isNormalForm() const {
Node n = getNode();
Kind cmpKind = comparisonKind(n);
- Debug("nf::tmp") << "isNormalForm " << n << " " << cmpKind << endl;
+ Trace("nf::tmp") << "isNormalForm " << n << " " << cmpKind << endl;
switch(cmpKind){
case kind::CONST_BOOLEAN:
return true;
/** This must be (not (> qpolynomial constant)) */
bool Comparison::isNormalLEQ() const {
Node n = getNode();
- Debug("nf::tmp") << "isNormalLEQ " << n << endl;
+ Trace("nf::tmp") << "isNormalLEQ " << n << endl;
Assert(n.getKind() == kind::NOT);
Assert(n[0].getKind() == kind::GT);
if(!rightIsConstant()){
Node n = getNode();
Assert(n.getKind() == kind::GEQ);
- Debug("nf::tmp") << "isNormalGEQ " << n << " " << rightIsConstant() << endl;
+ Trace("nf::tmp") << "isNormalGEQ " << n << " " << rightIsConstant() << endl;
if(!rightIsConstant()){
return false;
}else{
Integer lcm = lcoeff.getDenominator().lcm(varRight.denominatorLCM());
Integer g = lcoeff.getNumerator().gcd(varRight.numeratorGCD());
- Debug("nf::tmp") << lcm << " " << g << endl;
+ Trace("nf::tmp") << lcm << " " << g << endl;
if(!lcm.isOne()){
return false;
}else if(!g.isOne()){
return false;
}else{
Monomial absMinRight = varRight.selectAbsMinimum();
- Debug("nf::tmp") << mleft.getNode() << " " << absMinRight.getNode() << endl;
+ Trace("nf::tmp") << mleft.getNode() << " " << absMinRight.getNode() << endl;
if( mleft.absCmp(absMinRight) < 0){
return true;
}else{
}
}else{
if(mleft.coefficientIsOne()){
- Debug("nf::tmp")
+ Trace("nf::tmp")
<< "dfklj " << mleft.getNode() << endl
<< pright.getNode() << endl
<< pright.variableMonomialAreStrictlyGreater(mleft)
bool variableMonomialAreStrictlyGreater(const Monomial& m) const;
void printList() const {
- if(Debug.isOn("normal-form")){
- Debug("normal-form") << "start list" << std::endl;
+ if(TraceIsOn("normal-form")){
+ Trace("normal-form") << "start list" << std::endl;
for(iterator i = begin(), oend = end(); i != oend; ++i) {
const Monomial& m =*i;
m.print();
}
- Debug("normal-form") << "end list" << std::endl;
+ Trace("normal-form") << "end list" << std::endl;
}
}
}
void ArithVariables::setAssignment(ArithVar x, const DeltaRational& r){
- Debug("partial_model") << "pm: updating the assignment to" << x
+ Trace("partial_model") << "pm: updating the assignment to" << x
<< " now " << r <<endl;
VarInfo& vi = d_vars.get(x);
if(!d_safeAssignment.isKey(x)){
}
void ArithVariables::setAssignment(ArithVar x, const DeltaRational& safe, const DeltaRational& r){
- Debug("partial_model") << "pm: updating the assignment to" << x
+ Trace("partial_model") << "pm: updating the assignment to" << x
<< " now " << r <<endl;
if(safe == r){
if(d_safeAssignment.isKey(x)){
AssertArgument(c->isEquality() || c->isLowerBound(),
"Constraint type must be set to an equality or UpperBound.");
ArithVar x = c->getVariable();
- Debug("partial_model") << "setLowerBoundConstraint(" << x << ":" << c << ")" << endl;
+ Trace("partial_model") << "setLowerBoundConstraint(" << x << ":" << c << ")" << endl;
Assert(inMaps(x));
Assert(greaterThanLowerBound(x, c->getValue()));
"Constraint type must be set to an equality or UpperBound.");
ArithVar x = c->getVariable();
- Debug("partial_model") << "setUpperBoundConstraint(" << x << ":" << c << ")" << endl;
+ Trace("partial_model") << "setUpperBoundConstraint(" << x << ":" << c << ")" << endl;
Assert(inMaps(x));
Assert(lessThanUpperBound(x, c->getValue()));
}
void ArithVariables::printModel(ArithVar x) const{
- printModel(x, Debug("model"));
+ printModel(x, Trace("model"));
}
void ArithVariables::pushUpperBound(VarInfo& vi){
Node leq = NodeBuilder(kind::LEQ) << atom[0] << atom[1];
Node geq = NodeBuilder(kind::GEQ) << atom[0] << atom[1];
Node rewritten = rewrite(leq.andNode(geq));
- Debug("arith::preprocess")
+ Trace("arith::preprocess")
<< "arith::preprocess() : returning " << rewritten << std::endl;
// don't need to rewrite terms since rewritten is not a non-standard op
if (d_env.isTheoryProofProducing())
const std::vector<Node>& args)
{
NodeManager* nm = NodeManager::currentNM();
- if (Debug.isOn("arith::pf::check"))
+ if (TraceIsOn("arith::pf::check"))
{
- Debug("arith::pf::check") << "Arith PfRule:" << id << std::endl;
- Debug("arith::pf::check") << " children: " << std::endl;
+ Trace("arith::pf::check") << "Arith PfRule:" << id << std::endl;
+ Trace("arith::pf::check") << " children: " << std::endl;
for (const auto& c : children)
{
- Debug("arith::pf::check") << " * " << c << std::endl;
+ Trace("arith::pf::check") << " * " << c << std::endl;
}
- Debug("arith::pf::check") << " args:" << std::endl;
+ Trace("arith::pf::check") << " args:" << std::endl;
for (const auto& c : args)
{
- Debug("arith::pf::check") << " * " << c << std::endl;
+ Trace("arith::pf::check") << " * " << c << std::endl;
}
}
switch (id)
}
default:
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Bad kind: " << children[i].getKind() << std::endl;
return Node::null();
}
Rational scalar = args[i].getConst<Rational>();
if (scalar == 0)
{
- Debug("arith::pf::check") << "Error: zero scalar" << std::endl;
+ Trace("arith::pf::check") << "Error: zero scalar" << std::endl;
return Node::null();
}
}
default:
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Bad kind: " << children[i].getKind() << std::endl;
}
}
{
if (scalar > 0)
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Positive scalar for lower bound: " << scalar << " for "
<< children[i] << std::endl;
return Node::null();
{
if (scalar < 0)
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Negative scalar for upper bound: " << scalar << " for "
<< children[i] << std::endl;
return Node::null();
}
default:
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Bad kind: " << children[i].getKind() << std::endl;
}
}
&& children[0].getKind() != Kind::GEQ)
|| !children[0][0].getType().isInteger() || !children[0][1].isConst())
{
- Debug("arith::pf::check") << "Illformed input: " << children;
+ Trace("arith::pf::check") << "Illformed input: " << children;
return Node::null();
}
else
&& children[0].getKind() != Kind::LEQ)
|| !children[0][0].getType().isInteger() || !children[0][1].isConst())
{
- Debug("arith::pf::check") << "Illformed input: " << children;
+ Trace("arith::pf::check") << "Illformed input: " << children;
return Node::null();
}
else
cmps.insert(c.getKind());
if (cmps.count(Kind::EQUAL) == 0)
{
- Debug("arith::pf::check") << "Error: No = " << std::endl;
+ Trace("arith::pf::check") << "Error: No = " << std::endl;
return Node::null();
}
if (cmps.count(Kind::GT) == 0)
{
- Debug("arith::pf::check") << "Error: No > " << std::endl;
+ Trace("arith::pf::check") << "Error: No > " << std::endl;
return Node::null();
}
if (cmps.count(Kind::LT) == 0)
{
- Debug("arith::pf::check") << "Error: No < " << std::endl;
+ Trace("arith::pf::check") << "Error: No < " << std::endl;
return Node::null();
}
return args[0];
}
else
{
- Debug("arith::pf::check")
+ Trace("arith::pf::check")
<< "Error: Different polynomials / values" << std::endl;
- Debug("arith::pf::check") << " a: " << a << std::endl;
- Debug("arith::pf::check") << " b: " << b << std::endl;
- Debug("arith::pf::check") << " c: " << c << std::endl;
+ Trace("arith::pf::check") << " a: " << a << std::endl;
+ Trace("arith::pf::check") << " b: " << b << std::endl;
+ Trace("arith::pf::check") << " c: " << c << std::endl;
return Node::null();
}
// Check that all have the same constant:
Node distributeMultiplication(const std::vector<TNode>& factors)
{
- if (Trace.isOn("arith-rewriter-distribute"))
+ if (TraceIsOn("arith-rewriter-distribute"))
{
Trace("arith-rewriter-distribute") << "Distributing" << std::endl;
for (const auto& f : factors)
addToSum(newsum, mkNonlinearMult(newProduct), multiplicity);
}
}
- if (Trace.isOn("arith-rewriter-distribute"))
+ if (TraceIsOn("arith-rewriter-distribute"))
{
Trace("arith-rewriter-distribute")
<< "multiplied with " << factor << std::endl;
if(!d_conflictVariables.isMember(curr) && checkBasicForConflict(curr)){
- Debug("recentlyViolated")
+ Trace("recentlyViolated")
<< "It worked? "
<< conflicts.get()
<< " " << curr
}
ArithVar SimplexDecisionProcedure::constructInfeasiblityFunction(TimerStat& timer, const ArithVarVec& set){
- Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction start" << endl;
+ Trace("constructInfeasiblityFunction") << "constructInfeasiblityFunction start" << endl;
TimerStat::CodeTimer codeTimer(timer);
Assert(!d_errorSet.focusEmpty());
coeffs.push_back(violatedCoeff);
variables.push_back(e);
- Debug("constructInfeasiblityFunction") << violatedCoeff << " " << e << endl;
+ Trace("constructInfeasiblityFunction") << violatedCoeff << " " << e << endl;
}
d_tableau.addRow(inf, coeffs, variables);
//d_linEq.trackVariable(inf);
d_linEq.trackRowIndex(d_tableau.basicToRowIndex(inf));
- Debug("constructInfeasiblityFunction") << inf << " " << newAssignment << endl;
- Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction done" << endl;
+ Trace("constructInfeasiblityFunction") << inf << " " << newAssignment << endl;
+ Trace("constructInfeasiblityFunction") << "constructInfeasiblityFunction done" << endl;
return inf;
}
d_pivots = 0;
if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){
- Debug("soi::findModel") << "soiFindModel() trivial" << endl;
+ Trace("soi::findModel") << "soiFindModel() trivial" << endl;
Assert(d_conflictVariables.empty());
return Result::SAT;
}
if(initialProcessSignals()){
d_conflictVariables.purge();
- Debug("soi::findModel") << "fcFindModel() early conflict" << endl;
+ Trace("soi::findModel") << "fcFindModel() early conflict" << endl;
Assert(d_conflictVariables.empty());
return Result::UNSAT;
}else if(d_errorSet.errorEmpty()){
- Debug("soi::findModel") << "fcFindModel() fixed itself" << endl;
+ Trace("soi::findModel") << "fcFindModel() fixed itself" << endl;
Assert(!d_errorSet.moreSignals());
Assert(d_conflictVariables.empty());
return Result::SAT;
}
- Debug("soi::findModel") << "fcFindModel() start non-trivial" << endl;
+ Trace("soi::findModel") << "fcFindModel() start non-trivial" << endl;
exactResult |= d_varOrderPivotLimit < 0;
// ensure that the conflict variable is still in the queue.
d_conflictVariables.purge();
- Debug("soi::findModel") << "end findModel() " << result << endl;
+ Trace("soi::findModel") << "end findModel() " << result << endl;
Assert(d_conflictVariables.empty());
return result;
d_leavingCountSinceImprovement.purge();
}
- Debug("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl;
+ Trace("logPivot") << "logPivot " << d_prevWitnessImprovement << " " << d_witnessImprovementInARow << endl;
}
uint32_t SumOfInfeasibilitiesSPD::degeneratePivotsInARow() const {
UpdateInfo SumOfInfeasibilitiesSPD::selectUpdate(LinearEqualityModule::UpdatePreferenceFunction upf, LinearEqualityModule::VarPreferenceFunction bpf) {
UpdateInfo selected;
- Debug("soi::selectPrimalUpdate")
+ Trace("soi::selectPrimalUpdate")
<< "selectPrimalUpdate " << endl
<< d_soiVar << " " << d_tableau.basicRowLength(d_soiVar) << " "
<< d_linEq.debugBasicAtBoundCount(d_soiVar) << endl;
(sgn > 0 && d_variables.cmpAssignmentUpperBound(curr) < 0) ||
(sgn < 0 && d_variables.cmpAssignmentLowerBound(curr) > 0);
- Debug("soi::selectPrimalUpdate")
+ Trace("soi::selectPrimalUpdate")
<< "storing " << d_soiVar
<< " " << curr
<< " " << candidate
LinearEqualityModule::UpdatePreferenceFunction leavingPrefFunc = selectLeavingFunction(curr);
UpdateInfo currProposal = d_linEq.speculativeUpdate(curr, coeff, leavingPrefFunc);
- Debug("soi::selectPrimalUpdate")
+ Trace("soi::selectPrimalUpdate")
<< "selected " << selected << endl
<< "currProp " << currProposal << endl
<< "coeff " << coeff << endl;
if(selected.uninitialized() || (d_linEq.*upf)(selected, currProposal)){
selected = currProposal;
WitnessImprovement w = selected.getWitness(false);
- Debug("soi::selectPrimalUpdate") << "selected " << w << endl;
+ Trace("soi::selectPrimalUpdate") << "selected " << w << endl;
//setPenalty(curr, w);
if(improvement(w)){
bool exitEarly;
if(exitEarly){ break; }
}
}else{
- Debug("soi::selectPrimalUpdate") << "dropped "<< endl;
+ Trace("soi::selectPrimalUpdate") << "dropped "<< endl;
}
}
void SumOfInfeasibilitiesSPD::debugPrintSignal(ArithVar updated) const{
- Debug("updateAndSignal") << "updated basic " << updated;
- Debug("updateAndSignal") << " length " << d_tableau.basicRowLength(updated);
- Debug("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated);
+ Trace("updateAndSignal") << "updated basic " << updated;
+ Trace("updateAndSignal") << " length " << d_tableau.basicRowLength(updated);
+ Trace("updateAndSignal") << " consistent " << d_variables.assignmentIsConsistent(updated);
int dir = !d_variables.assignmentIsConsistent(updated) ?
d_errorSet.getSgn(updated) : 0;
- Debug("updateAndSignal") << " dir " << dir;
- Debug("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl;
+ Trace("updateAndSignal") << " dir " << dir;
+ Trace("updateAndSignal") << " debugBasicAtBoundCount " << d_linEq.debugBasicAtBoundCount(updated) << endl;
}
void SumOfInfeasibilitiesSPD::updateAndSignal(const UpdateInfo& selected, WitnessImprovement w){
ArithVar nonbasic = selected.nonbasic();
- Debug("updateAndSignal") << "updateAndSignal " << selected << endl;
+ Trace("updateAndSignal") << "updateAndSignal " << selected << endl;
if(selected.describesPivot()){
ConstraintP limiting = selected.limiting();
if(d_tableau.isBasic(updated)){
Assert(!d_variables.assignmentIsConsistent(updated)
== d_errorSet.inError(updated));
- if(Debug.isOn("updateAndSignal")){debugPrintSignal(updated);}
+ if(TraceIsOn("updateAndSignal")){debugPrintSignal(updated);}
if(!d_variables.assignmentIsConsistent(updated)){
if(checkBasicForConflict(updated)){
reportConflict(updated);
}
}
}else{
- Debug("updateAndSignal") << "updated nonbasic " << updated << endl;
+ Trace("updateAndSignal") << "updated nonbasic " << updated << endl;
}
int currFocusSgn = d_errorSet.focusSgn(updated);
if(currFocusSgn != prevFocusSgn){
}
}
- if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); }
+ if(TraceIsOn("error")){ d_errorSet.debugPrint(Trace("error")); }
//Assert(debugSelectedErrorDropped(selected, d_errorSize, d_errorSet.errorSize()));
}
std::vector< ArithVarVec > SumOfInfeasibilitiesSPD::greedyConflictSubsets(){
- Debug("arith::greedyConflictSubsets") << "greedyConflictSubsets start" << endl;
+ Trace("arith::greedyConflictSubsets") << "greedyConflictSubsets start" << endl;
std::vector< ArithVarVec > subsets;
Assert(d_soiVar == ARITHVAR_SENTINEL);
ArithVar e = *iter;
addRowSgns(sgns, e, d_errorSet.getSgn(e));
- Debug("arith::greedyConflictSubsets") << "basic error var: " << e << endl;
- if(Debug.isOn("arith::greedyConflictSubsets")){
+ Trace("arith::greedyConflictSubsets") << "basic error var: " << e << endl;
+ if(TraceIsOn("arith::greedyConflictSubsets")){
d_tableau.debugPrintIsBasic(e);
- d_tableau.printBasicRow(e, Debug("arith::greedyConflictSubsets"));
+ d_tableau.printBasicRow(e, Trace("arith::greedyConflictSubsets"));
}
}
tmp[0] = e;
tmp[1] = b;
if(trySet(tmp) == 2){
- Debug("arith::greedyConflictSubsets") << "found a pair " << b << " " << e << endl;
+ Trace("arith::greedyConflictSubsets") << "found a pair " << b << " " << e << endl;
hasParticipated.softAdd(b);
hasParticipated.softAdd(e);
Assert(debugIsASet(tmp));
underConstruction.push_back(v);
d_soiVar = constructInfeasiblityFunction(d_statistics.d_soiConflictMinimization, v);
- Debug("arith::greedyConflictSubsets") << "trying " << v << endl;
+ Trace("arith::greedyConflictSubsets") << "trying " << v << endl;
const Tableau::Entry* spoiler = NULL;
while( (spoiler = d_linEq.selectSlackEntry(d_soiVar, false)) != NULL){
int oppositeSgn = -(spoiler->getCoefficient().sgn());
Assert(oppositeSgn != 0);
- Debug("arith::greedyConflictSubsets") << "looking for " << nb << " " << oppositeSgn << endl;
+ Trace("arith::greedyConflictSubsets") << "looking for " << nb << " " << oppositeSgn << endl;
ArithVar basicWithOp = find_basic_in_sgns(sgns, nb, oppositeSgn, hasParticipated, false);
if(basicWithOp == ARITHVAR_SENTINEL){
- Debug("arith::greedyConflictSubsets") << "search did not work for " << nb << endl;
+ Trace("arith::greedyConflictSubsets") << "search did not work for " << nb << endl;
// greedy construction has failed
break;
}else{
- Debug("arith::greedyConflictSubsets") << "found " << basicWithOp << endl;
+ Trace("arith::greedyConflictSubsets") << "found " << basicWithOp << endl;
addToInfeasFunc(d_statistics.d_soiConflictMinimization, d_soiVar, basicWithOp);
hasParticipated.softAdd(basicWithOp);
}
}
if(spoiler == NULL){
- Debug("arith::greedyConflictSubsets") << "success" << endl;
+ Trace("arith::greedyConflictSubsets") << "success" << endl;
//then underConstruction contains a conflicting subset
Assert(debugIsASet(underConstruction));
subsets.push_back(underConstruction);
++d_statistics.d_maybeNotMinimal;
}
}else{
- Debug("arith::greedyConflictSubsets") << "failure" << endl;
+ Trace("arith::greedyConflictSubsets") << "failure" << endl;
}
tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar);
d_soiVar = ARITHVAR_SENTINEL;
}
Assert(d_soiVar == ARITHVAR_SENTINEL);
- Debug("arith::greedyConflictSubsets") << "greedyConflictSubsets done" << endl;
+ Trace("arith::greedyConflictSubsets") << "greedyConflictSubsets done" << endl;
return subsets;
}
Assert(!subset.empty());
Assert(!d_conflictBuilder->underConstruction());
- Debug("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) start" << endl;
+ Trace("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) start" << endl;
bool success = false;
int sgn = d_errorSet.getSgn(e);
const Rational& violatedCoeff = sgn > 0 ? d_negOne : d_posOne;
- Debug("arith::generateSOIConflict") << "basic error var: "
+ Trace("arith::generateSOIConflict") << "basic error var: "
<< "(" << violatedCoeff << ")"
<< " " << violated
<< endl;
d_variables.getUpperBoundConstraint(v) :
d_variables.getLowerBoundConstraint(v);
- Debug("arith::generateSOIConflict") << "non-basic var: "
+ Trace("arith::generateSOIConflict") << "non-basic var: "
<< "(" << coeff << ")"
<< " " << c
<< endl;
tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar);
d_soiVar = ARITHVAR_SENTINEL;
- Debug("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) done" << endl;
+ Trace("arith::generateSOIConflict") << "SumOfInfeasibilitiesSPD::generateSOIConflict(...) done" << endl;
Assert(d_soiVar == ARITHVAR_SENTINEL);
Assert(!d_conflictBuilder->underConstruction());
return success;
WitnessImprovement SumOfInfeasibilitiesSPD::SOIConflict(){
- Debug("arith::SOIConflict") << "SumOfInfeasibilitiesSPD::SOIConflict() start "
+ Trace("arith::SOIConflict") << "SumOfInfeasibilitiesSPD::SOIConflict() start "
<< ": |E| = " << d_errorSize << endl;
- if(Debug.isOn("arith::SOIConflict")){
+ if(TraceIsOn("arith::SOIConflict")){
d_errorSet.debugPrint(cout);
}
- Debug("arith::SOIConflict") << endl;
+ Trace("arith::SOIConflict") << endl;
tearDownInfeasiblityFunction(d_statistics.d_soiConflictMinimization, d_soiVar);
d_soiVar = ARITHVAR_SENTINEL;
//reportConflict(conf); do not do this. We need a custom explanations!
d_conflictVariables.add(d_soiVar);
- Debug("arith::SOIConflict")
+ Trace("arith::SOIConflict")
<< "SumOfInfeasibilitiesSPD::SOIConflict() end" << endl;
return ConflictFound;
}
UpdateInfo selected = selectUpdate(upf, bpf);
if(selected.uninitialized()){
- Debug("selectFocusImproving") << "SOI is optimum, but we don't have sat/conflict yet" << endl;
+ Trace("selectFocusImproving") << "SOI is optimum, but we don't have sat/conflict yet" << endl;
return SOIConflict();
}else{
Assert(!selected.uninitialized());
while(d_pivotBudget != 0 && d_errorSize > 0 && d_conflictVariables.empty()){
- Debug("dualLike") << "dualLike" << endl;
+ Trace("dualLike") << "dualLike" << endl;
Assert(d_errorSet.noSignals());
// Possible outcomes:
// - budget was exhausted
// - focus went down
WitnessImprovement w = soiRound();
- Debug("dualLike") << "selectFocusImproving -> " << w << endl;
+ Trace("dualLike") << "selectFocusImproving -> " << w << endl;
Assert(d_errorSize == d_errorSet.errorSize());
}
Assert(!isBasic(newBasic));
Assert(d_mergeBuffer.empty());
- Debug("tableau") << "Tableau::pivot(" << oldBasic <<", " << newBasic <<")" << endl;
+ Trace("tableau") << "Tableau::pivot(" << oldBasic <<", " << newBasic <<")" << endl;
RowIndex ridx = basicToRowIndex(oldBasic);
d_rowIndex2basic.set(newRow, basic);
- if(Debug.isOn("matrix")){ printMatrix(); }
+ if(TraceIsOn("matrix")){ printMatrix(); }
NoEffectCCCB noeffect;
NoEffectCCCB* nep = &noeffect;
}
}
- if(Debug.isOn("matrix")) { printMatrix(); }
+ if(TraceIsOn("matrix")) { printMatrix(); }
Assert(debugNoZeroCoefficients(newRow));
Assert(debugMatchingCountsForRow(newRow));
void debugPrintIsBasic(ArithVar v) const {
if(isBasic(v)){
- Debug("model") << v << " is basic." << std::endl;
+ Trace("model") << v << " is basic." << std::endl;
}else{
- Debug("model") << v << " is non-basic." << std::endl;
+ Trace("model") << v << " is non-basic." << std::endl;
}
}
TrustNode TheoryArith::ppRewrite(TNode atom, std::vector<SkolemLemma>& lems)
{
CodeTimer timer(d_ppRewriteTimer, /* allow_reentrant = */ true);
- Debug("arith::preprocess") << "arith::preprocess() : " << atom << endl;
+ Trace("arith::preprocess") << "arith::preprocess() : " << atom << endl;
if (atom.getKind() == kind::EQUAL)
{
bool TheoryArith::collectModelValues(TheoryModel* m,
const std::set<Node>& termSet)
{
- if (Trace.isOn("arith::model"))
+ if (TraceIsOn("arith::model"))
{
Trace("arith::model") << "arithmetic model after pruning" << std::endl;
for (const auto& p : d_arithModelCache)
}
EqualityStatus TheoryArith::getEqualityStatus(TNode a, TNode b) {
- Debug("arith") << "TheoryArith::getEqualityStatus(" << a << ", " << b << ")" << std::endl;
+ Trace("arith") << "TheoryArith::getEqualityStatus(" << a << ", " << b << ")" << std::endl;
if (a == b)
{
return EQUALITY_TRUE_IN_MODEL;
void TheoryArithPrivate::raiseBlackBoxConflict(Node bb,
std::shared_ptr<ProofNode> pf)
{
- Debug("arith::bb") << "raiseBlackBoxConflict: " << bb << std::endl;
+ Trace("arith::bb") << "raiseBlackBoxConflict: " << bb << std::endl;
if (d_blackBoxConflict.get().isNull())
{
if (isProofEnabled())
{
- Debug("arith::bb") << " with proof " << pf << std::endl;
+ Trace("arith::bb") << " with proof " << pf << std::endl;
d_blackBoxConflictPf.set(pf);
}
d_blackBoxConflict = bb;
ArithVar x_i = constraint->getVariable();
const DeltaRational& c_i = constraint->getValue();
- Debug("arith") << "AssertLower(" << x_i << " " << c_i << ")"<< std::endl;
+ Trace("arith") << "AssertLower(" << x_i << " " << c_i << ")"<< std::endl;
Assert(!isInteger(x_i) || c_i.isIntegral());
}else if(cmpToUB == 0){
if(isInteger(x_i)){
d_constantIntegerVariables.push_back(x_i);
- Debug("dio::push") << "dio::push " << x_i << endl;
+ Trace("dio::push") << "dio::push " << x_i << endl;
}
ConstraintP ub = d_partialModel.getUpperBoundConstraint(x_i);
ConstraintP diseq = vc.getDisequality();
// x <= b, x >= b |= x = b
// (x > b or x < b or x = b)
- Debug("arith::eq") << "lb == ub, propagate eq" << eq << endl;
+ Trace("arith::eq") << "lb == ub, propagate eq" << eq << endl;
bool triConflict = diseq->isTrue();
if(!eq->isTrue()){
d_updatedBounds.softAdd(x_i);
- if(Debug.isOn("model")) {
- Debug("model") << "before" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "before" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
d_errorSet.signalVariable(x_i);
}
- if(Debug.isOn("model")) {
- Debug("model") << "after" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "after" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
ArithVar x_i = constraint->getVariable();
const DeltaRational& c_i = constraint->getValue();
- Debug("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl;
+ Trace("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl;
//Too strong because of rounding with integers
//Assert(!constraint->hasLiteral() || original == constraint->getLiteral());
Assert(!isInteger(x_i) || c_i.isIntegral());
- Debug("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl;
+ Trace("arith") << "AssertUpper(" << x_i << " " << c_i << ")"<< std::endl;
if(d_partialModel.greaterThanUpperBound(x_i, c_i) ){ // \upperbound(x_i) <= c_i
return false; //sat
}else if(cmpToLB == 0){ // \lowerBound(x_i) == \upperbound(x_i)
if(isInteger(x_i)){
d_constantIntegerVariables.push_back(x_i);
- Debug("dio::push") << "dio::push " << x_i << endl;
+ Trace("dio::push") << "dio::push " << x_i << endl;
}
const ValueCollection& vc = constraint->getValueCollection();
ConstraintP diseq = vc.getDisequality();
// x <= b, x >= b |= x = b
// (x > b or x < b or x = b)
- Debug("arith::eq") << "lb == ub, propagate eq" << eq << endl;
+ Trace("arith::eq") << "lb == ub, propagate eq" << eq << endl;
bool triConflict = diseq->isTrue();
if(!eq->isTrue()){
eq->impliedByTrichotomy(constraint, lb, triConflict);
d_updatedBounds.softAdd(x_i);
- if(Debug.isOn("model")) {
- Debug("model") << "before" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "before" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
d_errorSet.signalVariable(x_i);
}
- if(Debug.isOn("model")) {
- Debug("model") << "after" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "after" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
ArithVar x_i = constraint->getVariable();
const DeltaRational& c_i = constraint->getValue();
- Debug("arith") << "AssertEquality(" << x_i << " " << c_i << ")"<< std::endl;
+ Trace("arith") << "AssertEquality(" << x_i << " " << c_i << ")"<< std::endl;
//Should be fine in integers
Assert(!isInteger(x_i) || c_i.isIntegral());
if(isInteger(x_i)){
d_constantIntegerVariables.push_back(x_i);
- Debug("dio::push") << "dio::push " << x_i << endl;
+ Trace("dio::push") << "dio::push " << x_i << endl;
}
// Don't bother to check whether x_i != c_i is in d_diseq
d_updatedBounds.softAdd(x_i);
- if(Debug.isOn("model")) {
- Debug("model") << "before" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "before" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
d_errorSet.signalVariable(x_i);
}
- if(Debug.isOn("model")) {
- Debug("model") << "after" << endl;
+ if(TraceIsOn("model")) {
+ Trace("model") << "after" << endl;
d_partialModel.printModel(x_i);
d_tableau.debugPrintIsBasic(x_i);
}
ArithVar x_i = constraint->getVariable();
const DeltaRational& c_i = constraint->getValue();
- Debug("arith") << "AssertDisequality(" << x_i << " " << c_i << ")"<< std::endl;
+ Trace("arith") << "AssertDisequality(" << x_i << " " << c_i << ")"<< std::endl;
//Should be fine in integers
Assert(!isInteger(x_i) || c_i.isIntegral());
if(lb->isTrue()){
const ConstraintP ub = d_constraintDatabase.ensureConstraint(const_cast<ValueCollection&>(vc), UpperBound);
Assert(!ub->isTrue());
- Debug("arith::eq") << "propagate UpperBound " << constraint << lb << ub << endl;
+ Trace("arith::eq") << "propagate UpperBound " << constraint << lb << ub << endl;
const ConstraintP negUb = ub->getNegation();
if(!negUb->isTrue()){
negUb->impliedByTrichotomy(constraint, lb, false);
const ConstraintP lb = d_constraintDatabase.ensureConstraint(const_cast<ValueCollection&>(vc), LowerBound);
Assert(!lb->isTrue());
- Debug("arith::eq") << "propagate LowerBound " << constraint << lb << ub << endl;
+ Trace("arith::eq") << "propagate LowerBound " << constraint << lb << ub << endl;
const ConstraintP negLb = lb->getNegation();
if(!negLb->isTrue()){
negLb->impliedByTrichotomy(constraint, ub, false);
bool split = constraint->isSplit();
if(!split && c_i == d_partialModel.getAssignment(x_i)){
- Debug("arith::eq") << "lemma now! " << constraint << endl;
+ Trace("arith::eq") << "lemma now! " << constraint << endl;
outputTrustedLemma(constraint->split(), InferenceId::ARITH_SPLIT_DEQ);
return false;
}else if(d_partialModel.strictlyLessThanLowerBound(x_i, c_i)){
- Debug("arith::eq") << "can drop as less than lb" << constraint << endl;
+ Trace("arith::eq") << "can drop as less than lb" << constraint << endl;
}else if(d_partialModel.strictlyGreaterThanUpperBound(x_i, c_i)){
- Debug("arith::eq") << "can drop as less than ub" << constraint << endl;
+ Trace("arith::eq") << "can drop as less than ub" << constraint << endl;
}else if(!split){
- Debug("arith::eq") << "push back" << constraint << endl;
+ Trace("arith::eq") << "push back" << constraint << endl;
d_diseqQueue.push(constraint);
d_partialModel.invalidateDelta();
}else{
- Debug("arith::eq") << "skipping already split " << constraint << endl;
+ Trace("arith::eq") << "skipping already split " << constraint << endl;
}
return false;
}
void TheoryArithPrivate::notifySharedTerm(TNode n)
{
- Debug("arith::notifySharedTerm") << "notifySharedTerm: " << n << endl;
+ Trace("arith::notifySharedTerm") << "notifySharedTerm: " << n << endl;
if(n.isConst()){
d_partialModel.invalidateDelta();
}
{
TimerStat::CodeTimer codeTimer(d_statistics.d_simplifyTimer);
TNode in = tin.getNode();
- Debug("simplify") << "TheoryArithPrivate::solve(" << in << ")" << endl;
+ Trace("simplify") << "TheoryArithPrivate::solve(" << in << ")" << endl;
// Solve equalities
if (right.size() > options().arith.ppAssertMaxSubSize)
{
- Debug("simplify")
+ Trace("simplify")
<< "TheoryArithPrivate::solve(): did not substitute due to the "
"right hand side containing too many terms: "
<< minVar << ":" << elim << endl;
- Debug("simplify") << right.size() << endl;
+ Trace("simplify") << right.size() << endl;
}
else if (d_containing.isLegalElimination(minVar, elim))
{
// cannot eliminate integers here unless we know the resulting
// substitution is integral
- Debug("simplify") << "TheoryArithPrivate::solve(): substitution "
+ Trace("simplify") << "TheoryArithPrivate::solve(): substitution "
<< minVar << " |-> " << elim << endl;
outSubstitutions.addSubstitutionSolved(minVar, elim, tin);
}
else
{
- Debug("simplify") << "TheoryArithPrivate::solve(): can't substitute "
+ Trace("simplify") << "TheoryArithPrivate::solve(): can't substitute "
<< minVar << ":" << minVar.getType() << " |-> "
<< elim << ":" << elim.getType() << endl;
}
}
void TheoryArithPrivate::preRegisterTerm(TNode n) {
- Debug("arith::preregister") <<"begin arith::preRegisterTerm("<< n <<")"<< endl;
+ Trace("arith::preregister") <<"begin arith::preRegisterTerm("<< n <<")"<< endl;
d_preregisteredNodes.insert(n);
ConstraintP c = d_constraintDatabase.lookup(n);
Assert(c != NullConstraint);
- Debug("arith::preregister") << "setup constraint" << c << endl;
+ Trace("arith::preregister") << "setup constraint" << c << endl;
Assert(!c->canBePropagated());
c->setPreregistered();
}
throw LogicException(ss.str());
}
- Debug("arith::preregister") << "end arith::preRegisterTerm("<< n <<")" << endl;
+ Trace("arith::preregister") << "end arith::preRegisterTerm("<< n <<")" << endl;
}
void TheoryArithPrivate::releaseArithVar(ArithVar v){
}
d_constraintDatabase.addVariable(varX);
- Debug("arith::arithvar") << "@" << context()->getLevel() << " " << x
+ Trace("arith::arithvar") << "@" << context()->getLevel() << " " << x
<< " |-> " << varX << "(relaiming " << reclaim << ")"
<< endl;
Node n = variable.getNode();
- Debug("arith::asVectors") << "should be var: " << n << endl;
+ Trace("arith::asVectors") << "should be var: " << n << endl;
// TODO: This VarList::isMember(n) can be stronger
Assert(isLeaf(n) || VarList::isMember(n));
DeltaRational assignment = d_linEq.computeRowValue(x, false);
d_partialModel.setAssignment(x,safeAssignment,assignment);
- Debug("arith") << "setupVariable("<<x<<")"<<std::endl;
+ Trace("arith") << "setupVariable("<<x<<")"<<std::endl;
}
ArithVar TheoryArithPrivate::determineArithVar(const Polynomial& p) const{
Assert(!p.containsConstant());
Assert(p.getHead().constantIsPositive());
TNode n = p.getNode();
- Debug("determineArithVar") << "determineArithVar(" << n << ")" << endl;
+ Trace("determineArithVar") << "determineArithVar(" << n << ")" << endl;
return d_partialModel.asArithVar(n);
}
ArithVar TheoryArithPrivate::determineArithVar(TNode assertion) const{
- Debug("determineArithVar") << "determineArithVar " << assertion << endl;
+ Trace("determineArithVar") << "determineArithVar " << assertion << endl;
Comparison cmp = Comparison::parseNormalForm(assertion);
Polynomial variablePart = cmp.normalizedVariablePart();
return determineArithVar(variablePart);
// If the bounds are equal this is already in the dioSolver
//Add v = dr as a speculation.
Comparison eq = mkIntegerEqualityFromAssignment(v);
- Debug("dio::push") << "dio::push " << v << " " << eq.getNode() << endl;
+ Trace("dio::push") << "dio::push " << v << " " << eq.getNode() << endl;
Assert(!eq.isBoolean());
d_diosolver.pushInputConstraint(eq, eq.getNode());
// It does not matter what the explanation of eq is.
Comparison geq = Comparison::mkComparison(GEQ, p, c);
Node lemma = NodeManager::currentNM()->mkNode(OR, leq.getNode(), geq.getNode());
Node rewrittenLemma = rewrite(lemma);
- Debug("arith::dio::ex") << "dioCutting found the plane: " << plane.getNode() << endl;
- Debug("arith::dio::ex") << "resulting in the cut: " << lemma << endl;
- Debug("arith::dio::ex") << "rewritten " << rewrittenLemma << endl;
- Debug("arith::dio") << "dioCutting found the plane: " << plane.getNode() << endl;
- Debug("arith::dio") << "resulting in the cut: " << lemma << endl;
- Debug("arith::dio") << "rewritten " << rewrittenLemma << endl;
+ Trace("arith::dio::ex") << "dioCutting found the plane: " << plane.getNode() << endl;
+ Trace("arith::dio::ex") << "resulting in the cut: " << lemma << endl;
+ Trace("arith::dio::ex") << "rewritten " << rewrittenLemma << endl;
+ Trace("arith::dio") << "dioCutting found the plane: " << plane.getNode() << endl;
+ Trace("arith::dio") << "resulting in the cut: " << lemma << endl;
+ Trace("arith::dio") << "rewritten " << rewrittenLemma << endl;
if (proofsEnabled())
{
NodeManager* nm = NodeManager::currentNM();
ArithVar v = d_constantIntegerVariables.front();
d_constantIntegerVariables.pop();
- Debug("arith::dio") << "callDioSolver " << v << endl;
+ Trace("arith::dio") << "callDioSolver " << v << endl;
Assert(isInteger(v));
Assert(d_partialModel.boundsAreEqual(v));
Assert(orig.getKind() != EQUAL);
return orig;
}else{
- Debug("dio::push") << "dio::push " << v << " " << eq.getNode() << " with reason " << orig << endl;
+ Trace("dio::push") << "dio::push " << v << " " << eq.getNode() << " with reason " << orig << endl;
d_diosolver.pushInputConstraint(eq, orig);
}
}
Node eq = (simpleKind == DISTINCT) ? assertion[0] : assertion;
Assert(!isSetup(eq));
Node reEq = rewrite(eq);
- Debug("arith::distinct::const") << "Assertion: " << assertion << std::endl;
- Debug("arith::distinct::const") << "Eq : " << eq << std::endl;
- Debug("arith::distinct::const") << "reEq : " << reEq << std::endl;
+ Trace("arith::distinct::const") << "Assertion: " << assertion << std::endl;
+ Trace("arith::distinct::const") << "Eq : " << eq << std::endl;
+ Trace("arith::distinct::const") << "reEq : " << reEq << std::endl;
if(reEq.getKind() == CONST_BOOLEAN){
if(reEq.getConst<bool>() == isDistinct){
// if is (not true), or false
constraint = d_constraintDatabase.lookup(reAssertion);
if(assertion != reAssertion){
- Debug("arith::nf") << "getting non-nf assertion " << assertion << " |-> " << reAssertion << endl;
+ Trace("arith::nf") << "getting non-nf assertion " << assertion << " |-> " << reAssertion << endl;
Assert(constraint != NullConstraint);
d_assertionsThatDoNotMatchTheirLiterals.insert(assertion, constraint);
}
constraint->setAssertedToTheTheory(assertion, inConflict);
if(!constraint->hasProof()){
- Debug("arith::constraint") << "marking as constraint as self explaining " << endl;
+ Trace("arith::constraint") << "marking as constraint as self explaining " << endl;
constraint->setAssumption(inConflict);
} else {
- Debug("arith::constraint")
+ Trace("arith::constraint")
<< "already has proof: "
<< Constraint::externalExplainByAssertions({constraint});
}
- if(Debug.isOn("arith::negatedassumption") && inConflict){
+ if(TraceIsOn("arith::negatedassumption") && inConflict){
ConstraintP negation = constraint->getNegation();
- if(Debug.isOn("arith::negatedassumption") && negation->isAssumption()){
+ if(TraceIsOn("arith::negatedassumption") && negation->isAssumption()){
debugPrintFacts();
}
- Debug("arith::eq") << "negation has proof" << endl;
- Debug("arith::eq") << constraint << endl;
- Debug("arith::eq") << negation << endl;
+ Trace("arith::eq") << "negation has proof" << endl;
+ Trace("arith::eq") << constraint << endl;
+ Trace("arith::eq") << negation << endl;
}
if(inConflict){
ConstraintP negation = constraint->getNegation();
- if(Debug.isOn("arith::negatedassumption") && negation->isAssumption()){
+ if(TraceIsOn("arith::negatedassumption") && negation->isAssumption()){
debugPrintFacts();
}
- Debug("arith::eq") << "negation has proof" << endl;
- Debug("arith::eq") << constraint << endl;
- Debug("arith::eq") << negation << endl;
+ Trace("arith::eq") << "negation has proof" << endl;
+ Trace("arith::eq") << constraint << endl;
+ Trace("arith::eq") << negation << endl;
raiseConflict(negation, InferenceId::ARITH_CONF_FACT_QUEUE);
return NullConstraint;
}else{
ConstraintP floorConstraint = constraint->getFloor();
if(!floorConstraint->isTrue()){
bool inConflict = floorConstraint->negationHasProof();
- if (Debug.isOn("arith::intbound")) {
- Debug("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl;
- Debug("arith::intbound") << "constraint, after: " << floorConstraint << std::endl;
+ if (TraceIsOn("arith::intbound")) {
+ Trace("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl;
+ Trace("arith::intbound") << "constraint, after: " << floorConstraint << std::endl;
}
floorConstraint->impliedByIntTighten(constraint, inConflict);
floorConstraint->tryToPropagate();
ConstraintP ceilingConstraint = constraint->getCeiling();
if(!ceilingConstraint->isTrue()){
bool inConflict = ceilingConstraint->negationHasProof();
- if (Debug.isOn("arith::intbound")) {
- Debug("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl;
- Debug("arith::intbound") << "constraint, after: " << ceilingConstraint << std::endl;
+ if (TraceIsOn("arith::intbound")) {
+ Trace("arith::intbound") << "literal, before: " << constraint->getLiteral() << std::endl;
+ Trace("arith::intbound") << "constraint, after: " << ceilingConstraint << std::endl;
}
ceilingConstraint->impliedByIntTighten(constraint, inConflict);
ceilingConstraint->tryToPropagate();
if (next != ARITHVAR_SENTINEL)
{
d_nextIntegerCheckVar = next;
- if (Debug.isOn("arith::hasIntegerModel"))
+ if (TraceIsOn("arith::hasIntegerModel"))
{
- Debug("arith::hasIntegerModel") << "has int model? " << next << endl;
- d_partialModel.printModel(next, Debug("arith::hasIntegerModel"));
+ Trace("arith::hasIntegerModel") << "has int model? " << next << endl;
+ d_partialModel.printModel(next, Trace("arith::hasIntegerModel"));
}
return false;
}
/** Outputs conflicts to the output channel. */
void TheoryArithPrivate::outputConflicts(){
- Debug("arith::conflict") << "outputting conflicts" << std::endl;
+ Trace("arith::conflict") << "outputting conflicts" << std::endl;
Assert(anyConflict());
if(!conflictQueueEmpty()){
bool hasProof = confConstraint->hasProof();
Assert(confConstraint->inConflict());
const ConstraintRule& pf = confConstraint->getConstraintRule();
- if (Debug.isOn("arith::conflict"))
+ if (TraceIsOn("arith::conflict"))
{
pf.print(std::cout, options().smt.produceProofs);
std::cout << std::endl;
}
- if (Debug.isOn("arith::pf::tree"))
+ if (TraceIsOn("arith::pf::tree"))
{
- Debug("arith::pf::tree") << "\n\nTree:\n";
- confConstraint->printProofTree(Debug("arith::pf::tree"));
- confConstraint->getNegation()->printProofTree(Debug("arith::pf::tree"));
+ Trace("arith::pf::tree") << "\n\nTree:\n";
+ confConstraint->printProofTree(Trace("arith::pf::tree"));
+ confConstraint->getNegation()->printProofTree(Trace("arith::pf::tree"));
}
TrustNode trustedConflict = confConstraint->externalExplainConflict();
Node conflict = trustedConflict.getNode();
- Debug("arith::conflict")
+ Trace("arith::conflict")
<< "d_conflicts[" << i << "] " << conflict
<< " has proof: " << hasProof << ", id = " << conf.second << endl;
- if(Debug.isOn("arith::normalize::external")){
+ if(TraceIsOn("arith::normalize::external")){
conflict = flattenAndSort(conflict);
- Debug("arith::conflict") << "(normalized to) " << conflict << endl;
+ Trace("arith::conflict") << "(normalized to) " << conflict << endl;
}
if (isProofEnabled())
}
if(!d_blackBoxConflict.get().isNull()){
Node bb = d_blackBoxConflict.get();
- Debug("arith::conflict") << "black box conflict" << bb
+ Trace("arith::conflict") << "black box conflict" << bb
<< endl;
- if(Debug.isOn("arith::normalize::external")){
+ if(TraceIsOn("arith::normalize::external")){
bb = flattenAndSort(bb);
- Debug("arith::conflict") << "(normalized to) " << bb << endl;
+ Trace("arith::conflict") << "(normalized to) " << bb << endl;
}
if (isProofEnabled() && d_blackBoxConflictPf.get())
{
bool TheoryArithPrivate::outputTrustedLemma(TrustNode lemma, InferenceId id)
{
- Debug("arith::channel") << "Arith trusted lemma: " << lemma << std::endl;
+ Trace("arith::channel") << "Arith trusted lemma: " << lemma << std::endl;
return d_containing.d_im.trustedLemma(lemma, id);
}
bool TheoryArithPrivate::outputLemma(TNode lem, InferenceId id) {
- Debug("arith::channel") << "Arith lemma: " << lem << std::endl;
+ Trace("arith::channel") << "Arith lemma: " << lem << std::endl;
return d_containing.d_im.lemma(lem, id);
}
void TheoryArithPrivate::outputTrustedConflict(TrustNode conf, InferenceId id)
{
- Debug("arith::channel") << "Arith trusted conflict: " << conf << std::endl;
+ Trace("arith::channel") << "Arith trusted conflict: " << conf << std::endl;
d_containing.d_im.trustedConflict(conf, id);
}
void TheoryArithPrivate::outputConflict(TNode lit, InferenceId id) {
- Debug("arith::channel") << "Arith conflict: " << lit << std::endl;
+ Trace("arith::channel") << "Arith conflict: " << lit << std::endl;
d_containing.d_im.conflict(lit, id);
}
void TheoryArithPrivate::outputPropagate(TNode lit) {
- Debug("arith::channel") << "Arith propagation: " << lit << std::endl;
+ Trace("arith::channel") << "Arith propagation: " << lit << std::endl;
// call the propagate lit method of the
d_containing.d_im.propagateLit(lit);
}
void TheoryArithPrivate::outputRestart() {
- Debug("arith::channel") << "Arith restart!" << std::endl;
+ Trace("arith::channel") << "Arith restart!" << std::endl;
(d_containing.d_out)->demandRestart();
}
bool TheoryArithPrivate::attemptSolveInteger(Theory::Effort effortLevel, bool emmmittedLemmaOrSplit){
int level = context()->getLevel();
- Debug("approx")
+ Trace("approx")
<< "attemptSolveInteger " << d_qflraStatus
<< " " << emmmittedLemmaOrSplit
<< " " << effortLevel
vec.pop_back();
ConstraintP neg_at_j = at_j->getNegation();
- Debug("approx::replayLog") << "Setting the proof for the replayLog conflict on:" << endl
+ Trace("approx::replayLog") << "Setting the proof for the replayLog conflict on:" << endl
<< " (" << neg_at_j->isTrue() <<") " << neg_at_j << endl
<< " (" << at_j->isTrue() <<") " << at_j << endl;
neg_at_j->impliedByIntHole(vec, true);
Node sum = toSumNode(d_partialModel, lhs);
if(sum.isNull()){ return make_pair(NullConstraint, added); }
- Debug("approx::constraint") << "replayGetConstraint " << sum
+ Trace("approx::constraint") << "replayGetConstraint " << sum
<< " " << k
<< " " << rhs
<< endl;
ConstraintType t = Constraint::constraintTypeOfComparison(cmp);
DeltaRational dr = cmp.normalizedDeltaRational();
- Debug("approx::constraint") << "rewriting " << rewritten << endl
+ Trace("approx::constraint") << "rewriting " << rewritten << endl
<< " |-> " << norm << " " << t << " " << dr << endl;
Assert(!branch || d_partialModel.hasArithVar(norm));
if(d_partialModel.hasArithVar(norm)){
v = d_partialModel.asArithVar(norm);
- Debug("approx::constraint")
+ Trace("approx::constraint")
<< "replayGetConstraint found " << norm << " |-> " << v << " @ "
<< context()->getLevel() << endl;
Assert(!branch || d_partialModel.isIntegerInput(v));
added = v;
- Debug("approx::constraint")
+ Trace("approx::constraint")
<< "replayGetConstraint adding " << norm << " |-> " << v << " @ "
<< context()->getLevel() << endl;
}
Node toSumNode(const ArithVariables& vars, const DenseMap<Rational>& sum){
- Debug("arith::toSumNode") << "toSumNode() begin" << endl;
+ Trace("arith::toSumNode") << "toSumNode() begin" << endl;
NodeManager* nm = NodeManager::currentNM();
DenseMap<Rational>::const_iterator iter, end;
iter = sum.begin(), end = sum.end();
Node xNode = vars.asNode(x);
const Rational& q = sum[x];
Node mult = nm->mkNode(kind::MULT, mkRationalNode(q), xNode);
- Debug("arith::toSumNode") << "toSumNode() " << x << " " << mult << endl;
+ Trace("arith::toSumNode") << "toSumNode() " << x << " " << mult << endl;
children.push_back(mult);
}
- Debug("arith::toSumNode") << "toSumNode() end" << endl;
+ Trace("arith::toSumNode") << "toSumNode() end" << endl;
if (children.empty())
{
// NOTE: real type assumed here
std::vector< ConstraintCPVec > conflicts;
approx->tryCut(nid, bci);
- Debug("approx::branch") << "tryBranchCut" << bci << endl;
+ Trace("approx::branch") << "tryBranchCut" << bci << endl;
Assert(bci.reconstructed());
Assert(!bci.proven());
pair<ConstraintP, ArithVar> p = replayGetConstraint(bci);
// Constraint::assertionFringe(back);
}
- if(Debug.isOn("approx::branch")){
+ if(TraceIsOn("approx::branch")){
if(d_conflicts.empty()){
entireStateIsConsistent("branchfailure");
}
}
}
- Debug("approx::branch") << "branch constraint " << bc << endl;
+ Trace("approx::branch") << "branch constraint " << bc << endl;
for(size_t i = 0, N = conflicts.size(); i < N; ++i){
ConstraintCPVec& conf = conflicts[i];
// make sure to be working on the assertion fringe!
if(!contains(conf, bcneg)){
- Debug("approx::branch") << "reraise " << conf << endl;
+ Trace("approx::branch") << "reraise " << conf << endl;
ConstraintCP conflicting = vectorToIntHoleConflict(conf);
raiseConflict(conflicting, InferenceId::ARITH_CONF_BRANCH_CUT);
}else if(!bci.proven()){
drop(conf, bcneg);
bci.setExplanation(conf);
- Debug("approx::branch") << "dropped " << bci << endl;
+ Trace("approx::branch") << "dropped " << bci << endl;
}
}
}
bool inConflict = c->negationHasProof();
if(!c->hasProof()){
c->setInternalAssumption(inConflict);
- Debug("approx::replayAssert") << "replayAssert " << c << " set internal" << endl;
+ Trace("approx::replayAssert") << "replayAssert " << c << " set internal" << endl;
}else{
- Debug("approx::replayAssert") << "replayAssert " << c << " has explanation" << endl;
+ Trace("approx::replayAssert") << "replayAssert " << c << " has explanation" << endl;
}
- Debug("approx::replayAssert") << "replayAssertion " << c << endl;
+ Trace("approx::replayAssert") << "replayAssertion " << c << endl;
if(inConflict){
raiseConflict(c, InferenceId::ARITH_CONF_REPLAY_ASSERT);
}else{
assertionCases(c);
}
}else{
- Debug("approx::replayAssert")
+ Trace("approx::replayAssert")
<< "replayAssert " << c << " already asserted" << endl;
}
}
void TheoryArithPrivate::resolveOutPropagated(std::vector<ConstraintCPVec>& confs, const std::set<ConstraintCP>& propagated) const {
- Debug("arith::resolveOutPropagated")
+ Trace("arith::resolveOutPropagated")
<< "starting resolveOutPropagated() " << confs.size() << endl;
for(size_t i =0, N = confs.size(); i < N; ++i){
ConstraintCPVec& conf = confs[i];
size_t orig = conf.size();
Constraint::assertionFringe(conf);
- Debug("arith::resolveOutPropagated")
+ Trace("arith::resolveOutPropagated")
<< " conf["<<i<<"] " << orig << " to " << conf.size() << endl;
}
- Debug("arith::resolveOutPropagated")
+ Trace("arith::resolveOutPropagated")
<< "ending resolveOutPropagated() " << confs.size() << endl;
}
}
}
}
- Debug("arith::subsumption") << "subsumed " << subsumed << "/" << checks
+ Trace("arith::subsumption") << "subsumed " << subsumed << "/" << checks
<< endl;
}
std::vector<ConstraintCPVec> TheoryArithPrivate::replayLogRec(ApproximateSimplex* approx, int nid, ConstraintP bc, int depth){
++(d_statistics.d_replayLogRecCount);
- Debug("approx::replayLogRec") << "replayLogRec()" << std::endl;
+ Trace("approx::replayLogRec") << "replayLogRec()" << std::endl;
size_t rpvars_size = d_replayVariables.size();
size_t rpcons_size = d_replayConstraints.size();
tl.mapRowId(nl.getNodeId(), ci->getRowId(), p.second);
}
ConstraintP con = p.first;
- if(Debug.isOn("approx::replayLogRec")){
- Debug("approx::replayLogRec") << "cut was remade " << con << " " << *ci << endl;
+ if(TraceIsOn("approx::replayLogRec")){
+ Trace("approx::replayLogRec") << "cut was remade " << con << " " << *ci << endl;
}
if(ci->proven()){
const ConstraintCPVec& exp = ci->getExplanation();
// success
if(con->isTrue()){
- Debug("approx::replayLogRec") << "not asserted?" << endl;
+ Trace("approx::replayLogRec") << "not asserted?" << endl;
}else if(!con->negationHasProof()){
con->impliedByIntHole(exp, false);
replayAssert(con);
- Debug("approx::replayLogRec") << "cut prop" << endl;
+ Trace("approx::replayLogRec") << "cut prop" << endl;
}else {
con->impliedByIntHole(exp, true);
- Debug("approx::replayLogRec") << "cut into conflict " << con << endl;
+ Trace("approx::replayLogRec") << "cut into conflict " << con << endl;
raiseConflict(con, InferenceId::ARITH_CONF_REPLAY_LOG_REC);
}
}else{
++d_statistics.d_cutsProofFailed;
- Debug("approx::replayLogRec") << "failed to get proof " << *ci << endl;
+ Trace("approx::replayLogRec") << "failed to get proof " << *ci << endl;
}
}else if(ci->getKlass() != RowsDeletedKlass){
++d_statistics.d_cutsReconstructionFailed;
}
}
}else{
- Debug("approx::replayLogRec") << "replayLogRec() skipping" << dnlog << std::endl;
+ Trace("approx::replayLogRec") << "replayLogRec() skipping" << dnlog << std::endl;
++d_statistics.d_replayBranchSkips;
}
}
}
}else{
- Debug("approx::replayLogRec") << "replayLogRec() skipping" << uplog << std::endl;
+ Trace("approx::replayLogRec") << "replayLogRec() skipping" << uplog << std::endl;
++d_statistics.d_replayBranchSkips;
}
}
}
}else{
- Debug("approx::replayLogRec") << "replayLogRec() skipping resolving" << nl << std::endl;
+ Trace("approx::replayLogRec") << "replayLogRec() skipping resolving" << nl << std::endl;
}
- Debug("approx::replayLogRec") << "found #"<<res.size()<<" conflicts on branch " << nid << endl;
+ Trace("approx::replayLogRec") << "found #"<<res.size()<<" conflicts on branch " << nid << endl;
if(res.empty()){
++d_statistics.d_replayBranchCloseFailures;
}
}else{
- Debug("approx::replayLogRec") << "failed to make a branch " << nid << endl;
+ Trace("approx::replayLogRec") << "failed to make a branch " << nid << endl;
}
}else{
++d_statistics.d_replayLeafCloseFailures;
- Debug("approx::replayLogRec") << "failed on node " << nid << endl;
+ Trace("approx::replayLogRec") << "failed on node " << nid << endl;
Assert(res.empty());
}
resolveOutPropagated(res, propagated);
- Debug("approx::replayLogRec") << "replayLogRec() ending" << std::endl;
+ Trace("approx::replayLogRec") << "replayLogRec() ending" << std::endl;
if (options().arith.replayFailureLemma)
{
d_tableau.removeBasicRow(v);
releaseArithVar(v);
- Debug("approx::vars") << "releasing " << v << endl;
+ Trace("approx::vars") << "releasing " << v << endl;
}
d_linEq.stopTrackingBoundCounts();
d_partialModel.startQueueingBoundCounts();
// DO NOT CALL OUTPUT LEMMA!
// TODO (project #37): justify
d_approxCuts.push_back(TrustNode::mkTrustLemma(implication, nullptr));
- Debug("approx::lemmas") << "cut["<<i<<"] " << implication << endl;
+ Trace("approx::lemmas") << "cut["<<i<<"] " << implication << endl;
++(d_statistics.d_mipExternalCuts);
}
}
d_approxCuts.push_back(TrustNode::mkTrustLemma(branch, nullptr));
}
++(d_statistics.d_mipExternalBranch);
- Debug("approx::lemmas") << "branching "<< root <<" as " << branch << endl;
+ Trace("approx::lemmas") << "branching "<< root <<" as " << branch << endl;
}
}
return anythingnew;
mipRes = approx->solveMIP(false);
}
- Debug("arith::solveInteger") << "mipRes " << mipRes << endl;
+ Trace("arith::solveInteger") << "mipRes " << mipRes << endl;
switch(mipRes) {
case MipBingo:
// attempt the solution
}
void TheoryArithPrivate::importSolution(const ApproximateSimplex::Solution& solution){
- if(Debug.isOn("arith::importSolution")){
- Debug("arith::importSolution") << "importSolution before " << d_qflraStatus << endl;
- d_partialModel.printEntireModel(Debug("arith::importSolution"));
+ if(TraceIsOn("arith::importSolution")){
+ Trace("arith::importSolution") << "importSolution before " << d_qflraStatus << endl;
+ d_partialModel.printEntireModel(Trace("arith::importSolution"));
}
d_qflraStatus = d_attemptSolSimplex.attempt(solution);
- if(Debug.isOn("arith::importSolution")){
- Debug("arith::importSolution") << "importSolution intermediate " << d_qflraStatus << endl;
- d_partialModel.printEntireModel(Debug("arith::importSolution"));
+ if(TraceIsOn("arith::importSolution")){
+ Trace("arith::importSolution") << "importSolution intermediate " << d_qflraStatus << endl;
+ d_partialModel.printEntireModel(Trace("arith::importSolution"));
}
if(d_qflraStatus != Result::UNSAT){
d_qflraStatus = simplex.findModel(false);
}
- if(Debug.isOn("arith::importSolution")){
- Debug("arith::importSolution") << "importSolution after " << d_qflraStatus << endl;
- d_partialModel.printEntireModel(Debug("arith::importSolution"));
+ if(TraceIsOn("arith::importSolution")){
+ Trace("arith::importSolution") << "importSolution after " << d_qflraStatus << endl;
+ d_partialModel.printEntireModel(Trace("arith::importSolution"));
}
}
bool useApprox = options().arith.useApprox && ApproximateSimplex::enabled()
&& getSolveIntegerResource();
- Debug("TheoryArithPrivate::solveRealRelaxation")
+ Trace("TheoryArithPrivate::solveRealRelaxation")
<< "solveRealRelaxation() approx"
<< " " << options().arith.useApprox << " "
<< ApproximateSimplex::enabled() << " " << useApprox << " "
bool noPivotLimitPass1 = noPivotLimit && !useApprox;
d_qflraStatus = simplex.findModel(noPivotLimitPass1);
- Debug("TheoryArithPrivate::solveRealRelaxation")
+ Trace("TheoryArithPrivate::solveRealRelaxation")
<< "solveRealRelaxation()" << " pass1 " << d_qflraStatus << endl;
if(d_qflraStatus == Result::SAT_UNKNOWN && useApprox && safeToCallApprox()){
TimerStat::CodeTimer codeTimer1(d_statistics.d_lpTimer);
relaxRes = approxSolver->solveRelaxation();
}
- Debug("solveRealRelaxation") << "solve relaxation? " << endl;
+ Trace("solveRealRelaxation") << "solve relaxation? " << endl;
switch(relaxRes){
case LinFeasible:
- Debug("solveRealRelaxation") << "lin feasible? " << endl;
+ Trace("solveRealRelaxation") << "lin feasible? " << endl;
++d_statistics.d_relaxLinFeas;
relaxSolution = approxSolver->extractRelaxation();
importSolution(relaxSolution);
case LinInfeasible:
// todo attempt to recreate approximate conflict
++d_statistics.d_relaxLinInfeas;
- Debug("solveRealRelaxation") << "lin infeasible " << endl;
+ Trace("solveRealRelaxation") << "lin infeasible " << endl;
relaxSolution = approxSolver->extractRelaxation();
importSolution(relaxSolution);
if(d_qflraStatus != Result::UNSAT){
break;
case LinExhausted:
++d_statistics.d_relaxLinExhausted;
- Debug("solveRealRelaxation") << "exhuasted " << endl;
+ Trace("solveRealRelaxation") << "exhuasted " << endl;
break;
case LinUnknown:
default:
bool TheoryArithPrivate::preCheck(Theory::Effort level)
{
Assert(d_currentPropagationList.empty());
- if(Debug.isOn("arith::consistency")){
+ if(TraceIsOn("arith::consistency")){
Assert(unenqueuedVariablesAreConsistent());
}
// we may attempt some constraints twice. this is okay!
ConstraintP curr = d_learnedBounds.front();
d_learnedBounds.pop();
- Debug("arith::learned") << curr << endl;
+ Trace("arith::learned") << curr << endl;
bool res CVC5_UNUSED = assertionCases(curr);
Assert(!res || anyConflict());
if (options().arith.revertArithModels && d_previousStatus == Result::SAT)
{
++d_statistics.d_revertsOnConflicts;
- Debug("arith::bt") << "clearing here "
+ Trace("arith::bt") << "clearing here "
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
revertOutOfConflict();
d_errorSet.clear();
}else{
++d_statistics.d_commitsOnConflicts;
- Debug("arith::bt") << "committing here "
+ Trace("arith::bt") << "committing here "
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
d_partialModel.commitAssignmentChanges();
}
- if(Debug.isOn("arith::print_assertions")) {
- debugPrintAssertions(Debug("arith::print_assertions"));
+ if(TraceIsOn("arith::print_assertions")) {
+ debugPrintAssertions(Trace("arith::print_assertions"));
}
bool emmittedConflictOrSplit = false;
Assert(d_conflicts.empty());
bool useSimplex = d_qflraStatus != Result::SAT;
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "pre realRelax" << endl;
if(useSimplex){
emmittedConflictOrSplit = solveRealRelaxation(effortLevel);
}
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "post realRelax" << endl;
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "pre solveInteger" << endl;
if(attemptSolveInteger(effortLevel, emmittedConflictOrSplit)){
solveInteger(effortLevel);
if(anyConflict()){
++d_statistics.d_commitsOnConflicts;
- Debug("arith::bt") << "committing here "
+ Trace("arith::bt") << "committing here "
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
revertOutOfConflict();
}
}
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "post solveInteger" << endl;
switch(d_qflraStatus){
++d_statistics.d_nontrivialSatChecks;
}
- Debug("arith::bt") << "committing sap inConflit"
+ Trace("arith::bt") << "committing sap inConflit"
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
d_partialModel.commitAssignmentChanges();
d_unknownsInARow = 0;
- if(Debug.isOn("arith::consistency")){
+ if(TraceIsOn("arith::consistency")){
Assert(entireStateIsConsistent("sat comit"));
}
if (useSimplex && options().arith.collectPivots)
++d_unknownsInARow;
++(d_statistics.d_unknownChecks);
Assert(!Theory::fullEffort(effortLevel));
- Debug("arith::bt") << "committing unknown"
+ Trace("arith::bt") << "committing unknown"
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
d_partialModel.commitAssignmentChanges();
++d_statistics.d_commitsOnConflicts;
- Debug("arith::bt") << "committing on conflict"
+ Trace("arith::bt") << "committing on conflict"
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
d_partialModel.commitAssignmentChanges();
revertOutOfConflict();
- if(Debug.isOn("arith::consistency::comitonconflict")){
+ if(TraceIsOn("arith::consistency::comitonconflict")){
entireStateIsConsistent("commit on conflict");
}
outputConflicts();
emmittedConflictOrSplit = true;
- Debug("arith::conflict") << "simplex conflict" << endl;
+ Trace("arith::conflict") << "simplex conflict" << endl;
if (useSimplex && options().arith.collectPivots)
{
Resource::ArithPivotStep);
}
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "pre approx cuts" << endl;
if(!d_approxCuts.empty()){
bool anyFresh = false;
while(!d_approxCuts.empty()){
TrustNode lem = d_approxCuts.front();
d_approxCuts.pop();
- Debug("arith::approx::cuts") << "approximate cut:" << lem << endl;
+ Trace("arith::approx::cuts") << "approximate cut:" << lem << endl;
anyFresh = anyFresh || hasFreshArithLiteral(lem.getNode());
- Debug("arith::lemma") << "approximate cut:" << lem << endl;
+ Trace("arith::lemma") << "approximate cut:" << lem << endl;
outputTrustedLemma(lem, InferenceId::ARITH_APPROX_CUT);
}
if(anyFresh){
}
}
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "post approx cuts" << endl;
// This should be fine if sat or unknown
}
if(anyConflict()){
- Debug("arith::unate") << "unate conflict" << endl;
+ Trace("arith::unate") << "unate conflict" << endl;
revertOutOfConflict();
d_qflraStatus = Result::UNSAT;
outputConflicts();
emmittedConflictOrSplit = true;
//cout << "unate conflict " << endl;
- Debug("arith::bt") << "committing on unate conflict"
+ Trace("arith::bt") << "committing on unate conflict"
<< " " << d_newFacts << " " << d_previousStatus << " "
<< d_qflraStatus << endl;
- Debug("arith::conflict") << "unate arith conflict" << endl;
+ Trace("arith::conflict") << "unate arith conflict" << endl;
}
}
else
}
Assert(d_currentPropagationList.empty());
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "post unate" << endl;
if(!emmittedConflictOrSplit && Theory::fullEffort(effortLevel)){
if(!emmittedConflictOrSplit && Theory::fullEffort(effortLevel)){
emmittedConflictOrSplit = splitDisequalities();
}
- Debug("arith::ems") << "ems: " << emmittedConflictOrSplit
+ Trace("arith::ems") << "ems: " << emmittedConflictOrSplit
<< "pos splitting" << endl;
- Debug("arith") << "integer? "
+ Trace("arith") << "integer? "
<< " conf/split " << emmittedConflictOrSplit
<< " fulleffort " << Theory::fullEffort(effortLevel) << endl;
possibleConflict = callDioSolver();
if(possibleConflict != Node::null()){
revertOutOfConflict();
- Debug("arith::conflict") << "dio conflict " << possibleConflict << endl;
+ Trace("arith::conflict") << "dio conflict " << possibleConflict << endl;
// TODO (project #37): justify (proofs in the DIO solver)
raiseBlackBoxConflict(possibleConflict);
outputConflicts();
if(!possibleLemma.isNull()){
d_hasDoneWorkSinceCut = false;
d_cutCount = d_cutCount + 1;
- Debug("arith::lemma") << "dio cut " << possibleLemma << endl;
+ Trace("arith::lemma") << "dio cut " << possibleLemma << endl;
if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_DIO_CUT))
{
emmittedConflictOrSplit = true;
{
++(d_statistics.d_externalBranchAndBounds);
d_cutCount = d_cutCount + 1;
- Debug("arith::lemma") << "rrbranch lemma"
+ Trace("arith::lemma") << "rrbranch lemma"
<< possibleLemma << endl;
if (outputTrustedLemma(possibleLemma, InferenceId::ARITH_BB_LEMMA))
{
if(d_diosolver.hasMoreDecompositionLemmas()){
while(d_diosolver.hasMoreDecompositionLemmas()){
Node decompositionLemma = d_diosolver.nextDecompositionLemma();
- Debug("arith::lemma") << "dio decomposition lemma "
+ Trace("arith::lemma") << "dio decomposition lemma "
<< decompositionLemma << endl;
outputLemma(decompositionLemma, InferenceId::ARITH_DIO_DECOMPOSITION);
}
}else{
- Debug("arith::restart") << "arith restart!" << endl;
+ Trace("arith::restart") << "arith restart!" << endl;
outputRestart();
}
}
}//if !emmittedConflictOrSplit && fullEffort(effortLevel) && !hasIntegerModel()
if(Theory::fullEffort(effortLevel)){
- if(Debug.isOn("arith::consistency::final")){
+ if(TraceIsOn("arith::consistency::final")){
entireStateIsConsistent("arith::consistency::final");
}
}
- if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
- if(Debug.isOn("arith::print_model")) {
- debugPrintModel(Debug("arith::print_model"));
+ if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
+ if(TraceIsOn("arith::print_model")) {
+ debugPrintModel(Trace("arith::print_model"));
}
- Debug("arith") << "TheoryArithPrivate::check end" << std::endl;
+ Trace("arith") << "TheoryArithPrivate::check end" << std::endl;
return emmittedConflictOrSplit;
}
Assert(!(r.getDenominator() == 1 && i.getNumerator() == 0));
TNode var = d_partialModel.asNode(x);
TrustNode lem = d_bab.branchIntegerVariable(var, r);
- if (Debug.isOn("integers"))
+ if (TraceIsOn("integers"))
{
Node l = lem.getNode();
if (isSatLiteral(l[0]))
{
- Debug("integers") << " " << l[0] << " == " << getSatValue(l[0])
+ Trace("integers") << " " << l[0] << " == " << getSatValue(l[0])
<< endl;
}
else
{
- Debug("integers") << " " << l[0] << " is not assigned a SAT literal"
+ Trace("integers") << " " << l[0] << " is not assigned a SAT literal"
<< endl;
}
if (isSatLiteral(l[1]))
{
- Debug("integers") << " " << l[1] << " == " << getSatValue(l[1])
+ Trace("integers") << " " << l[1] << " == " << getSatValue(l[1])
<< endl;
}
else
{
- Debug("integers") << " " << l[1] << " is not assigned a SAT literal"
+ Trace("integers") << " " << l[1] << " is not assigned a SAT literal"
<< endl;
}
}
d_diseqQueue.pop();
if(front->isSplit()){
- Debug("arith::eq") << "split already" << endl;
+ Trace("arith::eq") << "split already" << endl;
}else{
- Debug("arith::eq") << "not split already" << endl;
+ Trace("arith::eq") << "not split already" << endl;
ArithVar lhsVar = front->getVariable();
const DeltaRational& lhsValue = d_partialModel.getAssignment(lhsVar);
const DeltaRational& rhsValue = front->getValue();
if(lhsValue == rhsValue){
- Debug("arith::lemma") << "Splitting on " << front << endl;
- Debug("arith::lemma") << "LHS value = " << lhsValue << endl;
- Debug("arith::lemma") << "RHS value = " << rhsValue << endl;
+ Trace("arith::lemma") << "Splitting on " << front << endl;
+ Trace("arith::lemma") << "LHS value = " << lhsValue << endl;
+ Trace("arith::lemma") << "RHS value = " << rhsValue << endl;
TrustNode lemma = front->split();
++(d_statistics.d_statDisequalitySplits);
- Debug("arith::lemma") << "Now " << rewrite(lemma.getNode()) << endl;
+ Trace("arith::lemma") << "Now " << rewrite(lemma.getNode()) << endl;
outputTrustedLemma(lemma, InferenceId::ARITH_SPLIT_DEQ);
// cout << "Now " << rewrite(lemma) << endl;
splitSomething = true;
}else if(d_partialModel.strictlyLessThanLowerBound(lhsVar, rhsValue)){
- Debug("arith::eq") << "can drop as less than lb" << front << endl;
+ Trace("arith::eq") << "can drop as less than lb" << front << endl;
}else if(d_partialModel.strictlyGreaterThanUpperBound(lhsVar, rhsValue)){
- Debug("arith::eq") << "can drop as greater than ub" << front << endl;
+ Trace("arith::eq") << "can drop as greater than ub" << front << endl;
}else{
- Debug("arith::eq") << "save" << front << ": " <<lhsValue << " != " << rhsValue << endl;
+ Trace("arith::eq") << "save" << front << ": " <<lhsValue << " != " << rhsValue << endl;
save.push_back(front);
}
}
}
/**
- * Should be guarded by at least Debug.isOn("arith::print_assertions").
- * Prints to Debug("arith::print_assertions")
+ * Should be guarded by at least TraceIsOn("arith::print_assertions").
+ * Prints to Trace("arith::print_assertions")
*/
void TheoryArithPrivate::debugPrintAssertions(std::ostream& out) const {
out << "Assertions:" << endl;
TrustNode TheoryArithPrivate::explain(TNode n)
{
- Debug("arith::explain") << "explain @" << context()->getLevel() << ": " << n
+ Trace("arith::explain") << "explain @" << context()->getLevel() << ": " << n
<< endl;
ConstraintP c = d_constraintDatabase.lookup(n);
if(c != NullConstraint){
Assert(!c->isAssumption());
exp = c->externalExplainForPropagation(n);
- Debug("arith::explain") << "constraint explanation" << n << ":" << exp << endl;
+ Trace("arith::explain") << "constraint explanation" << n << ":" << exp << endl;
}else if(d_assertionsThatDoNotMatchTheirLiterals.find(n) != d_assertionsThatDoNotMatchTheirLiterals.end()){
c = d_assertionsThatDoNotMatchTheirLiterals[n];
if(!c->isAssumption()){
exp = c->externalExplainForPropagation(n);
- Debug("arith::explain") << "assertions explanation" << n << ":" << exp << endl;
+ Trace("arith::explain") << "assertions explanation" << n << ":" << exp << endl;
}else{
- Debug("arith::explain") << "this is a strange mismatch" << n << endl;
+ Trace("arith::explain") << "this is a strange mismatch" << n << endl;
Assert(d_congruenceManager.canExplain(n));
exp = d_congruenceManager.explain(n);
}
}else{
Assert(d_congruenceManager.canExplain(n));
- Debug("arith::explain") << "dm explanation" << n << endl;
+ Trace("arith::explain") << "dm explanation" << n << endl;
exp = d_congruenceManager.explain(n);
}
return exp;
while(d_constraintDatabase.hasMorePropagations()){
ConstraintCP c = d_constraintDatabase.nextPropagation();
- Debug("arith::prop") << "next prop" << context()->getLevel() << ": " << c
+ Trace("arith::prop") << "next prop" << context()->getLevel() << ": " << c
<< endl;
if(c->negationHasProof()){
- Debug("arith::prop") << "negation has proof " << c->getNegation() << endl;
- Debug("arith::prop") << c->getNegation()->externalExplainByAssertions()
+ Trace("arith::prop") << "negation has proof " << c->getNegation() << endl;
+ Trace("arith::prop") << c->getNegation()->externalExplainByAssertions()
<< endl;
}
Assert(!c->negationHasProof())
if(!c->assertedToTheTheory()){
Node literal = c->getLiteral();
- Debug("arith::prop") << "propagating @" << context()->getLevel() << " "
+ Trace("arith::prop") << "propagating @" << context()->getLevel() << " "
<< literal << endl;
outputPropagate(literal);
}else{
- Debug("arith::prop") << "already asserted to the theory " << c->getLiteral() << endl;
+ Trace("arith::prop") << "already asserted to the theory " << c->getLiteral() << endl;
}
}
ConstraintP constraint = d_constraintDatabase.lookup(normalized);
if(constraint == NullConstraint){
- Debug("arith::prop") << "propagating on non-constraint? " << toProp << endl;
+ Trace("arith::prop") << "propagating on non-constraint? " << toProp << endl;
outputPropagate(toProp);
}else if(constraint->negationHasProof()){
std::vector<Node> ants(exp.getNode().begin(), exp.getNode().end());
ants.push_back(notNormalized);
Node lp = nm->mkAnd(ants);
- Debug("arith::prop") << "propagate conflict" << lp << endl;
+ Trace("arith::prop") << "propagate conflict" << lp << endl;
if (proofsEnabled())
{
// Assume all of antecedents and ~toProp (rewritten)
outputConflicts();
return;
}else{
- Debug("arith::prop") << "propagating still?" << toProp << endl;
+ Trace("arith::prop") << "propagating still?" << toProp << endl;
outputPropagate(toProp);
}
}
DeltaRational TheoryArithPrivate::getDeltaValue(TNode term) const
{
AlwaysAssert(d_qflraStatus != Result::SAT_UNKNOWN);
- Debug("arith::value") << term << std::endl;
+ Trace("arith::value") << term << std::endl;
if (d_partialModel.hasArithVar(term)) {
ArithVar var = d_partialModel.asArithVar(term);
{
AlwaysAssert(d_qflraStatus == Result::SAT);
- if(Debug.isOn("arith::collectModelInfo")){
+ if(TraceIsOn("arith::collectModelInfo")){
debugPrintFacts();
}
- Debug("arith::collectModelInfo") << "collectModelInfo() begin " << endl;
+ Trace("arith::collectModelInfo") << "collectModelInfo() begin " << endl;
// Delta lasts at least the duration of the function call
const Rational& delta = d_partialModel.getDelta();
Rational qmodel = mod.substituteDelta(delta);
Node qNode = nm->mkConstRealOrInt(term.getType(), qmodel);
- Debug("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
+ Trace("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
// Add to the map
arithModel[term] = qNode;
}else{
- Debug("arith::collectModelInfo") << "Skipping m->assertEquality(" << term << ", true)" << endl;
+ Trace("arith::collectModelInfo") << "Skipping m->assertEquality(" << term << ", true)" << endl;
}
}
// const eq::EqualityEngine& ee = d_congruenceManager.getEqualityEngine();
// m->assertEqualityEngine(&ee);
- Debug("arith::collectModelInfo") << "collectModelInfo() end " << endl;
+ Trace("arith::collectModelInfo") << "collectModelInfo() end " << endl;
}
bool TheoryArithPrivate::safeToReset() const {
void TheoryArithPrivate::notifyRestart(){
TimerStat::CodeTimer codeTimer(d_statistics.d_restartTimer);
- if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
+ if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
++d_restartsCounter;
d_solveIntMaybeHelp = 0;
}
warning() << std::endl;
result = false;
- } else if(Debug.isOn("arith::consistency::initial")){
+ } else if(TraceIsOn("arith::consistency::initial")){
d_partialModel.printModel(var);
warning() << "Initial var is not consistent for " << var << d_partialModel.asNode(var);
if(d_tableau.isBasic(var)){
d_statistics.d_initialTableauSize = d_tableau.size();
- if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
+ if(TraceIsOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
- if(Debug.isOn("arith::presolve")) {
- Debug("arith::presolve") << "TheoryArithPrivate::presolve" << endl;
+ if(TraceIsOn("arith::presolve")) {
+ Trace("arith::presolve") << "TheoryArithPrivate::presolve" << endl;
}
vector<TrustNode> lemmas;
vector<TrustNode>::const_iterator i = lemmas.begin(), i_end = lemmas.end();
for(; i != i_end; ++i){
TrustNode lem = *i;
- Debug("arith::oldprop") << " lemma lemma duck " <<lem << endl;
+ Trace("arith::oldprop") << " lemma lemma duck " <<lem << endl;
outputTrustedLemma(lem, InferenceId::ARITH_UNATE);
}
}
bool canBePropagated = bestImplied->canBePropagated();
bool hasProof = bestImplied->hasProof();
- Debug("arith::prop") << "arith::prop" << basic
+ Trace("arith::prop") << "arith::prop" << basic
<< " " << assertedToTheTheory
<< " " << canBePropagated
<< " " << hasProof
d_linEq.propagateBasicFromRow(bestImplied, options().smt.produceProofs);
// I think this can be skipped if canBePropagated is true
//d_learnedBounds.push(bestImplied);
- if(Debug.isOn("arith::prop")){
- Debug("arith::prop") << "success " << bestImplied << endl;
- d_partialModel.printModel(basic, Debug("arith::prop"));
+ if(TraceIsOn("arith::prop")){
+ Trace("arith::prop") << "success " << bestImplied << endl;
+ d_partialModel.printModel(basic, Trace("arith::prop"));
}
return true;
}
- if(Debug.isOn("arith::prop")){
- Debug("arith::prop") << "failed " << basic
+ if(TraceIsOn("arith::prop")){
+ Trace("arith::prop") << "failed " << basic
<< " " << bound
<< " " << assertedToTheTheory
<< " " << canBePropagated
<< " " << hasProof << endl;
- d_partialModel.printModel(basic, Debug("arith::prop"));
+ d_partialModel.printModel(basic, Trace("arith::prop"));
}
}
- }else if(Debug.isOn("arith::prop")){
- Debug("arith::prop") << "false " << bound << " ";
- d_partialModel.printModel(basic, Debug("arith::prop"));
+ }else if(TraceIsOn("arith::prop")){
+ Trace("arith::prop") << "false " << bound << " ";
+ d_partialModel.printModel(basic, Trace("arith::prop"));
}
return false;
}
void TheoryArithPrivate::propagateCandidates(){
TimerStat::CodeTimer codeTimer(d_statistics.d_boundComputationTime);
- Debug("arith::prop") << "propagateCandidates begin" << endl;
+ Trace("arith::prop") << "propagateCandidates begin" << endl;
Assert(d_candidateBasics.empty());
Assert(d_tableau.isBasic(candidate));
propagateCandidate(candidate);
}
- Debug("arith::prop") << "propagateCandidates end" << endl << endl << endl;
+ Trace("arith::prop") << "propagateCandidates end" << endl << endl << endl;
}
void TheoryArithPrivate::propagateCandidatesNew(){
*/
TimerStat::CodeTimer codeTimer(d_statistics.d_boundComputationTime);
- Debug("arith::prop") << "propagateCandidatesNew begin" << endl;
+ Trace("arith::prop") << "propagateCandidatesNew begin" << endl;
Assert(d_qflraStatus == Result::SAT);
if(d_updatedBounds.empty()){ return; }
d_candidateRows.pop_back();
propagateCandidateRow(candidate);
}
- Debug("arith::prop") << "propagateCandidatesNew end" << endl << endl << endl;
+ Trace("arith::prop") << "propagateCandidatesNew end" << endl << endl << endl;
}
bool TheoryArithPrivate::propagateMightSucceed(ArithVar v, bool ub) const{
}
bool TheoryArithPrivate::attemptSingleton(RowIndex ridx, bool rowUp){
- Debug("arith::prop") << " attemptSingleton" << ridx;
+ Trace("arith::prop") << " attemptSingleton" << ridx;
const Tableau::Entry* ep;
ep = d_linEq.rowLacksBound(ridx, rowUp, ARITHVAR_SENTINEL);
// if c < 0, v \geq -D/c so !vUp
bool vUp = (rowUp == ( coeff.sgn() < 0));
- Debug("arith::prop") << " " << rowUp << " " << v << " " << coeff << " " << vUp << endl;
- Debug("arith::prop") << " " << propagateMightSucceed(v, vUp) << endl;
+ Trace("arith::prop") << " " << rowUp << " " << v << " " << coeff << " " << vUp << endl;
+ Trace("arith::prop") << " " << propagateMightSucceed(v, vUp) << endl;
if(propagateMightSucceed(v, vUp)){
DeltaRational dr = d_linEq.computeRowBound(ridx, rowUp, v);
}
bool TheoryArithPrivate::attemptFull(RowIndex ridx, bool rowUp){
- Debug("arith::prop") << " attemptFull" << ridx << endl;
+ Trace("arith::prop") << " attemptFull" << ridx << endl;
vector<const Tableau::Entry*> candidates;
bool canBePropagated = implied->canBePropagated();
bool hasProof = implied->hasProof();
- Debug("arith::prop") << "arith::prop" << v
+ Trace("arith::prop") << "arith::prop" << v
<< " " << assertedToTheTheory
<< " " << canBePropagated
<< " " << hasProof
d_linEq.propagateRow(explain, ridx, rowUp, implied, coeffs);
if (d_tableau.getRowLength(ridx) <= options().arith.arithPropAsLemmaLength)
{
- if (Debug.isOn("arith::prop::pf")) {
+ if (TraceIsOn("arith::prop::pf")) {
for (const auto & constraint : explain) {
Assert(constraint->hasProof());
- constraint->printProofTree(Debug("arith::prop::pf"));
+ constraint->printProofTree(Trace("arith::prop::pf"));
}
}
Node implication = implied->externalImplication(explain);
return true;
}
- if(Debug.isOn("arith::prop")){
- Debug("arith::prop")
+ if(TraceIsOn("arith::prop")){
+ Trace("arith::prop")
<< "failed " << v << " " << assertedToTheTheory << " "
<< canBePropagated << " " << hasProof << " " << implied << endl;
- d_partialModel.printModel(v, Debug("arith::prop"));
+ d_partialModel.printModel(v, Trace("arith::prop"));
}
return false;
}
bool success = false;
- Debug("arith::prop") << "propagateCandidateRow attempt " << rowLength << " "
+ Trace("arith::prop") << "propagateCandidateRow attempt " << rowLength << " "
<< hasCount << endl;
if (rowLength >= options().arith.arithPropagateMaxLength
// l k r
// diff : (l - r) k 0
- Debug("arith::entailCheck") << "TheoryArithPrivate::entailmentCheck(" << lit << ")"<< endl;
+ Trace("arith::entailCheck") << "TheoryArithPrivate::entailmentCheck(" << lit << ")"<< endl;
Kind k;
int primDir;
Rational lm, rm, dm;
for( alg = params.begin(), alg_end = params.end(); alg != alg_end; ++alg ){
const inferbounds::InferBoundAlgorithm& ibalg = *alg;
- Debug("arith::entailCheck") << "entailmentCheck trying " << (inferbounds::Algorithms) ibalg.getAlgorithm() << endl;
+ Trace("arith::entailCheck") << "entailmentCheck trying " << (inferbounds::Algorithms) ibalg.getAlgorithm() << endl;
switch(ibalg.getAlgorithm()){
case inferbounds::None:
break;
if(!bestPrimDiff.first.isNull()){
DeltaRational d = (bestPrimDiff.second * dm);
if((primDir > 0 && d <= sep) || (primDir < 0 && d >= sep) ){
- Debug("arith::entailCheck") << "entailmentCheck found "
+ Trace("arith::entailCheck") << "entailmentCheck found "
<< primDir << "*" << dm << "*(" << dp<<")"
<< " <= " << primDir << "*" << dm << "*" << bestPrimDiff.second
<< " <= " << primDir << "*" << sep << endl
dir = 1;
}
- Debug("arith::decomp") << "arith::decomp "
+ Trace("arith::decomp") << "arith::decomp "
<< lit << "(" << normKind << "*" << dir << ")"<< endl
<< " left:" << lc << " + " << lm << "*(" << lp << ") : " <<left << endl
<< " right:" << rc << " + " << rm << "*(" << rp << ") : " << right << endl
temp_indices->push_back(i);
}
}
- if(Trace.isOn("arrays-ind")) {
+ if(TraceIsOn("arrays-ind")) {
printList((*(info_map.find(a))).second->indices);
}
if(ita != info_map.end()) {
Trace("arrays-mergei")<<"Arrays::mergeInfo info "<<a<<"\n";
- if(Trace.isOn("arrays-mergei"))
+ if(TraceIsOn("arrays-mergei"))
(*ita).second->print();
if(itb != info_map.end()) {
Trace("arrays-mergei")<<"Arrays::mergeInfo info "<<b<<"\n";
- if(Trace.isOn("arrays-mergei"))
+ if(TraceIsOn("arrays-mergei"))
(*itb).second->print();
CTNodeList* lista_i = (*ita).second->indices;
bool TheoryArrays::propagateLit(TNode literal)
{
- Debug("arrays") << spaces(context()->getLevel())
+ Trace("arrays") << spaces(context()->getLevel())
<< "TheoryArrays::propagateLit(" << literal << ")"
<< std::endl;
// If already in conflict, no more propagation
if (d_state.isInConflict())
{
- Debug("arrays") << spaces(context()->getLevel())
+ Trace("arrays") << spaces(context()->getLevel())
<< "TheoryArrays::propagateLit(" << literal
<< "): already in conflict" << std::endl;
return false;
{
return;
}
- Debug("arrays") << spaces(context()->getLevel())
+ Trace("arrays") << spaces(context()->getLevel())
<< "TheoryArrays::preRegisterTerm(" << node << ")"
<< std::endl;
Kind nk = node.getKind();
void TheoryArrays::notifySharedTerm(TNode t)
{
- Debug("arrays::sharing") << spaces(context()->getLevel())
+ Trace("arrays::sharing") << spaces(context()->getLevel())
<< "TheoryArrays::notifySharedTerm(" << t << ")"
<< std::endl;
if (t.getType().isArray()) {
void TheoryArrays::checkPair(TNode r1, TNode r2)
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking reads " << r1 << " and " << r2 << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking reads " << r1 << " and " << r2 << std::endl;
TNode x = r1[1];
TNode y = r2[1];
&& (d_equalityEngine->areEqual(x, y)
|| d_equalityEngine->areDisequal(x, y, false)))
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): equality known, skipping" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): equality known, skipping" << std::endl;
return;
}
// If the terms are already known to be equal, we are also in good shape
if (d_equalityEngine->areEqual(r1, r2))
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): equal, skipping" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): equal, skipping" << std::endl;
return;
}
if (r1[0].getType() != r2[0].getType()
|| d_equalityEngine->areDisequal(r1[0], r2[0], false))
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): arrays can't be equal, skipping" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): arrays can't be equal, skipping" << std::endl;
return;
}
else if (!d_mayEqualEqualityEngine.areEqual(r1[0], r2[0])) {
if (!d_equalityEngine->isTriggerTerm(y, THEORY_ARRAYS))
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl;
return;
}
break;
case EQUALITY_TRUE:
// Missed propagation - need to add the pair so that theory engine can force propagation
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): missed propagation" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): missed propagation" << std::endl;
break;
case EQUALITY_FALSE_AND_PROPAGATED:
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair "
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair "
"called when false in model"
<< std::endl;
// Should have been propagated to us
case EQUALITY_FALSE: CVC5_FALLTHROUGH;
case EQUALITY_FALSE_IN_MODEL:
// This is unlikely, but I think it could happen
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair called when false in model" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checkPair called when false in model" << std::endl;
return;
default:
// Covers EQUALITY_TRUE_IN_MODEL (common case) and EQUALITY_UNKNOWN
}
// Add this pair
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): adding to care-graph" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): adding to care-graph" << std::endl;
addCarePair(x_shared, y_shared);
}
for (unsigned i = 0; i < size; ++ i) {
TNode r1 = d_reads[i];
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking read " << r1 << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): checking read " << r1 << std::endl;
Assert(d_equalityEngine->hasTerm(r1));
TNode x = r1[1];
if (!d_equalityEngine->isTriggerTerm(x, THEORY_ARRAYS))
{
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl;
+ Trace("arrays::sharing") << "TheoryArrays::computeCareGraph(): not connected to shared terms, skipping" << std::endl;
continue;
}
Node x_shared =
skolem = (*it).second;
}
- Debug("pf::array") << "Pregistering a Skolem" << std::endl;
+ Trace("pf::array") << "Pregistering a Skolem" << std::endl;
preRegisterTermInternal(skolem);
- Debug("pf::array") << "Pregistering a Skolem DONE" << std::endl;
+ Trace("pf::array") << "Pregistering a Skolem DONE" << std::endl;
- Debug("pf::array") << "getSkolem DONE" << std::endl;
+ Trace("pf::array") << "getSkolem DONE" << std::endl;
return skolem;
}
for (; i != readsEnd; ++i) {
const TNode& r = *i;
- Debug("arrays::weak") << "TheoryArrays::check(): checking read " << r << std::endl;
+ Trace("arrays::weak") << "TheoryArrays::check(): checking read " << r << std::endl;
// Find the bucket for this read.
mayRep = d_mayEqualEqualityEngine.getRepresentative(r[0]);
TNode k;
// k is the skolem for this disequality.
- Debug("pf::array") << "Check: kind::NOT: array theory making a skolem"
+ Trace("pf::array") << "Check: kind::NOT: array theory making a skolem"
<< std::endl;
// If not in replay mode, generate a fresh skolem variable
&& d_equalityEngine->hasTerm(bk))
{
// Propagate witness disequality - might produce a conflict
- Debug("pf::array") << "Asserting to the equality engine:" << std::endl
+ Trace("pf::array") << "Asserting to the equality engine:" << std::endl
<< "\teq = " << eq << std::endl
<< "\treason = " << fact << std::endl;
d_im.assertInference(eq, false, InferenceId::ARRAYS_EXT, fact, PfRule::ARRAYS_EXT);
}
else
{
- Debug("pf::array") << "Check: kind::NOT: array theory NOT making a skolem"
+ Trace("pf::array") << "Check: kind::NOT: array theory NOT making a skolem"
<< std::endl;
d_modelConstraints.push_back(fact);
}
Trace("arrays-cri")<<"Arrays::checkStore "<<a<<"\n";
- if(Trace.isOn("arrays-cri")) {
+ if(TraceIsOn("arrays-cri")) {
d_infoMap.getInfo(a)->print();
}
Assert(a.getType().isArray());
Trace("arrays-cri")<<"Arrays::checkRowForIndex "<<a<<"\n";
Trace("arrays-cri")<<" index "<<i<<"\n";
- if(Trace.isOn("arrays-cri")) {
+ if(TraceIsOn("arrays-cri")) {
d_infoMap.getInfo(a)->print();
}
Assert(a.getType().isArray());
if (options().arrays.arraysWeakEquivalence) return;
Trace("arrays-crl")<<"Arrays::checkLemmas begin \n"<<a<<"\n";
- if(Trace.isOn("arrays-crl"))
+ if(TraceIsOn("arrays-crl"))
d_infoMap.getInfo(a)->print();
Trace("arrays-crl")<<" ------------ and "<<b<<"\n";
- if(Trace.isOn("arrays-crl"))
+ if(TraceIsOn("arrays-crl"))
d_infoMap.getInfo(b)->print();
const CTNodeList* i_a = d_infoMap.getIndices(a);
void TheoryArrays::propagateRowLemma(RowLemmaType lem)
{
- Debug("pf::array") << "TheoryArrays: RowLemma Propagate called. "
+ Trace("pf::array") << "TheoryArrays: RowLemma Propagate called. "
"arraysPropagate = "
<< options().arrays.arraysPropagate << std::endl;
void TheoryArrays::queueRowLemma(RowLemmaType lem)
{
- Debug("pf::array") << "Array solver: queue row lemma called" << std::endl;
+ Trace("pf::array") << "Array solver: queue row lemma called" << std::endl;
if (d_state.isInConflict() || d_RowAlreadyAdded.contains(lem))
{
}
void TheoryArrays::conflict(TNode a, TNode b) {
- Debug("pf::array") << "TheoryArrays::Conflict called" << std::endl;
+ Trace("pf::array") << "TheoryArrays::Conflict called" << std::endl;
d_im.conflictEqConstantMerge(a, b);
}
bool eqNotifyTriggerPredicate(TNode predicate, bool value) override
{
- Debug("arrays::propagate")
+ Trace("arrays::propagate")
<< spaces(d_arrays.context()->getLevel())
<< "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", "
<< (value ? "true" : "false") << ")" << std::endl;
TNode t2,
bool value) override
{
- Debug("arrays::propagate")
+ Trace("arrays::propagate")
<< spaces(d_arrays.context()->getLevel())
<< "NotifyClass::eqNotifyTriggerTermEquality(" << t1 << ", " << t2
<< ", " << (value ? "true" : "false") << ")" << std::endl;
void eqNotifyConstantTermMerge(TNode t1, TNode t2) override
{
- Debug("arrays::propagate") << spaces(d_arrays.context()->getLevel())
+ Trace("arrays::propagate") << spaces(d_arrays.context()->getLevel())
<< "NotifyClass::eqNotifyConstantTermMerge("
<< t1 << ", " << t2 << ")" << std::endl;
d_arrays.conflict(t1, t2);
}
if (!valueType.isSubtypeOf(arrayType.getArrayConstituentType()))
{
- Debug("array-types")
+ Trace("array-types")
<< "array type: " << arrayType.getArrayConstituentType()
<< std::endl;
- Debug("array-types") << "value types: " << valueType << std::endl;
+ Trace("array-types") << "value types: " << valueType << std::endl;
throw TypeCheckingExceptionPrivate(
n, "array store not assigned with correct type for array");
}
void AtomRequests::add(TNode triggerAtom, TNode atomToSend, theory::TheoryId toTheory) {
- Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << ")" << std::endl;
+ Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << ")" << std::endl;
Request request(atomToSend, toTheory);
if (d_allRequests.find(request) != d_allRequests.end()) {
// Have it already
- Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): already there" << std::endl;
+ Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): already there" << std::endl;
return;
}
- Debug("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): adding" << std::endl;
+ Trace("theory::atoms") << "AtomRequests::add(" << triggerAtom << ", " << atomToSend << ", " << toTheory << "): adding" << std::endl;
/// Mark the new request
d_allRequests.insert(request);
// (2) unsuccessfully processed pending lemmas.
// In either case, we repeat the strategy if we are not in conflict.
sentLemma = d_im.hasSentLemma();
- if (Trace.isOn("bags-check"))
+ if (TraceIsOn("bags-check"))
{
Trace("bags-check") << " ...finish run strategy: ";
Trace("bags-check") << (hadPending ? "hadPending " : "");
void TheoryBags::presolve()
{
- Debug("bags-presolve") << "Started presolve" << std::endl;
+ Trace("bags-presolve") << "Started presolve" << std::endl;
d_strat.initializeStrategy();
- Debug("bags-presolve") << "Finished presolve" << std::endl;
+ Trace("bags-presolve") << "Finished presolve" << std::endl;
}
/**************************** eq::NotifyClass *****************************/
void TheoryBags::NotifyClass::eqNotifyNewClass(TNode n)
{
- Debug("bags-eq") << "[bags-eq] eqNotifyNewClass:"
+ Trace("bags-eq") << "[bags-eq] eqNotifyNewClass:"
<< " n = " << n << std::endl;
d_theory.eqNotifyNewClass(n);
}
void TheoryBags::NotifyClass::eqNotifyMerge(TNode n1, TNode n2)
{
- Debug("bags-eq") << "[bags-eq] eqNotifyMerge:"
+ Trace("bags-eq") << "[bags-eq] eqNotifyMerge:"
<< " n1 = " << n1 << " n2 = " << n2 << std::endl;
d_theory.eqNotifyMerge(n1, n2);
}
void TheoryBags::NotifyClass::eqNotifyDisequal(TNode n1, TNode n2, TNode reason)
{
- Debug("bags-eq") << "[bags-eq] eqNotifyDisequal:"
+ Trace("bags-eq") << "[bags-eq] eqNotifyDisequal:"
<< " n1 = " << n1 << " n2 = " << n2 << " reason = " << reason
<< std::endl;
d_theory.eqNotifyDisequal(n1, n2, reason);
void CircuitPropagator::computeBackEdges(TNode node)
{
- Debug("circuit-prop") << "CircuitPropagator::computeBackEdges(" << node << ")"
+ Trace("circuit-prop") << "CircuitPropagator::computeBackEdges(" << node << ")"
<< endl;
// Vector of nodes to visit
{
// Node we need to visit
TNode current = toVisit[i];
- Debug("circuit-prop")
+ Trace("circuit-prop")
<< "CircuitPropagator::computeBackEdges(): processing " << current
<< endl;
Assert(d_seen.find(current) != d_seen.end());
void CircuitPropagator::propagateBackward(TNode parent, bool parentAssignment)
{
- Debug("circuit-prop") << "CircuitPropagator::propagateBackward(" << parent
+ Trace("circuit-prop") << "CircuitPropagator::propagateBackward(" << parent
<< ", " << parentAssignment << ")" << endl;
ProofCircuitPropagatorBackward prover{d_pnm, parent, parentAssignment};
void CircuitPropagator::propagateForward(TNode child, bool childAssignment)
{
// The assignment we have
- Debug("circuit-prop") << "CircuitPropagator::propagateForward(" << child
+ Trace("circuit-prop") << "CircuitPropagator::propagateForward(" << child
<< ", " << childAssignment << ")" << endl;
// Get the back any nodes where this is child
{
// The current parent of the child
TNode parent = *parent_it;
- Debug("circuit-prop") << "Parent: " << parent << endl;
+ Trace("circuit-prop") << "Parent: " << parent << endl;
Assert(expr::hasSubterm(parent, child));
ProofCircuitPropagatorForward prover{d_pnm, child, childAssignment, parent};
TrustNode CircuitPropagator::propagate()
{
- Debug("circuit-prop") << "CircuitPropagator::propagate()" << std::endl;
+ Trace("circuit-prop") << "CircuitPropagator::propagate()" << std::endl;
for (unsigned i = 0;
i < d_propagationQueue.size() && d_conflict.get().isNull();
{
// The current node we are propagating
TNode current = d_propagationQueue[i];
- Debug("circuit-prop") << "CircuitPropagator::propagate(): processing "
+ Trace("circuit-prop") << "CircuitPropagator::propagate(): processing "
<< current << std::endl;
bool assignment = getAssignment(current);
- Debug("circuit-prop") << "CircuitPropagator::propagate(): assigned to "
+ Trace("circuit-prop") << "CircuitPropagator::propagate(): assigned to "
<< (assignment ? "true" : "false") << std::endl;
// Is this an atom
|| (current.getKind() == kind::EQUAL
&& (current[0].isVar() || current[1].isVar())))
{
- Debug("circuit-prop")
+ Trace("circuit-prop")
<< "CircuitPropagator::propagate(): adding to learned: "
<< (assignment ? (Node)current : current.notNode()) << std::endl;
Node lit = assignment ? Node(current) : current.notNode();
<< "\t" << *pf << std::endl;
d_epg->setProofFor(f, std::move(pf));
}
- else if (Trace.isOn("circuit-prop"))
+ else if (TraceIsOn("circuit-prop"))
{
auto prf = d_epg->getProofFor(f);
Trace("circuit-prop") << "Ignoring proof\n\t" << *pf
const std::vector<std::shared_ptr<ProofNode>>& children,
const std::vector<Node>& args)
{
- if (Trace.isOn("circuit-prop"))
+ if (TraceIsOn("circuit-prop"))
{
std::stringstream ss;
ss << "Constructing (" << rule;
}
if (!done) {
RewriteResponse ret = flattenNode(n, /* trivialNode = */ ff, /* skipNode = */ tt);
- Debug("bool-flatten") << n << ": " << ret.d_node << std::endl;
+ Trace("bool-flatten") << n << ": " << ret.d_node << std::endl;
return ret;
}
// x ^ ... ^ x --> x
if (n[0].isConst()) {
if (n[0] == tt) {
// ITE true x y
- Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==tt "
+ Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==tt "
<< n << ": " << n[1] << std::endl;
return RewriteResponse(REWRITE_AGAIN, n[1]);
} else {
Assert(n[0] == ff);
// ITE false x y
- Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==ff "
+ Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[0] ==ff "
<< n << ": " << n[1] << std::endl;
return RewriteResponse(REWRITE_AGAIN, n[2]);
}
} else if (n[1].isConst()) {
if (n[1] == tt && n[2] == ff) {
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite_ITE: n[1] ==tt && n[2] == ff "
<< n << ": " << n[0] << std::endl;
return RewriteResponse(REWRITE_AGAIN, n[0]);
}
else if (n[1] == ff && n[2] == tt) {
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite_ITE: n[1] ==ff && n[2] == tt "
<< n << ": " << n[0].notNode() << std::endl;
return RewriteResponse(REWRITE_AGAIN, makeNegation(n[0]));
int parityTmp;
if ((parityTmp = equalityParity(n[1], n[2])) != 0) {
Node resp = (parityTmp == 1) ? (Node)n[1] : n[0].eqNode(n[1]);
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[1], n[2] "
<< parityTmp << " " << n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
// if n[1] is constant this can loop, this is possible in prewrite
Node resp = n[0].iteNode( (parityTmp == 1) ? tt : ff, n[2]);
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[0], n[1] "
<< parityTmp << " " << n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
// (parityTmp == 1) if n[0] == n[2]
// otherwise, n[0] == not(n[2]) or not(n[0]) == n[2]
Node resp = n[0].iteNode(n[1], (parityTmp == 1) ? ff : tt);
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite_ITE: equalityParity n[0], n[2] "
<< parityTmp << " " << n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
// (parityTmp > 1) then n : (ite c (ite (not c) x y) z) or
// n: (ite (not c) (ite c x y) z)
Node resp = n[0].iteNode((parityTmp == 1) ? n[1][1] : n[1][2], n[2]);
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite: equalityParity n[0], n[1][0] "
<< parityTmp << " " << n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
// (parityTmp > 1) then n : (ite c x (ite (not c) y z)) or
// n: (ite (not c) x (ite c y z))
Node resp = n[0].iteNode(n[1], (parityTmp == 1) ? n[2][2] : n[2][1]);
- Debug("bool-ite")
+ Trace("bool-ite")
<< "TheoryBoolRewriter::preRewrite: equalityParity n[0], n[2][0] "
<< parityTmp << " " << n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
// ITE C false y --> ~C ^ y
Node resp =
n[1] == tt ? n[0].orNode(n[2]) : (n[0].negate()).andNode(n[2]);
- Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] const "
+ Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[1] const "
<< n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
}
// ITE C x false --> C ^ x
Node resp =
n[2] == tt ? (n[0].negate()).orNode(n[1]) : n[0].andNode(n[1]);
- Debug("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[2] const "
+ Trace("bool-ite") << "TheoryBoolRewriter::preRewrite_ITE: n[2] const "
<< n << ": " << resp << std::endl;
return RewriteResponse(REWRITE_AGAIN, resp);
}
{
if (!child.getType(check).isBoolean())
{
- Debug("pb") << "failed type checking: " << child << std::endl;
- Debug("pb") << " integer: " << child.getType(check).isInteger()
+ Trace("pb") << "failed type checking: " << child << std::endl;
+ Trace("pb") << " integer: " << child.getType(check).isInteger()
<< std::endl;
- Debug("pb") << " real: " << child.getType(check).isReal() << std::endl;
+ Trace("pb") << " real: " << child.getType(check).isReal() << std::endl;
throw TypeCheckingExceptionPrivate(n,
"expecting a Boolean subexpression");
}
template <class T>
T UndefinedAtomBBStrategy(TNode node, TBitblaster<T>* bb) {
- Debug("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: "
+ Trace("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: "
<< node.getKind() << "\n";
Unreachable();
}
template <class T>
T DefaultEqBB(TNode node, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::EQUAL);
std::vector<T> lhs, rhs;
template <class T>
T AdderUltBB(TNode node, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULT);
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
T DefaultUltBB(TNode node, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULT);
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
T DefaultUleBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULE);
std::vector<T> a, b;
template <class T>
T DefaultUgtBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
template <class T>
T DefaultUgeBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
template <class T>
T DefaultSltBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
T DefaultSleBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
T DefaultSgtBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
template <class T>
T DefaultSgeBB(TNode node, TBitblaster<T>* bb){
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
*/
template <class T>
void UndefinedTermBBStrategy(TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: "
+ Trace("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: "
<< node.getKind() << "\n";
Unreachable();
}
Assert(bits.size() == 0);
bb->makeVariable(node, bits);
- if(Debug.isOn("bitvector-bb")) {
- Debug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
- Debug("bitvector-bb") << " with bits " << toString(bits);
+ if(TraceIsOn("bitvector-bb")) {
+ Trace("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << " with bits " << toString(bits);
}
}
template <class T>
void DefaultConstBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::CONST_BITVECTOR);
Assert(bits.size() == 0);
bits.push_back(mkTrue<T>());
}
}
- if(Debug.isOn("bitvector-bb")) {
- Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ if(TraceIsOn("bitvector-bb")) {
+ Trace("bitvector-bb") << "with bits: " << toString(bits) << "\n";
}
}
template <class T>
void DefaultNotBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_NOT);
Assert(bits.size() == 0);
std::vector<T> bv;
template <class T>
void DefaultConcatBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n";
Assert(bits.size() == 0);
Assert(node.getKind() == kind::BITVECTOR_CONCAT);
}
}
Assert(bits.size() == utils::getSize(node));
- if(Debug.isOn("bitvector-bb")) {
- Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ if(TraceIsOn("bitvector-bb")) {
+ Trace("bitvector-bb") << "with bits: " << toString(bits) << "\n";
}
}
template <class T>
void DefaultAndBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_AND && bits.size() == 0);
template <class T>
void DefaultOrBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_OR && bits.size() == 0);
template <class T>
void DefaultXorBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_XOR && bits.size() == 0);
template <class T>
void DefaultXnorBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n";
Assert(node.getNumChildren() == 2 && node.getKind() == kind::BITVECTOR_XNOR
&& bits.size() == 0);
template <class T>
void DefaultNandBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
template <class T>
void DefaultNorBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
template <class T>
void DefaultCompBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n";
+ Trace("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n";
Assert(utils::getSize(node) == 1 && bits.size() == 0
&& node.getKind() == kind::BITVECTOR_COMP);
template <class T>
void DefaultMultBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n";
+ Trace("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n";
Assert(res.size() == 0 && node.getKind() == kind::BITVECTOR_MULT);
// if (node.getNumChildren() == 2) {
shiftAddMultiplier(res, current, newres);
res = newres;
}
- if(Debug.isOn("bitvector-bb")) {
- Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ if(TraceIsOn("bitvector-bb")) {
+ Trace("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
template <class T>
void DefaultAddBB(TNode node, std::vector<T>& res, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultAddBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultAddBB bitblasting " << node
<< "\n";
Assert(node.getKind() == kind::BITVECTOR_ADD && res.size() == 0);
template <class T>
void DefaultSubBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_SUB && node.getNumChildren() == 2
&& bits.size() == 0);
template <class T>
void DefaultNegBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_NEG);
std::vector<T> a;
std::vector<T>& rem,
TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node
<< "\n";
Assert(quot.empty());
Assert(rem.empty());
template <class T>
void DefaultUdivBB(TNode node, std::vector<T>& quot, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node
<< "\n";
Assert(quot.empty());
Assert(node.getKind() == kind::BITVECTOR_UDIV);
template <class T>
void DefaultUremBB(TNode node, std::vector<T>& rem, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node
<< "\n";
Assert(rem.empty());
Assert(node.getKind() == kind::BITVECTOR_UREM);
template <class T>
void DefaultSdivBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
template <class T>
void DefaultSremBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
template <class T>
void DefaultSmodBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
template <class T>
void DefaultShlBB(TNode node, std::vector<T>& res, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node
<< "\n";
Assert(node.getKind() == kind::BITVECTOR_SHL && res.size() == 0);
std::vector<T> a, b;
res[i] = mkIte(b_ult_a_size, prev_res[i], mkFalse<T>());
}
- if (Debug.isOn("bitvector-bb"))
+ if (TraceIsOn("bitvector-bb"))
{
- Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Trace("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
template <class T>
void DefaultLshrBB(TNode node, std::vector<T>& res, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node
<< "\n";
Assert(node.getKind() == kind::BITVECTOR_LSHR && res.size() == 0);
std::vector<T> a, b;
res[i] = mkIte(b_ult_a_size, prev_res[i], mkFalse<T>());
}
- if (Debug.isOn("bitvector-bb"))
+ if (TraceIsOn("bitvector-bb"))
{
- Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Trace("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
template <class T>
void DefaultAshrBB(TNode node, std::vector<T>& res, TBitblaster<T>* bb)
{
- Debug("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node
+ Trace("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node
<< "\n";
Assert(node.getKind() == kind::BITVECTOR_ASHR && res.size() == 0);
std::vector<T> a, b;
res[i] = mkIte(b_ult_a_size, prev_res[i], sign_bit);
}
- if (Debug.isOn("bitvector-bb"))
+ if (TraceIsOn("bitvector-bb"))
{
- Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Trace("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
template <class T>
void DefaultUltbvBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULTBV);
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
void DefaultSltbvBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_SLTBV);
std::vector<T> a, b;
bb->bbTerm(node[0], a);
template <class T>
void DefaultIteBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Trace("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ITE);
std::vector<T> cond, thenpart, elsepart;
bb->bbTerm(node[0], cond);
}
Assert(bits.size() == high - low + 1);
- if(Debug.isOn("bitvector-bb")) {
- Debug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
- Debug("bitvector-bb") << " with bits " << toString(bits);
+ if(TraceIsOn("bitvector-bb")) {
+ Trace("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << " with bits " << toString(bits);
}
}
template <class T>
void DefaultRepeatBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
// this should be rewritten
Unimplemented();
template <class T>
void DefaultZeroExtendBB (TNode node, std::vector<T>& res_bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n";
// this should be rewritten
Unimplemented();
template <class T>
void DefaultSignExtendBB (TNode node, std::vector<T>& res_bits, TBitblaster<T>* bb) {
- Debug("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n";
+ Trace("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_SIGN_EXTEND && res_bits.size() == 0);
template <class T>
void DefaultRotateRightBB (TNode node, std::vector<T>& res, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
template <class T>
void DefaultRotateLeftBB (TNode node, std::vector<T>& bits, TBitblaster<T>* bb) {
- Debug("bitvector") << "theory::bv:: Unimplemented kind "
+ Trace("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
for (const prop::SatLiteral& lit : unsat_assumptions)
{
conf.push_back(d_literalFactCache[lit]);
- Debug("bv-bitblast")
+ Trace("bv-bitblast")
<< "unsat assumption (" << lit << "): " << conf.back() << std::endl;
}
conflict = nm->mkAnd(conf);
TrustNode BVSolverBitblast::explain(TNode n)
{
- Debug("bv-bitblast") << "explain called on " << n << std::endl;
+ Trace("bv-bitblast") << "explain called on " << n << std::endl;
return d_im.explainLit(n);
}
TrustNode BVSolverBitblastInternal::explain(TNode n)
{
- Debug("bv-bitblast-internal") << "explain called on " << n << std::endl;
+ Trace("bv-bitblast-internal") << "explain called on " << n << std::endl;
return d_im.explainLit(n);
}
return texp;
}
- Debug("theory-bv-pp-rewrite") << "ppRewrite " << t << "\n";
+ Trace("theory-bv-pp-rewrite") << "ppRewrite " << t << "\n";
Node res = t;
if (options().bv.bitwiseEq && RewriteRule<BitwiseEq>::applies(t))
{
}
}
- Debug("theory-bv-pp-rewrite") << "to " << res << "\n";
+ Trace("theory-bv-pp-rewrite") << "to " << res << "\n";
if (res != t)
{
return TrustNode::mkTrustRewrite(t, res, nullptr);
if (value_a == value_b)
{
- Debug("theory-bv") << EQUALITY_TRUE_IN_MODEL << std::endl;
+ Trace("theory-bv") << EQUALITY_TRUE_IN_MODEL << std::endl;
return EQUALITY_TRUE_IN_MODEL;
}
- Debug("theory-bv") << EQUALITY_FALSE_IN_MODEL << std::endl;
+ Trace("theory-bv") << EQUALITY_FALSE_IN_MODEL << std::endl;
return EQUALITY_FALSE_IN_MODEL;
}
return status;
{
if (!checkApplies || applies(node))
{
- Debug("theory::bv::rewrite")
+ Trace("theory::bv::rewrite")
<< "RewriteRule<" << rule << ">(" << node << ")" << std::endl;
Assert(checkApplies || applies(node));
Node result = apply(node);
- Debug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node
+ Trace("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node
<< ") => " << result << std::endl;
return result;
}
template<> inline
Node RewriteRule<EmptyRule>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EmptyRule> for " << node.getKind() <<"\n";
+ Trace("bv-rewrite") << "RewriteRule<EmptyRule> for " << node.getKind() <<"\n";
Unreachable();
return node;
}
template<> inline
Node RewriteRule<EvalAnd>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<EvalAnd>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalAnd>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a & b;
template<> inline
Node RewriteRule<EvalOr>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<EvalOr>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalOr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a | b;
template<> inline
Node RewriteRule<EvalXor>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<EvalXor>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalXor>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a ^ b;
// template<> inline
// Node RewriteRule<EvalXnor>::apply(TNode node) {
-// Debug("bv-rewrite") << "RewriteRule<EvalXnor>(" << node << ")" << std::endl;
+// Trace("bv-rewrite") << "RewriteRule<EvalXnor>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res = ~ (a ^ b);
template<> inline
Node RewriteRule<EvalNot>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalNot>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalNot>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector res = ~ a;
return utils::mkConst(res);
// template<> inline
// Node RewriteRule<EvalComp>::apply(TNode node) {
-// Debug("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
+// Trace("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res;
template<> inline
Node RewriteRule<EvalMult>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalMult>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalMult>(" << node << ")" << std::endl;
TNode::iterator child_it = node.begin();
BitVector res = (*child_it).getConst<BitVector>();
for(++child_it; child_it != node.end(); ++child_it) {
template <>
inline Node RewriteRule<EvalAdd>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<EvalAdd>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalAdd>(" << node << ")" << std::endl;
TNode::iterator child_it = node.begin();
BitVector res = (*child_it).getConst<BitVector>();
for(++child_it; child_it != node.end(); ++child_it) {
// template<> inline
// Node RewriteRule<EvalSub>::apply(TNode node) {
-// Debug("bv-rewrite") << "RewriteRule<EvalSub>(" << node << ")" << std::endl;
+// Trace("bv-rewrite") << "RewriteRule<EvalSub>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res = a - b;
template<> inline
Node RewriteRule<EvalNeg>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalNeg>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalNeg>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector res = - a;
template<> inline
Node RewriteRule<EvalUdiv>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalUdiv>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalUdiv>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a.unsignedDivTotal(b);
template<> inline
Node RewriteRule<EvalUrem>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalUrem>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalUrem>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a.unsignedRemTotal(b);
template<> inline
Node RewriteRule<EvalShl>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalShl>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalShl>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalLshr>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalLshr>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalLshr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalAshr>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalAshr>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalAshr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalUlt>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalUlt>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalUlt>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalUltBv>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalUltBv>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalUltBv>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalSlt>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalSlt>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalSlt>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalSltBv>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalSltBv>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalSltBv>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
bool RewriteRule<EvalITEBv>::applies(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalITEBv>::applies(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalITEBv>::applies(" << node << ")" << std::endl;
return (node.getKind() == kind::BITVECTOR_ITE &&
utils::isBvConstTerm(node));
}
template<> inline
Node RewriteRule<EvalITEBv>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalITEBv>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalITEBv>(" << node << ")" << std::endl;
BitVector cond = node[0].getConst<BitVector>();
if (node[0] == utils::mkConst(1, 1)) {
template<> inline
Node RewriteRule<EvalUle>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalUle>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalUle>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalSle>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalSle>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalSle>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalExtract>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalExtract>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalExtract>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
unsigned lo = utils::getExtractLow(node);
unsigned hi = utils::getExtractHigh(node);
template<> inline
Node RewriteRule<EvalConcat>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalConcat>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalConcat>(" << node << ")" << std::endl;
unsigned num = node.getNumChildren();
BitVector res = node[0].getConst<BitVector>();
for(unsigned i = 1; i < num; ++i ) {
template<> inline
Node RewriteRule<EvalSignExtend>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalSignExtend>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalSignExtend>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
unsigned amount =
node.getOperator().getConst<BitVectorSignExtend>().d_signExtendAmount;
template<> inline
Node RewriteRule<EvalEquals>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalEquals>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalEquals>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
if (a == b) {
template<> inline
Node RewriteRule<EvalComp>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
if (a == b) {
template <>
inline Node RewriteRule<EvalEagerAtom>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
return node[0];
}
}
template<> inline
Node RewriteRule<ConcatFlatten>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << node << ")" << std::endl;
NodeBuilder result(kind::BITVECTOR_CONCAT);
std::vector<Node> processing_stack;
processing_stack.push_back(node);
}
}
Node resultNode = result;
- Debug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << resultNode << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << resultNode << ")" << std::endl;
return resultNode;
}
template<> inline
Node RewriteRule<ConcatExtractMerge>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ConcatExtractMerge>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ConcatExtractMerge>(" << node << ")" << std::endl;
std::vector<Node> mergedExtracts;
template<> inline
Node RewriteRule<ConcatConstantMerge>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ")" << std::endl;
std::vector<Node> mergedConstants;
for (unsigned i = 0, end = node.getNumChildren(); i < end;) {
}
}
- Debug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl;
return utils::mkConcat(mergedConstants);
}
template<> inline
Node RewriteRule<ExtractWhole>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ExtractWhole>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractWhole>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<ExtractConstant>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ExtractConstant>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractConstant>(" << node << ")" << std::endl;
Node child = node[0];
BitVector childValue = child.getConst<BitVector>();
return utils::mkConst(childValue.extract(utils::getExtractHigh(node), utils::getExtractLow(node)));
template<> inline
bool RewriteRule<ExtractConcat>::applies(TNode node) {
- //Debug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
+ //Trace("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
if (node.getKind() != kind::BITVECTOR_EXTRACT) return false;
if (node[0].getKind() != kind::BITVECTOR_CONCAT) return false;
return true;
template<> inline
Node RewriteRule<ExtractConcat>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
int extract_high = utils::getExtractHigh(node);
int extract_low = utils::getExtractLow(node);
template<> inline
Node RewriteRule<ExtractExtract>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ExtractExtract>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractExtract>(" << node << ")" << std::endl;
// x[i:j][k:l] ~> x[k+j:l+j]
uint32_t j = 0;
template<> inline
bool RewriteRule<FailEq>::applies(TNode node) {
- //Debug("bv-rewrite") << "RewriteRule<FailEq>(" << node << ")" << std::endl;
+ //Trace("bv-rewrite") << "RewriteRule<FailEq>(" << node << ")" << std::endl;
if (node.getKind() != kind::EQUAL) return false;
if (node[0].getKind() != kind::CONST_BITVECTOR) return false;
if (node[1].getKind() != kind::CONST_BITVECTOR) return false;
template<> inline
Node RewriteRule<SimplifyEq>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<SimplifyEq>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<SimplifyEq>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<ReflexivityEq>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ReflexivityEq>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ReflexivityEq>(" << node << ")" << std::endl;
Node res = node[1].eqNode(node[0]);
return res;
}
template<> inline
Node RewriteRule<ExtractBitwise>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ExtractBitwise>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractBitwise>(" << node << ")" << std::endl;
unsigned high = utils::getExtractHigh(node);
unsigned low = utils::getExtractLow(node);
std::vector<Node> children;
template <>
inline Node RewriteRule<ExtractNot>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ExtractNot>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ExtractNot>(" << node << ")" << std::endl;
unsigned low = utils::getExtractLow(node);
unsigned high = utils::getExtractHigh(node);
Node a = utils::mkExtract(node[0][0], high, low);
template <>
inline Node RewriteRule<ExtractSignExtend>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ExtractSignExtend>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<ExtractSignExtend>(" << node << ")"
<< std::endl;
TNode extendee = node[0][0];
unsigned extendee_size = utils::getSize(extendee);
}
resultNode = utils::mkConcat(bits);
}
- Debug("bv-rewrite") << " =>" << resultNode
+ Trace("bv-rewrite") << " =>" << resultNode
<< std::endl;
return resultNode;
}
template <>
inline Node RewriteRule<ExtractArith>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ExtractArith>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<ExtractArith>(" << node << ")"
<< std::endl;
unsigned low = utils::getExtractLow(node);
Assert(low == 0);
template <>
inline Node RewriteRule<ExtractArith2>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ExtractArith2>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<ExtractArith2>(" << node << ")"
<< std::endl;
unsigned low = utils::getExtractLow(node);
unsigned high = utils::getExtractHigh(node);
template <>
inline Node RewriteRule<FlattenAssocCommut>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")"
<< std::endl;
std::vector<Node> processingStack;
processingStack.push_back(node);
template <>
inline Node RewriteRule<AddCombineLikeTerms>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<AddCombineLikeTerms>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<AddCombineLikeTerms>(" << node << ")"
<< std::endl;
unsigned size = utils::getSize(node);
BitVector constSum(size, (unsigned)0);
template <>
inline Node RewriteRule<MultSimplify>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<MultSimplify>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<MultSimplify>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
unsigned size = utils::getSize(node);
template <>
inline Node RewriteRule<MultDistribConst>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<MultDistribConst>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<MultDistribConst>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
template <>
inline Node RewriteRule<MultDistrib>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<MultDistrib>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<MultDistrib>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
template <>
inline Node RewriteRule<ConcatToMult>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ConcatToMult>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<ConcatToMult>(" << node << ")"
<< std::endl;
unsigned size = utils::getSize(node);
Node factor = node[0][0];
template <>
inline Node RewriteRule<SolveEq>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SolveEq>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<SolveEq>(" << node << ")" << std::endl;
TNode left = node[0];
TNode right = node[1];
template<> inline
Node RewriteRule<BitwiseEq>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<BitwiseEq>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BitwiseEq>(" << node << ")" << std::endl;
TNode term;
BitVector c;
template<> inline
Node RewriteRule<NegMult>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<NegMult>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NegMult>(" << node << ")" << std::endl;
TNode mult = node[0];
NodeBuilder nb(kind::BITVECTOR_MULT);
BitVector bv(utils::getSize(node), (unsigned)1);
template <>
inline Node RewriteRule<NegSub>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NegSub>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NegSub>(" << node << ")" << std::endl;
return NodeManager::currentNM()->mkNode(
kind::BITVECTOR_SUB, node[0][1], node[0][0]);
}
template <>
inline Node RewriteRule<NegAdd>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NegAdd>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NegAdd>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
std::vector<Node> children;
for (unsigned i = 0; i < node[0].getNumChildren(); ++i)
template <>
inline Node RewriteRule<AndSimplify>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
template<> inline
Node RewriteRule<FlattenAssocCommutNoDuplicates>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")" << std::endl;
std::vector<Node> processingStack;
processingStack.push_back(node);
std::unordered_set<TNode> processed;
template <>
inline Node RewriteRule<OrSimplify>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<OrSimplify>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<OrSimplify>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
// this will remove duplicates
template <>
inline Node RewriteRule<XorSimplify>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<XorSimplify>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<XorSimplify>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
template <>
inline Node RewriteRule<BitwiseSlicing>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BitwiseSlicing>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BitwiseSlicing>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
// get the constant
}
}
Node result = utils::mkConcat(concat_children);
- Debug("bv-rewrite") << " =>" << result << std::endl;
+ Trace("bv-rewrite") << " =>" << result << std::endl;
return result;
}
template <>
inline Node RewriteRule<NormalizeEqAddNeg>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NormalizeEqAddNeg>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<NormalizeEqAddNeg>(" << node << ")"
<< std::endl;
NodeBuilder nb_lhs(kind::BITVECTOR_ADD);
// template<> inline
// Node RewriteRule<>::apply(TNode node) {
-// Debug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
+// Trace("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
// return resultNode;
// }
template <>
inline Node RewriteRule<UgtEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UgtEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<UgtEliminate>(" << node << ")"
<< std::endl;
TNode a = node[0];
TNode b = node[1];
template <>
inline Node RewriteRule<UgeEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UgeEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<UgeEliminate>(" << node << ")"
<< std::endl;
TNode a = node[0];
TNode b = node[1];
template <>
inline Node RewriteRule<SgtEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SgtEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SgtEliminate>(" << node << ")"
<< std::endl;
TNode a = node[0];
TNode b = node[1];
template <>
inline Node RewriteRule<SgeEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SgeEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SgeEliminate>(" << node << ")"
<< std::endl;
TNode a = node[0];
TNode b = node[1];
template <>
inline Node RewriteRule<SltEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SltEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SltEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
unsigned size = utils::getSize(node[0]);
template <>
inline Node RewriteRule<SleEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SleEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SleEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<UleEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UleEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<UleEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<CompEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<CompEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<CompEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
Node comp = nm->mkNode(kind::EQUAL, node[0], node[1]);
template <>
inline Node RewriteRule<SubEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SubEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SubEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
Node negb = nm->mkNode(kind::BITVECTOR_NEG, node[1]);
template <>
inline Node RewriteRule<RepeatEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<RepeatEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<RepeatEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount =
node.getOperator().getConst<BitVectorRepeat>().d_repeatAmount;
template <>
inline Node RewriteRule<RotateLeftEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<RotateLeftEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<RotateLeftEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount =
node.getOperator().getConst<BitVectorRotateLeft>().d_rotateLeftAmount;
template <>
inline Node RewriteRule<RotateRightEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<RotateRightEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<RotateRightEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount =
node.getOperator().getConst<BitVectorRotateRight>().d_rotateRightAmount;
template <>
inline Node RewriteRule<BVToNatEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BVToNatEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BVToNatEliminate>(" << node << ")" << std::endl;
//if( node[0].isConst() ){
//TODO? direct computation instead of term construction+rewriting
template <>
inline Node RewriteRule<IntToBVEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<IntToBVEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<IntToBVEliminate>(" << node << ")" << std::endl;
//if( node[0].isConst() ){
//TODO? direct computation instead of term construction+rewriting
template <>
inline Node RewriteRule<NandEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NandEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<NandEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<NorEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NorEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<NorEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<XnorEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<XnorEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<XnorEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<SdivEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SdivEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SdivEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
template <>
inline Node RewriteRule<SdivEliminateFewerBitwiseOps>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SdivEliminateFewerBitwiseOps>(" << node
+ Trace("bv-rewrite") << "RewriteRule<SdivEliminateFewerBitwiseOps>(" << node
<< ")" << std::endl;
NodeManager* nm = NodeManager::currentNM();
template <>
inline Node RewriteRule<SremEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SremEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SremEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<SremEliminateFewerBitwiseOps>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SremEliminateFewerBitwiseOps>(" << node
+ Trace("bv-rewrite") << "RewriteRule<SremEliminateFewerBitwiseOps>(" << node
<< ")" << std::endl;
NodeManager* nm = NodeManager::currentNM();
TNode a = node[0];
template <>
inline Node RewriteRule<SmodEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")"
<< std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode s = node[0];
template <>
inline Node RewriteRule<SmodEliminateFewerBitwiseOps>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")"
<< std::endl;
NodeManager* nm = NodeManager::currentNM();
TNode s = node[0];
template <>
inline Node RewriteRule<ZeroExtendEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ZeroExtendEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ZeroExtendEliminate>(" << node << ")" << std::endl;
TNode bv = node[0];
unsigned amount =
template <>
inline Node RewriteRule<SignExtendEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<SignExtendEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<SignExtendEliminate>(" << node << ")" << std::endl;
unsigned amount =
node.getOperator().getConst<BitVectorSignExtend>().d_signExtendAmount;
template <>
inline Node RewriteRule<RedorEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<RedorEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<RedorEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned size = utils::getSize(node[0]);
Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, utils::mkConst( size, 0 ) );
template <>
inline Node RewriteRule<RedandEliminate>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<RedandEliminate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<RedandEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned size = utils::getSize(node[0]);
Node result = NodeManager::currentNM()->mkNode(kind::EQUAL, a, utils::mkOnes( size ) );
template <>
inline Node RewriteRule<BvIteConstCond>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteConstCond>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteConstCond>(" << node << ")"
<< std::endl;
return utils::isZero(node[0]) ? node[2] : node[1];
}
template <>
inline Node RewriteRule<BvIteEqualChildren>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteEqualChildren>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteEqualChildren>(" << node << ")"
<< std::endl;
return node[1];
}
template <>
inline Node RewriteRule<BvIteConstChildren>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteConstChildren>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteConstChildren>(" << node << ")"
<< std::endl;
if (utils::isOne(node[1]) && utils::isZero(node[2]))
{
template <>
inline Node RewriteRule<BvIteEqualCond>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteEqualCond>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteEqualCond>(" << node << ")"
<< std::endl;
Node t0 = node[1].getKind() == kind::BITVECTOR_ITE && node[0] == node[1][0]
? node[1][1]
template <>
inline Node RewriteRule<BvIteMergeThenIf>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteMergeThenIf>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteMergeThenIf>(" << node << ")"
<< std::endl;
NodeManager* nm = NodeManager::currentNM();
Assert(node[1].getKind() == kind::BITVECTOR_ITE);
template <>
inline Node RewriteRule<BvIteMergeElseIf>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteMergeElseIf>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteMergeElseIf>(" << node << ")"
<< std::endl;
NodeManager* nm = NodeManager::currentNM();
Assert(node[1].getKind() == kind::BITVECTOR_ITE);
template <>
inline Node RewriteRule<BvIteMergeThenElse>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteMergeThenElse>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteMergeThenElse>(" << node << ")"
<< std::endl;
NodeManager* nm = NodeManager::currentNM();
Assert(node[2].getKind() == kind::BITVECTOR_ITE);
template <>
inline Node RewriteRule<BvIteMergeElseElse>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvIteMergeElseElse>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<BvIteMergeElseElse>(" << node << ")"
<< std::endl;
NodeManager* nm = NodeManager::currentNM();
Assert(node[2].getKind() == kind::BITVECTOR_ITE);
template <>
inline Node RewriteRule<BvComp>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BvComp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BvComp>(" << node << ")" << std::endl;
NodeManager* nm = NodeManager::currentNM();
if (node[0].isConst())
{
template<> inline
Node RewriteRule<ShlByConst>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ShlByConst>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ShlByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
if (amount == 0) {
return node[0];
template<> inline
Node RewriteRule<LshrByConst>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<LshrByConst>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<LshrByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
if (amount == 0) {
return node[0];
template<> inline
Node RewriteRule<AshrByConst>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<AshrByConst>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<AshrByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
if (amount == 0) {
return node[0];
template<> inline
Node RewriteRule<BitwiseIdemp>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<BitwiseIdemp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BitwiseIdemp>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<AndZero>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<AndZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<AndZero>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<AndOne>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<AndOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<AndOne>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
if (node[0] == utils::mkOnes(size)) {
template <>
inline Node RewriteRule<AndOrXorConcatPullUp>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<AndOrXorConcatPullUp>(" << node << ")"
+ Trace("bv-rewrite") << "RewriteRule<AndOrXorConcatPullUp>(" << node << ")"
<< std::endl;
uint32_t m, my, mz;
size_t nc;
template<> inline
Node RewriteRule<OrZero>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<OrZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<OrZero>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
if (node[0] == utils::mkConst(size, 0)) {
template<> inline
Node RewriteRule<OrOne>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<OrOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<OrOne>(" << node << ")" << std::endl;
return utils::mkOnes(utils::getSize(node));
}
template<> inline
Node RewriteRule<XorDuplicate>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<XorDuplicate>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<XorDuplicate>(" << node << ")" << std::endl;
return utils::mkZero(utils::getSize(node));
}
template <>
inline Node RewriteRule<XorOne>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<XorOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<XorOne>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
Node ones = utils::mkOnes(utils::getSize(node));
std::vector<Node> children;
template <>
inline Node RewriteRule<XorZero>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<XorZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<XorZero>(" << node << ")" << std::endl;
std::vector<Node> children;
Node zero = utils::mkConst(utils::getSize(node), 0);
template<> inline
Node RewriteRule<BitwiseNotAnd>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<BitwiseNegAnd>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BitwiseNegAnd>(" << node << ")" << std::endl;
return utils::mkZero(utils::getSize(node));
}
template<> inline
Node RewriteRule<BitwiseNotOr>::apply(TNode node) {
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<BitwiseNotOr>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BitwiseNotOr>(" << node << ")" << std::endl;
uint32_t size = utils::getSize(node);
return utils::mkOnes(size);
}
inline Node RewriteRule<XorNot>::apply(TNode node)
{
Unreachable();
- Debug("bv-rewrite") << "RewriteRule<XorNot>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<XorNot>(" << node << ")" << std::endl;
Node a = node[0][0];
Node b = node[1][0];
return NodeManager::currentNM()->mkNode(kind::BITVECTOR_XOR, a, b);
template <>
inline Node RewriteRule<NotXor>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NotXor>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NotXor>(" << node << ")" << std::endl;
std::vector<Node> children;
TNode::iterator child_it = node[0].begin();
children.push_back(
template<> inline
Node RewriteRule<NotIdemp>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<NotIdemp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NotIdemp>(" << node << ")" << std::endl;
TNode ret = node[0][0];
while (ret.getKind() == kind::BITVECTOR_NOT
&& ret[0].getKind() == kind::BITVECTOR_NOT)
template<> inline
Node RewriteRule<LtSelf>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<LtSelf>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<LtSelf>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template<> inline
Node RewriteRule<LteSelf>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<LteSelf>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<LteSelf>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template <>
inline Node RewriteRule<ZeroUlt>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<ZeroUlt>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ZeroUlt>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
return nm->mkNode(kind::NOT, nm->mkNode(kind::EQUAL, node[0], node[1]));
}
template<> inline
Node RewriteRule<UltZero>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template <>
inline Node RewriteRule<UltOne>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UltOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UltOne>(" << node << ")" << std::endl;
return NodeManager::currentNM()->mkNode(
kind::EQUAL, node[0], utils::mkZero(utils::getSize(node[0])));
}
template <>
inline Node RewriteRule<SltZero>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node[0]);
Node most_significant_bit = utils::mkExtract(node[0], size - 1, size - 1);
return NodeManager::currentNM()->mkNode(
template<> inline
Node RewriteRule<UltSelf>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UltSelf>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UltSelf>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template <>
inline Node RewriteRule<UleZero>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UleZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UleZero>(" << node << ")" << std::endl;
return NodeManager::currentNM()->mkNode(kind::EQUAL, node[0], node[1]);
}
template<> inline
Node RewriteRule<UleSelf>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UleSelf>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UleSelf>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<ZeroUle>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ZeroUle>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ZeroUle>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<UleMax>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UleMax>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UleMax>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template <>
inline Node RewriteRule<NotUlt>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NotUlt>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NotUlt>(" << node << ")" << std::endl;
Node ult = node[0];
Node a = ult[0];
Node b = ult[1];
template <>
inline Node RewriteRule<NotUle>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<NotUle>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NotUle>(" << node << ")" << std::endl;
Node ult = node[0];
Node a = ult[0];
Node b = ult[1];
template <>
inline Node RewriteRule<MultPow2>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<MultPow2>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<MultPow2>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
unsigned size = utils::getSize(node);
std::vector<Node> children;
template<> inline
Node RewriteRule<ExtractMultLeadingBit>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<MultLeadingBit>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<MultLeadingBit>(" << node << ")" << std::endl;
unsigned bitwidth = utils::getSize(node);
template<> inline
Node RewriteRule<NegIdemp>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<NegIdemp>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<NegIdemp>(" << node << ")" << std::endl;
return node[0][0];
}
template <>
inline Node RewriteRule<UdivPow2>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UdivPow2>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UdivPow2>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
unsigned size = utils::getSize(node);
Node a = node[0];
template <>
inline Node RewriteRule<UdivZero>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UdivZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UdivZero>(" << node << ")" << std::endl;
return utils::mkOnes(utils::getSize(node));
}
template <>
inline Node RewriteRule<UdivOne>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UdivOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UdivOne>(" << node << ")" << std::endl;
return node[0];
}
template <>
inline Node RewriteRule<UremPow2>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UremPow2>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UremPow2>(" << node << ")" << std::endl;
TNode a = node[0];
bool isNeg = false;
unsigned power = utils::isPow2Const(node[1], isNeg) - 1;
template<> inline
Node RewriteRule<UremOne>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UremOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UremOne>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<UremSelf>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<UremSelf>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UremSelf>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<ShiftZero>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<ShiftZero>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<ShiftZero>(" << node << ")" << std::endl;
return node[0];
}
template <>
inline Node RewriteRule<UgtUrem>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UgtUrem>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UgtUrem>(" << node << ")" << std::endl;
const Node& T = node[0][0];
const Node& x = node[1];
Node zero = utils::mkConst(utils::getSize(x), 0);
template <>
inline Node RewriteRule<BBAddNeg>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<BBAddNeg>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<BBAddNeg>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
std::vector<Node> children;
unsigned neg_count = 0;
template<> inline
Node RewriteRule<MergeSignExtend>::apply(TNode node) {
- Debug("bv-rewrite") << "RewriteRule<MergeSignExtend>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<MergeSignExtend>(" << node << ")" << std::endl;
unsigned amount1 =
node.getOperator().getConst<BitVectorSignExtend>().d_signExtendAmount;
template <>
inline Node RewriteRule<MultSlice>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<MultSlice>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<MultSlice>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
unsigned bitwidth = utils::getSize(node[0]);
Node zeros = utils::mkConst(bitwidth / 2, 0);
template <>
inline Node RewriteRule<UltAddOne>::apply(TNode node)
{
- Debug("bv-rewrite") << "RewriteRule<UltAddOne>(" << node << ")" << std::endl;
+ Trace("bv-rewrite") << "RewriteRule<UltAddOne>(" << node << ")" << std::endl;
NodeManager *nm = NodeManager::currentNM();
TNode x = node[0];
TNode y1 = node[1];
RewriteResponse res = d_rewriteTable[node.getKind()](node, true);
if (res.d_node != node)
{
- Debug("bitvector-rewrite") << "TheoryBV::preRewrite " << node << std::endl;
- Debug("bitvector-rewrite")
+ Trace("bitvector-rewrite") << "TheoryBV::preRewrite " << node << std::endl;
+ Trace("bitvector-rewrite")
<< "TheoryBV::preRewrite to " << res.d_node << std::endl;
}
return res;
RewriteResponse res = d_rewriteTable[node.getKind()](node, false);
if (res.d_node != node)
{
- Debug("bitvector-rewrite") << "TheoryBV::postRewrite " << node << std::endl;
- Debug("bitvector-rewrite")
+ Trace("bitvector-rewrite") << "TheoryBV::postRewrite " << node << std::endl;
+ Trace("bitvector-rewrite")
<< "TheoryBV::postRewrite to " << res.d_node << std::endl;
}
return res;
TrustNode TheoryBVRewriter::expandDefinition(Node node)
{
- Debug("bitvector-expandDefinition")
+ Trace("bitvector-expandDefinition")
<< "TheoryBV::expandDefinition(" << node << ")" << std::endl;
Node ret;
switch (node.getKind())
}
RewriteResponse TheoryBVRewriter::UndefinedRewrite(TNode node, bool prerewrite) {
- Debug("bv-rewrite") << "TheoryBV::UndefinedRewrite for" << node;
+ Trace("bv-rewrite") << "TheoryBV::UndefinedRewrite for" << node;
Unimplemented();
}
prop::PropEngine* propEngine = d_te.getPropEngine();
for (const CarePair& carePair : careGraph)
{
- Debug("combineTheories")
+ Trace("combineTheories")
<< "TheoryEngine::combineTheories(): checking " << carePair.d_a << " = "
<< carePair.d_b << " from " << carePair.d_theory << std::endl;
Node equality = carePair.d_a.eqNode(carePair.d_b);
// We need to split on it
- Debug("combineTheories")
+ Trace("combineTheories")
<< "TheoryEngine::combineTheories(): requesting a split " << std::endl;
TrustNode tsplit;
std::vector<TypeNode> datatypeTypes = nm->mkMutualDatatypeTypes(
datatypes, unres, NodeManager::DATATYPE_FLAG_PLACEHOLDER);
TypeNode sdtS = datatypeTypes[0];
- if (Trace.isOn("dtsygus-gen-debug"))
+ if (TraceIsOn("dtsygus-gen-debug"))
{
Trace("dtsygus-gen-debug") << "Made datatype types:" << std::endl;
for (unsigned j = 0, ndts = datatypeTypes.size(); j < ndts; j++)
d_currTermSize[a].set( d_currTermSize[a].get() + ( lb_add - lb_rem ) );
}
if( (unsigned)d_currTermSize[a].get()>ssz ){
- if( Trace.isOn("sygus-sb-fair") ){
+ if( TraceIsOn("sygus-sb-fair") ){
std::map< TypeNode, int > var_count;
Node templ = getCurrentTemplate( a, var_count );
Trace("sygus-sb-fair") << "FAIRNESS : we have " << d_currTermSize[a].get() << " at search size " << ssz << ", template is " << templ << std::endl;
Assert(scasv.find(bvr_equiv) != scasv.end());
Trace("sygus-sb-debug")
<< "......search value was " << scasv[bvr_equiv] << std::endl;
- if( Trace.isOn("sygus-sb-exc") ){
+ if( TraceIsOn("sygus-sb-exc") ){
Node prev = d_tds->sygusToBuiltin(scasv[bvr_equiv], tn);
Trace("sygus-sb-exc") << " ......programs " << prev << " and " << bv << " are equivalent up to examples." << std::endl;
}
else
{
bad_val_bvr = bvr;
- if( Trace.isOn("sygus-sb-exc") ){
+ if( TraceIsOn("sygus-sb-exc") ){
Node prev_bv = d_tds->sygusToBuiltin( itsv->second, tn );
Trace("sygus-sb-exc") << " ......programs " << prev_bv << " and " << bv << " rewrite to " << bvr << "." << std::endl;
}
scasvs[bad_val_bvr] = sz;
bad_val = scasv[bad_val_bvr];
bad_val_o = nv;
- if (Trace.isOn("sygus-sb-exc"))
+ if (TraceIsOn("sygus-sb-exc"))
{
Trace("sygus-sb-exc") << "Flip : exclude ";
quantifiers::TermDbSygus::toStreamSygus("sygus-sb-exc", bad_val);
}
sz = prev_sz;
}
- if( Trace.isOn("sygus-sb-exc") ){
+ if( TraceIsOn("sygus-sb-exc") ){
Node bad_val_bv = d_tds->sygusToBuiltin( bad_val, tn );
Trace("sygus-sb-exc") << " ........exclude : " << bad_val_bv;
if( by_examples ){
<< std::endl;
Assert(prog.getType().isDatatype());
Node progv = d_state.getValuation().getModel()->getValue(prog);
- if (Trace.isOn("dt-sygus"))
+ if (TraceIsOn("dt-sygus"))
{
Trace("dt-sygus") << "* DT model : " << prog << " -> ";
std::stringstream ss;
return check();
}
- if (Trace.isOn("sygus-engine") && !d_szinfo.empty())
+ if (TraceIsOn("sygus-engine") && !d_szinfo.empty())
{
if (d_im.hasSentLemma())
{
return true;
}
NodeManager* nm = NodeManager::currentNM();
- if (Trace.isOn("sygus-sb-check-value"))
+ if (TraceIsOn("sygus-sb-check-value"))
{
Node prog_sz = nm->mkNode(DT_SIZE, n);
Node prog_szv = d_state.getValuation().getModel()->getValue(prog_sz);
}
Trace("datatypes-check") << "Finished check effort " << level << std::endl;
- Debug("datatypes") << "TheoryDatatypes::check(): done" << std::endl;
+ Trace("datatypes") << "TheoryDatatypes::check(): done" << std::endl;
}
bool TheoryDatatypes::needsCheckLastEffort() {
TrustNode TheoryDatatypes::ppRewrite(TNode in, std::vector<SkolemLemma>& lems)
{
- Debug("tuprec") << "TheoryDatatypes::ppRewrite(" << in << ")" << endl;
+ Trace("tuprec") << "TheoryDatatypes::ppRewrite(" << in << ")" << endl;
// first, see if we need to expand definitions
TrustNode texp = d_rewriter.expandDefinition(in);
if (!texp.isNull())
unsigned ttindex, Node t, EqcInfo* eqc, Node n, Node t_arg)
{
Trace("datatypes-debug") << "Add tester : " << t << " to eqc(" << n << ")" << std::endl;
- Debug("datatypes-labels") << "Add tester " << t << " " << n << " " << eqc << std::endl;
+ Trace("datatypes-labels") << "Add tester " << t << " " << n << " " << eqc << std::endl;
bool tpolarity = t.getKind()!=NOT;
Assert((tpolarity ? t : t[0]).getKind() == APPLY_TESTER);
Node j, jt;
}
}
if( !makeConflict ){
- Debug("datatypes-labels") << "Add to labels " << t << std::endl;
+ Trace("datatypes-labels") << "Add to labels " << t << std::endl;
d_labels[n] = n_lbl + 1;
if (n_lbl < d_labels_data[n].size())
{
n_lbl++;
const DType& dt = t_arg.getType().getDType();
- Debug("datatypes-labels") << "Labels at " << n_lbl << " / " << dt.getNumConstructors() << std::endl;
+ Trace("datatypes-labels") << "Labels at " << n_lbl << " / " << dt.getNumConstructors() << std::endl;
if( tpolarity ){
instantiate(eqc, n);
// We could propagate is-C1(x) => not is-C2(x) here for all other
}
}
if( makeConflict ){
- Debug("datatypes-labels") << "Explain " << j << " " << t << std::endl;
+ Trace("datatypes-labels") << "Explain " << j << " " << t << std::endl;
std::vector<Node> conf;
conf.push_back(j);
conf.push_back(t);
Kind nk = n.getKind();
if (nk == APPLY_CONSTRUCTOR)
{
- Debug("datatypes") << " Found constructor " << n << endl;
+ Trace("datatypes") << " Found constructor " << n << endl;
if (n.getNumChildren() > 0)
{
d_functionTerms.push_back(n);
// it may be a new term, so we collect terms and add it to the equality engine
collectTerms( n_ic );
d_equalityEngine->addTerm(n_ic);
- Debug("dt-enum") << "Made instantiate cons " << n_ic << std::endl;
+ Trace("dt-enum") << "Made instantiate cons " << n_ic << std::endl;
return n_ic;
}
}
void TheoryDatatypes::printModelDebug( const char* c ){
- if(! (Trace.isOn(c))) {
+ if(! (TraceIsOn(c))) {
return;
}
}
void eqNotifyNewClass(TNode t) override
{
- Debug("dt") << "NotifyClass::eqNotifyNewClass(" << t << ")" << std::endl;
+ Trace("dt") << "NotifyClass::eqNotifyNewClass(" << t << ")" << std::endl;
d_dt.eqNotifyNewClass(t);
}
void eqNotifyMerge(TNode t1, TNode t2) override
{
- Debug("dt") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << ")"
+ Trace("dt") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2 << ")"
<< std::endl;
d_dt.eqNotifyMerge(t1, t2);
}
}
if (t.isParametricDatatype())
{
- Debug("typecheck-idt") << "typecheck parameterized datatype " << n
+ Trace("typecheck-idt") << "typecheck parameterized datatype " << n
<< std::endl;
TypeMatcher m(t);
for (; child_it != child_it_end; ++child_it, ++tchild_it)
std::vector<TypeNode> instTypes;
m.getMatches(instTypes);
TypeNode range = t.instantiateParametricDatatype(instTypes);
- Debug("typecheck-idt") << "Return " << range << std::endl;
+ Trace("typecheck-idt") << "Return " << range << std::endl;
return range;
}
else
{
if (check)
{
- Debug("typecheck-idt")
+ Trace("typecheck-idt")
<< "typecheck cons: " << n << " " << n.getNumChildren() << std::endl;
- Debug("typecheck-idt") << "cons type: " << consType << " "
+ Trace("typecheck-idt") << "cons type: " << consType << " "
<< consType.getNumChildren() << std::endl;
for (; child_it != child_it_end; ++child_it, ++tchild_it)
{
TypeNode childType = (*child_it).getType(check);
- Debug("typecheck-idt") << "typecheck cons arg: " << childType << " "
+ Trace("typecheck-idt") << "typecheck cons arg: " << childType << " "
<< (*tchild_it) << std::endl;
TypeNode argumentType = *tchild_it;
if (!childType.isSubtypeOf(argumentType))
}
if (t.isParametricDatatype())
{
- Debug("typecheck-idt") << "typecheck parameterized sel: " << n << std::endl;
+ Trace("typecheck-idt") << "typecheck parameterized sel: " << n << std::endl;
TypeMatcher m(t);
TypeNode childType = n[0].getType(check);
if (!childType.isInstantiatedDatatype())
TypeNode range = selType[1];
range = range.substitute(
types.begin(), types.end(), matches.begin(), matches.end());
- Debug("typecheck-idt") << "Return " << range << std::endl;
+ Trace("typecheck-idt") << "Return " << range << std::endl;
return range;
}
else
{
if (check)
{
- Debug("typecheck-idt") << "typecheck sel: " << n << std::endl;
- Debug("typecheck-idt") << "sel type: " << selType << std::endl;
+ Trace("typecheck-idt") << "typecheck sel: " << n << std::endl;
+ Trace("typecheck-idt") << "sel type: " << selType << std::endl;
TypeNode childType = n[0].getType(check);
if (!selType[0].isComparableTo(childType))
{
- Debug("typecheck-idt") << "ERROR: " << selType[0].getKind() << " "
+ Trace("typecheck-idt") << "ERROR: " << selType[0].getKind() << " "
<< childType.getKind() << std::endl;
throw TypeCheckingExceptionPrivate(n, "bad type for selector argument");
}
Assert(t.isDatatype());
if (t.isParametricDatatype())
{
- Debug("typecheck-idt")
+ Trace("typecheck-idt")
<< "typecheck parameterized tester: " << n << std::endl;
TypeMatcher m(t);
if (!m.doMatching(testType[0], childType))
}
else
{
- Debug("typecheck-idt") << "typecheck test: " << n << std::endl;
- Debug("typecheck-idt") << "test type: " << testType << std::endl;
+ Trace("typecheck-idt") << "typecheck test: " << n << std::endl;
+ Trace("typecheck-idt") << "test type: " << testType << std::endl;
if (!testType[0].isComparableTo(childType))
{
throw TypeCheckingExceptionPrivate(n, "bad type for tester argument");
TNode n,
bool check)
{
- Debug("typecheck-idt") << "typechecking ascription: " << n << std::endl;
+ Trace("typecheck-idt") << "typechecking ascription: " << n << std::endl;
Assert(n.getKind() == kind::APPLY_TYPE_ASCRIPTION);
TypeNode t = n.getOperator().getConst<AscriptionType>().getType();
if (check)
if (dt.isParametric())
{
// add type ascription for ambiguous constructor types
- Debug("datatypes-parametric")
+ Trace("datatypes-parametric")
<< "Constructor is " << dt[index] << std::endl;
cchildren[0] = dt[index].getInstantiatedConstructor(tn);
}
if( i<d_terms[tn].size() ){
ret = d_terms[tn][i];
}else{
- Debug("dt-enum-debug") << "get term enum " << tn << " " << i << std::endl;
+ Trace("dt-enum-debug") << "get term enum " << tn << " " << i << std::endl;
std::map< TypeNode, unsigned >::iterator it = d_te_index.find( tn );
unsigned tei;
if( it==d_te_index.end() ){
while( i>=d_terms[tn].size() ){
++d_children[tei];
if( d_children[tei].isFinished() ){
- Debug("dt-enum-debug") << "...fail term enum " << tn << " " << i << std::endl;
+ Trace("dt-enum-debug") << "...fail term enum " << tn << " " << i << std::endl;
return Node::null();
}
d_terms[tn].push_back( *d_children[tei] );
}
- Debug("dt-enum-debug") << "...return term enum " << tn << " " << i << " : " << d_terms[tn][i] << std::endl;
+ Trace("dt-enum-debug") << "...return term enum " << tn << " " << i << " : " << d_terms[tn][i] << std::endl;
ret = d_terms[tn][i];
}
return ret;
}
bool DatatypesEnumerator::increment( unsigned index ){
- Debug("dt-enum") << "Incrementing " << d_type << " " << d_ctor << " at size " << d_sel_sum[index] << "/" << d_size_limit << std::endl;
+ Trace("dt-enum") << "Incrementing " << d_type << " " << d_ctor << " at size " << d_sel_sum[index] << "/" << d_size_limit << std::endl;
if( d_sel_sum[index]==-1 ){
//first time
d_sel_sum[index] = 0;
//special case: no children to iterate
if( index>=d_has_debruijn && d_sel_types[index].empty() ){
- Debug("dt-enum") << "...success (nc) = " << (d_size_limit==0) << std::endl;
+ Trace("dt-enum") << "...success (nc) = " << (d_size_limit==0) << std::endl;
return d_size_limit==0;
}else{
- Debug("dt-enum") << "...success" << std::endl;
+ Trace("dt-enum") << "...success" << std::endl;
return true;
}
}else{
if( d_sel_sum[index]<(int)d_size_limit ){
//also check if child enumerator has enough terms
if( !getTermEnum( d_sel_types[index][i], d_sel_index[index][i]+1 ).isNull() ){
- Debug("dt-enum") << "...success increment child " << i << std::endl;
+ Trace("dt-enum") << "...success increment child " << i << std::endl;
d_sel_index[index][i]++;
d_sel_sum[index]++;
return true;
}
}
- Debug("dt-enum") << "......failed increment child " << i << std::endl;
+ Trace("dt-enum") << "......failed increment child " << i << std::endl;
//reset child, iterate next
d_sel_sum[index] -= d_sel_index[index][i];
d_sel_index[index][i] = 0;
i++;
}
- Debug("dt-enum") << "...failure." << std::endl;
+ Trace("dt-enum") << "...failure." << std::endl;
return false;
}
}
Node DatatypesEnumerator::getCurrentTerm(unsigned index)
{
- Debug("dt-enum-debug") << "Get current term at " << index << " " << d_type
+ Trace("dt-enum-debug") << "Get current term at " << index << " " << d_type
<< std::endl;
Node ret;
if (index < d_has_debruijn)
}
else
{
- Debug("dt-enum-debug")
+ Trace("dt-enum-debug")
<< "Look at constructor " << (index - d_has_debruijn) << std::endl;
const DTypeConstructor& ctor = d_datatype[index - d_has_debruijn];
- Debug("dt-enum-debug") << "Check last term..." << std::endl;
+ Trace("dt-enum-debug") << "Check last term..." << std::endl;
// we first check if the last argument (which is forced to make sum of
// iterated arguments equal to d_size_limit) is defined
Node lc;
d_size_limit - d_sel_sum[index]);
if (lc.isNull())
{
- Debug("dt-enum-debug") << "Current infeasible." << std::endl;
+ Trace("dt-enum-debug") << "Current infeasible." << std::endl;
return Node::null();
}
}
- Debug("dt-enum-debug") << "Get constructor..." << std::endl;
+ Trace("dt-enum-debug") << "Get constructor..." << std::endl;
NodeBuilder b(kind::APPLY_CONSTRUCTOR);
if (d_datatype.isParametric())
{
{
b << ctor.getConstructor();
}
- Debug("dt-enum-debug") << "Get arguments..." << std::endl;
+ Trace("dt-enum-debug") << "Get arguments..." << std::endl;
if (ctor.getNumArgs() > 0)
{
Assert(index < d_sel_types.size());
b << lc;
}
Node nnn = Node(b);
- Debug("dt-enum-debug") << "Return... " << nnn << std::endl;
+ Trace("dt-enum-debug") << "Return... " << nnn << std::endl;
ret = nnn;
}
void DatatypesEnumerator::init()
{
- Debug("dt-enum") << "datatype is datatype? " << d_type.isDatatype()
+ Trace("dt-enum") << "datatype is datatype? " << d_type.isDatatype()
<< std::endl;
- Debug("dt-enum") << "datatype is kind " << d_type.getKind() << std::endl;
- Debug("dt-enum") << "datatype is " << d_type << std::endl;
- Debug("dt-enum") << "properties : " << d_datatype.isCodatatype() << " "
+ Trace("dt-enum") << "datatype is kind " << d_type.getKind() << std::endl;
+ Trace("dt-enum") << "datatype is " << d_type << std::endl;
+ Trace("dt-enum") << "properties : " << d_datatype.isCodatatype() << " "
<< d_datatype.isRecursiveSingleton(d_type);
- Debug("dt-enum") << " " << d_datatype.getCardinalityClass(d_type)
+ Trace("dt-enum") << " " << d_datatype.getCardinalityClass(d_type)
<< std::endl;
// Start with the ground term constructed via mkGroundValue, which does
// a traversal over the structure of the datatype to find a finite term.
else
{
// find the "zero" term via mkGroundTerm
- Debug("dt-enum-debug") << "make ground term..." << std::endl;
- Debug("dt-enum-debug") << "done : " << d_zeroTerm << std::endl;
+ Trace("dt-enum-debug") << "make ground term..." << std::endl;
+ Trace("dt-enum-debug") << "done : " << d_zeroTerm << std::endl;
Assert(d_zeroTerm.getKind() == kind::APPLY_CONSTRUCTOR);
d_has_debruijn = 0;
}
- Debug("dt-enum") << "zero term : " << d_zeroTerm << std::endl;
+ Trace("dt-enum") << "zero term : " << d_zeroTerm << std::endl;
d_ctor = 0;
for (unsigned i = 0, ncons = d_datatype.getNumConstructors(); i < ncons; ++i)
{
DatatypesEnumerator& DatatypesEnumerator::operator++()
{
- Debug("dt-enum-debug") << ": increment " << this << std::endl;
+ Trace("dt-enum-debug") << ": increment " << this << std::endl;
if (d_zeroTermActive)
{
d_zeroTermActive = false;
Node operator*() override
{
- Debug("dt-enum-debug") << ": get term " << this << std::endl;
+ Trace("dt-enum-debug") << ": get term " << this << std::endl;
if (d_zeroTermActive)
{
return d_zeroTerm;
if (wordBlasted != node)
{
- Debug("fp-wordBlastTerm")
+ Trace("fp-wordBlastTerm")
<< "TheoryFp::wordBlastTerm(): before " << node << std::endl;
- Debug("fp-wordBlastTerm")
+ Trace("fp-wordBlastTerm")
<< "TheoryFp::wordBlastTerm(): after " << wordBlasted << std::endl;
}
{
Node addA = d_wordBlaster->d_additionalAssertions[oldSize];
- Debug("fp-wordBlastTerm")
+ Trace("fp-wordBlastTerm")
<< "TheoryFp::wordBlastTerm(): additional assertion " << addA
<< std::endl;
{
Trace("fp-collectModelInfo")
<< "TheoryFp::collectModelInfo(): begin" << std::endl;
- if (Trace.isOn("fp-collectModelInfo")) {
+ if (TraceIsOn("fp-collectModelInfo")) {
for (std::set<Node>::const_iterator i(relevantTerms.begin());
i != relevantTerms.end(); ++i) {
Trace("fp-collectModelInfo")
bool TheoryFp::NotifyClass::eqNotifyTriggerPredicate(TNode predicate,
bool value) {
- Debug("fp-eq")
+ Trace("fp-eq")
<< "TheoryFp::eqNotifyTriggerPredicate(): call back as predicate "
<< predicate << " is " << value << std::endl;
bool TheoryFp::NotifyClass::eqNotifyTriggerTermEquality(TheoryId tag, TNode t1,
TNode t2, bool value) {
- Debug("fp-eq") << "TheoryFp::eqNotifyTriggerTermEquality(): call back as "
+ Trace("fp-eq") << "TheoryFp::eqNotifyTriggerTermEquality(): call back as "
<< t1 << (value ? " = " : " != ") << t2 << std::endl;
if (value) {
}
void TheoryFp::NotifyClass::eqNotifyConstantTermMerge(TNode t1, TNode t2) {
- Debug("fp-eq") << "TheoryFp::eqNotifyConstantTermMerge(): call back as " << t1
+ Trace("fp-eq") << "TheoryFp::eqNotifyConstantTermMerge(): call back as " << t1
<< " = " << t2 << std::endl;
d_theorySolver.conflictEqConstantMerge(t1, t2);
}
RewriteResponse res = d_preRewriteTable[node.getKind()](node, true);
if (res.d_node != node)
{
- Debug("fp-rewrite") << "TheoryFpRewriter::preRewrite(): before " << node << std::endl;
- Debug("fp-rewrite") << "TheoryFpRewriter::preRewrite(): after "
+ Trace("fp-rewrite") << "TheoryFpRewriter::preRewrite(): before " << node << std::endl;
+ Trace("fp-rewrite") << "TheoryFpRewriter::preRewrite(): after "
<< res.d_node << std::endl;
}
return res;
RewriteResponse res = d_postRewriteTable[node.getKind()](node, false);
if (res.d_node != node)
{
- Debug("fp-rewrite") << "TheoryFpRewriter::postRewrite(): before " << node << std::endl;
- Debug("fp-rewrite") << "TheoryFpRewriter::postRewrite(): after "
+ Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): before " << node << std::endl;
+ Trace("fp-rewrite") << "TheoryFpRewriter::postRewrite(): after "
<< res.d_node << std::endl;
}
if (constRes.d_node != res.d_node)
{
- Debug("fp-rewrite")
+ Trace("fp-rewrite")
<< "TheoryFpRewriter::postRewrite(): before constant fold "
<< res.d_node << std::endl;
- Debug("fp-rewrite")
+ Trace("fp-rewrite")
<< "TheoryFpRewriter::postRewrite(): after constant fold "
<< constRes.d_node << std::endl;
}
// now, finish building the model
d_modelBuiltSuccess = finishBuildModel();
- if (Trace.isOn("model-final"))
+ if (TraceIsOn("model-final"))
{
Trace("model-final") << "Final model:" << std::endl;
Trace("model-final") << d_model->debugPrintModelEqc() << std::endl;
// we count this as printed, despite not literally printing it
rew_print = true;
// debugging information
- if (Trace.isOn("sygus-rr-debug"))
+ if (TraceIsOn("sygus-rr-debug"))
{
Trace("sygus-rr-debug") << "; candidate #1 ext-rewrites to: " << solbr
<< std::endl;
{
return false;
}
- if (Trace.isOn("sygus-rr-filter"))
+ if (TraceIsOn("sygus-rr-filter"))
{
std::stringstream ss;
ss << "(redundant-rewrite ";
n = d_drewrite->toExternal(n);
Assert(!n.isNull());
std::map<Node, std::unordered_set<Node> >::iterator it = d_pairs.find(n);
- if (Trace.isOn("crf-match"))
+ if (TraceIsOn("crf-match"))
{
Trace("crf-match") << " " << s << " matches " << n
<< " under:" << std::endl;
uires = is_upper ? CEG_TT_LOWER_STRICT : CEG_TT_UPPER_STRICT;
}
}
- if (Trace.isOn("cegqi-arith-bound-inf"))
+ if (TraceIsOn("cegqi-arith-bound-inf"))
{
Node pvmod = pv_prop.getModifiedTerm(pv);
Trace("cegqi-arith-bound-inf") << "From " << lit << ", got : ";
for (unsigned j = 0, nbounds = d_mbp_bounds[rr].size(); j < nbounds; j++)
{
Node value[3];
- if (Trace.isOn("cegqi-arith-bound"))
+ if (TraceIsOn("cegqi-arith-bound"))
{
Assert(!d_mbp_bounds[rr][j].isNull());
Trace("cegqi-arith-bound")
std::find(sf.d_vars.begin(), sf.d_vars.end(), pv) - sf.d_vars.begin();
Assert(!sf.d_props[index].isBasic());
Node eq_lhs = sf.d_props[index].getModifiedTerm(sf.d_vars[index]);
- if (Trace.isOn("cegqi-arith-debug"))
+ if (TraceIsOn("cegqi-arith-debug"))
{
Trace("cegqi-arith-debug") << "Normalize substitution for ";
Trace("cegqi-arith-debug")
return CEG_TT_INVALID;
}
Trace("cegqi-arith-debug") << "got monomial sum: " << std::endl;
- if (Trace.isOn("cegqi-arith-debug"))
+ if (TraceIsOn("cegqi-arith-debug"))
{
ArithMSum::debugPrintMonomialSum(msum, "cegqi-arith-debug");
}
Trace("cegqi-arith-debug") << "fail : isolate" << std::endl;
return CEG_TT_INVALID;
}
- if (Trace.isOn("cegqi-arith-debug"))
+ if (TraceIsOn("cegqi-arith-debug"))
{
Trace("cegqi-arith-debug") << "Isolate : ";
if (!veq_c.isNull())
// this should remove instances of non-invertible operators, and
// "linearize" lit with respect to pv as much as possible
Node rlit = rewriteAssertionForSolvePv(ci, pv, lit);
- if (Trace.isOn("cegqi-bv"))
+ if (TraceIsOn("cegqi-bv"))
{
Trace("cegqi-bv") << "BvInstantiator::processAssertion : solve " << pv
<< " in " << lit << std::endl;
}
bool firstVar = sf.empty();
// get inst id list
- if (Trace.isOn("cegqi-bv"))
+ if (TraceIsOn("cegqi-bv"))
{
Trace("cegqi-bv") << " " << iti->second.size()
<< " candidate instantiations for " << pv << " : "
// we may find an invertible literal that leads to a useful instantiation.
std::shuffle(iti->second.begin(), iti->second.end(), Random::getRandom());
- if (Trace.isOn("cegqi-bv"))
+ if (TraceIsOn("cegqi-bv"))
{
for (unsigned j = 0, size = iti->second.size(); j < size; j++)
{
Node result = visited.top()[lit];
- if (Trace.isOn("cegqi-bv-nl"))
+ if (TraceIsOn("cegqi-bv-nl"))
{
std::vector<TNode> trace_visit;
std::unordered_set<TNode> trace_visited;
Node cnode = pv_prop.getCacheNode();
if( d_curr_subs_proc[pv][n].find( cnode )==d_curr_subs_proc[pv][n].end() ){
d_curr_subs_proc[pv][n][cnode] = true;
- if( Trace.isOn("cegqi-inst-debug") ){
+ if( TraceIsOn("cegqi-inst-debug") ){
for( unsigned j=0; j<sf.d_subs.size(); j++ ){
Trace("cegqi-inst-debug") << " ";
}
subs.push_back( n );
}
}
- if (Trace.isOn("cegqi-inst"))
+ if (TraceIsOn("cegqi-inst"))
{
Trace("cegqi-inst") << "Ceg Instantiator produced : " << std::endl;
for (unsigned i = 0, size = d_input_vars.size(); i < size; ++i)
n = rewrite(n);
computeProgVars( n );
bool is_basic = canApplyBasicSubstitution( n, non_basic );
- if( Trace.isOn("sygus-si-apply-subs-debug") ){
+ if( TraceIsOn("sygus-si-apply-subs-debug") ){
Trace("sygus-si-apply-subs-debug") << "is_basic = " << is_basic << " " << tn << std::endl;
for( unsigned i=0; i<subs.size(); i++ ){
Trace("sygus-si-apply-subs-debug") << " " << vars[i] << " -> " << subs[i] << " types : " << vars[i].getType() << " -> " << subs[i].getType() << std::endl;
Node lem = NodeManager::currentNM()->mkNode( OR, ceLit.negate(), ceBody.negate() );
//require any decision on cel to be phase=true
d_qim.addPendingPhaseRequirement(ceLit, true);
- Debug("cegqi-debug") << "Require phase " << ceLit << " = true." << std::endl;
+ Trace("cegqi-debug") << "Require phase " << ceLit << " = true." << std::endl;
//add counterexample lemma
lem = rewrite(lem);
Trace("cegqi-lemma") << "Counterexample lemma : " << lem << std::endl;
if (fm->isQuantifierActive(q))
{
d_active_quant[q] = true;
- Debug("cegqi-debug") << "Check quantified formula " << q << "..." << std::endl;
+ Trace("cegqi-debug") << "Check quantified formula " << q << "..." << std::endl;
Node cel = getCounterexampleLiteral(q);
bool value;
if (d_qstate.getValuation().hasSatValue(cel, value))
{
- Debug("cegqi-debug") << "...CE Literal has value " << value << std::endl;
+ Trace("cegqi-debug") << "...CE Literal has value " << value << std::endl;
if( !value ){
if (d_qstate.getValuation().isDecision(cel))
{
}
}
}else{
- Debug("cegqi-debug") << "...CE Literal does not have value " << std::endl;
+ Trace("cegqi-debug") << "...CE Literal does not have value " << std::endl;
}
}
}
{
Assert(!d_qstate.isInConflict());
double clSet = 0;
- if( Trace.isOn("cegqi-engine") ){
+ if( TraceIsOn("cegqi-engine") ){
clSet = double(clock())/double(CLOCKS_PER_SEC);
Trace("cegqi-engine") << "---Cbqi Engine Round, effort = " << e << "---" << std::endl;
}
break;
}
}
- if( Trace.isOn("cegqi-engine") ){
+ if( TraceIsOn("cegqi-engine") ){
if (d_qim.numPendingLemmas() > lastWaiting)
{
Trace("cegqi-engine")
std::map<Node, Node> msum;
if (ArithMSum::getMonomialSumLit(n, msum))
{
- if (Trace.isOn("quant-vts-debug"))
+ if (TraceIsOn("quant-vts-debug"))
{
Trace("quant-vts-debug") << "VTS got monomial sum : " << std::endl;
ArithMSum::debugPrintMonomialSum(msum, "quant-vts-debug");
d_hasAddedLemma = false;
d_tge.d_cg = this;
double clSet = 0;
- if( Trace.isOn("sg-engine") ){
+ if( TraceIsOn("sg-engine") ){
clSet = double(clock())/double(CLOCKS_PER_SEC);
Trace("sg-engine") << "---Conjecture Engine Round, effort = " << e << "---" << std::endl;
}
Trace("sg-proc") << "...done determine ground EQC" << std::endl;
//debug printing
- if( Trace.isOn("sg-gen-eqc") ){
+ if( TraceIsOn("sg-gen-eqc") ){
for( unsigned i=0; i<eqcs.size(); i++ ){
TNode r = eqcs[i];
//print out members
//check if it is a ground term
if( git==d_ground_eqc_map.end() ){
Trace("sg-conjecture") << "ACTIVE : " << q;
- if( Trace.isOn("sg-gen-eqc") ){
+ if( TraceIsOn("sg-gen-eqc") ){
Trace("sg-conjecture") << " { ";
for (unsigned k = 0; k < skolems.size(); k++)
{
}
}
Trace("sg-stats") << "Total conjectures considered : " << d_conj_count << std::endl;
- if( Trace.isOn("thm-ee") ){
+ if( TraceIsOn("thm-ee") ){
Trace("thm-ee") << "Universal equality engine is : " << std::endl;
eq::EqClassesIterator ueqcs_i = eq::EqClassesIterator( &d_uequalityEngine );
while( !ueqcs_i.isFinished() ){
}
Trace("thm-ee") << std::endl;
}
- if( Trace.isOn("sg-engine") ){
+ if( TraceIsOn("sg-engine") ){
double clSet2 = double(clock())/double(CLOCKS_PER_SEC);
Trace("sg-engine") << "Finished conjecture generator, time = " << (clSet2-clSet) << std::endl;
}
}
bool ConjectureGenerator::notifySubstitution( TNode glhs, std::map< TNode, TNode >& subs, TNode rhs ) {
- if( Trace.isOn("sg-cconj-debug") ){
+ if( TraceIsOn("sg-cconj-debug") ){
Trace("sg-cconj-debug") << "Ground eqc for LHS : " << glhs << ", based on substituion: " << std::endl;
for( std::map< TNode, TNode >::iterator it = subs.begin(); it != subs.end(); ++it ){
Assert(getRepresentative(it->second) == it->second);
}
bool TermGenerator::getNextTerm( TermGenEnv * s, unsigned depth ) {
- if( Trace.isOn("sg-gen-tg-debug2") ){
+ if( TraceIsOn("sg-gen-tg-debug2") ){
Trace("sg-gen-tg-debug2") << this << " getNextTerm depth " << depth << " : status = " << d_status << ", num = " << d_status_num;
if( d_status==5 ){
TNode f = s->getTgFunc( d_typ, d_status_num );
if( d_match_status<0 ){
return false;
}
- if( Trace.isOn("sg-gen-tg-match") ){
+ if( TraceIsOn("sg-gen-tg-match") ){
Trace("sg-gen-tg-match") << "Matching ";
debugPrint( s, "sg-gen-tg-match", "sg-gen-tg-match" );
Trace("sg-gen-tg-match") << " with eqc e" << s->d_cg->d_em[eqc] << "..." << std::endl;
d_mode = cand_term_none;
return Node::null();
}
- Debug("cand-gen-qe") << "...get next candidate in tbd" << std::endl;
+ Trace("cand-gen-qe") << "...get next candidate in tbd" << std::endl;
//get next candidate term in the uf term database
size_t tlLimit = d_termIterList->d_list.size();
while (d_termIter < tlLimit)
}else{
Node r = d_qs.getRepresentative(n);
if( d_exclude_eqc.find( r )==d_exclude_eqc.end() ){
- Debug("cand-gen-qe") << "...returning " << n << std::endl;
+ Trace("cand-gen-qe") << "...returning " << n << std::endl;
return n;
}
}
}
}
}else if( d_mode==cand_term_eqc ){
- Debug("cand-gen-qe") << "...get next candidate in eqc" << std::endl;
+ Trace("cand-gen-qe") << "...get next candidate in eqc" << std::endl;
while( !d_eqc_iter.isFinished() ){
Node n = *d_eqc_iter;
++d_eqc_iter;
if( isLegalOpCandidate( n ) ){
- Debug("cand-gen-qe") << "...returning " << n << std::endl;
+ Trace("cand-gen-qe") << "...returning " << n << std::endl;
return n;
}
}
}else if( d_mode==cand_term_ident ){
- Debug("cand-gen-qe") << "...get next candidate identity" << std::endl;
+ Trace("cand-gen-qe") << "...get next candidate identity" << std::endl;
if (!d_eqc.isNull())
{
Node n = d_eqc;
d_ho_var_list.push_back(n);
TypeNode tn = n.getType();
Assert(tn.isFunction());
- if (Trace.isOn("ho-quant-trigger"))
+ if (TraceIsOn("ho-quant-trigger"))
{
Trace("ho-quant-trigger") << " have " << as.second.size();
Trace("ho-quant-trigger") << " patterns with variable operator " << n
}
}
}
- if (Trace.isOn("ho-unif-debug"))
+ if (TraceIsOn("ho-unif-debug"))
{
for (std::map<unsigned, Node>::iterator itf = fixed_vals.begin();
itf != fixed_vals.end();
index = index == 0 ? patsSize - 1 : (index - 1);
}
vars.insert(vars.end(), unique_vars.begin(), unique_vars.end());
- if (Trace.isOn("multi-trigger-cache"))
+ if (TraceIsOn("multi-trigger-cache"))
{
Trace("multi-trigger-cache") << " Index[" << i << "]: ";
for (uint64_t v : vars)
tat = nullptr;
}
}
- Debug("simple-trigger-debug")
+ Trace("simple-trigger-debug")
<< "Adding instantiations based on " << tat << " from " << d_op << " "
<< d_eqc << std::endl;
if (tat && !d_qstate.isInConflict())
size_t argIndex,
TNodeTrie* tat)
{
- Debug("simple-trigger-debug")
+ Trace("simple-trigger-debug")
<< "Add inst " << argIndex << " " << d_match_pattern << std::endl;
if (argIndex == d_match_pattern.getNumChildren())
{
Assert(!tat->d_data.empty());
TNode t = tat->getData();
- Debug("simple-trigger") << "Actual term is " << t << std::endl;
+ Trace("simple-trigger") << "Actual term is " << t << std::endl;
// convert to actual used terms
for (const auto& v : d_var_num)
{
if (v.second >= 0)
{
Assert(v.first < t.getNumChildren());
- Debug("simple-trigger")
+ Trace("simple-trigger")
<< "...set " << v.second << " " << t[v.first] << std::endl;
m.setValue(v.second, t[v.first]);
}
if (sendInstantiation(m, InferenceId::QUANTIFIERS_INST_E_MATCHING_SIMPLE))
{
addedLemmas++;
- Debug("simple-trigger") << "-> Produced instantiation " << m << std::endl;
+ Trace("simple-trigger") << "-> Produced instantiation " << m << std::endl;
}
return;
}
// sort based on # occurrences (this will cause Trigger to select rarer
// symbols)
std::sort(patTerms.begin(), patTerms.end(), sqfs);
- if (Debug.isOn("relevant-trigger"))
+ if (TraceIsOn("relevant-trigger"))
{
- Debug("relevant-trigger") << "Terms based on relevance: " << std::endl;
+ Trace("relevant-trigger") << "Terms based on relevance: " << std::endl;
for (const Node& p : patTerms)
{
- Debug("relevant-trigger")
+ Trace("relevant-trigger")
<< " " << p << " from " << d_pat_to_mpat[p] << " (";
- Debug("relevant-trigger") << d_quant_rel->getNumQuantifiersForSymbol(
+ Trace("relevant-trigger") << d_quant_rel->getNumQuantifiersForSymbol(
d_pat_to_mpat[p].getOperator())
<< ")" << std::endl;
}
sortTriggers st;
std::sort(patTermsF.begin(), patTermsF.end(), st);
}
- if (Trace.isOn("auto-gen-trigger-debug"))
+ if (TraceIsOn("auto-gen-trigger-debug"))
{
Trace("auto-gen-trigger-debug")
<< "Collected pat terms for " << bd
}
// tinfo not used below this point
d_made_multi_trigger[f] = false;
- if (Trace.isOn("auto-gen-trigger"))
+ if (TraceIsOn("auto-gen-trigger"))
{
Trace("auto-gen-trigger")
<< "Single trigger pool for " << f << " : " << std::endl;
std::vector<Trigger*>& ug = d_user_gen[q];
for (Trigger* t : ug)
{
- if (Trace.isOn("process-trigger"))
+ if (TraceIsOn("process-trigger"))
{
Trace("process-trigger") << " Process (user) ";
t->debugPrint("process-trigger");
bool finished = false;
//while unfinished, try effort level=0,1,2....
while( !finished && e<=eLimit ){
- Debug("inst-engine") << "IE: Prepare instantiation (" << e << ")." << std::endl;
+ Trace("inst-engine") << "IE: Prepare instantiation (" << e << ")." << std::endl;
finished = true;
//instantiate each quantifier
for( unsigned i=0; i<d_quants.size(); i++ ){
Node q = d_quants[i];
- Debug("inst-engine-debug") << "IE: Instantiate " << q << "..." << std::endl;
+ Trace("inst-engine-debug") << "IE: Instantiate " << q << "..." << std::endl;
//int e_use = d_quantEngine->getRelevance( q )==-1 ? e - 1 : e;
int e_use = e;
if( e_use>=0 ){
return;
}
double clSet = 0;
- if (Trace.isOn("inst-engine"))
+ if (TraceIsOn("inst-engine"))
{
clSet = double(clock()) / double(CLOCKS_PER_SEC);
Trace("inst-engine") << "---Instantiation Engine Round, effort = " << e
{
d_quants.clear();
}
- if (Trace.isOn("inst-engine"))
+ if (TraceIsOn("inst-engine"))
{
double clSet2 = double(clock()) / double(CLOCKS_PER_SEC);
Trace("inst-engine") << "Finished instantiation engine, time = "
std::vector<Node> temp;
temp.insert(temp.begin(), patTerms2.begin(), patTerms2.end());
filterInstances(temp);
- if (Trace.isOn("trigger-filter-instance"))
+ if (TraceIsOn("trigger-filter-instance"))
{
if (temp.size() != patTerms2.size())
{
Node np = ensureGroundTermPreprocessed(val, n, d_groundTerms);
d_nodes.push_back(np);
}
- if (Trace.isOn("trigger"))
+ if (TraceIsOn("trigger"))
{
QuantAttributes& qa = d_qreg.getQuantAttributes();
Trace("trigger") << "Trigger for " << qa.quantToString(q) << ": "
d_mg =
InstMatchGenerator::mkInstMatchGeneratorMulti(env, this, q, d_nodes);
}
- if (Trace.isOn("multi-trigger"))
+ if (TraceIsOn("multi-trigger"))
{
Trace("multi-trigger") << "Trigger for " << q << ": " << std::endl;
for (const Node& nc : d_nodes)
}
}
uint64_t addedLemmas = d_mg->addInstantiations(d_quant);
- if (Debug.isOn("inst-trigger"))
+ if (TraceIsOn("inst-trigger"))
{
if (addedLemmas > 0)
{
- Debug("inst-trigger") << "Added " << addedLemmas
+ Trace("inst-trigger") << "Added " << addedLemmas
<< " lemmas, trigger was " << d_nodes << std::endl;
}
}
<< " and type " << r_best.getType() << std::endl;
Assert(r_best.getType().isSubtypeOf(v_tn));
v_int_rep[r] = r_best;
- if (Trace.isOn("internal-rep-debug"))
+ if (TraceIsOn("internal-rep-debug"))
{
if (r_best != a)
{
}
Trace("q-ext-rewrite-debug") << "...ext-rewrite : " << n << " -> " << ret
<< std::endl;
- if (Trace.isOn("q-ext-rewrite-nf"))
+ if (TraceIsOn("q-ext-rewrite-nf"))
{
if (n == ret)
{
// check subsumptions
// sort by #atoms
std::sort(atom_count.begin(), atom_count.end(), sortPairSecond);
- if (Trace.isOn("ext-rew-eqchain"))
+ if (TraceIsOn("ext-rew-eqchain"))
{
for (const std::pair<Node, unsigned>& ac : atom_count)
{
Node ret,
const char* c) const
{
- if (Trace.isOn("q-ext-rewrite"))
+ if (TraceIsOn("q-ext-rewrite"))
{
if (!ret.isNull())
{
}
}while( success );
- if( Trace.isOn("bound-int") ){
+ if( TraceIsOn("bound-int") ){
Trace("bound-int") << "Bounds are : " << std::endl;
for( unsigned i=0; i<f[0].getNumChildren(); i++) {
Node v = f[0][i];
}
int EntryTrie::getGeneralizationIndex( FirstOrderModelFmc * m, std::vector<Node> & inst, int index ) {
- Debug("fmc-entry-trie") << "Get generalization index " << inst.size() << " " << index << std::endl;
+ Trace("fmc-entry-trie") << "Get generalization index " << inst.size() << " " << index << std::endl;
if (index==(int)inst.size()) {
return d_data;
}else{
Trace("fmc") << "Cardinality( " << it->first << " )" << " = " << it->second.size() << std::endl;
for( size_t a=0; a<it->second.size(); a++ ){
Node r = m->getRepresentative(it->second[a]);
- if( Trace.isOn("fmc-model-debug") ){
+ if( TraceIsOn("fmc-model-debug") ){
std::vector< Node > eqc;
d_qstate.getEquivalenceClass(r, eqc);
Trace("fmc-model-debug") << " " << (it->second[a]==r);
else
{
// for debugging
- if (Trace.isOn("fmc-test-inst"))
+ if (TraceIsOn("fmc-test-inst"))
{
Node ev = d_quant_models[f].evaluate(fmfmc, inst);
if (ev == d_true)
std::vector<Node>& mcond = d_quant_models[f].d_cond;
if (!d_star_insts[f].empty())
{
- if (Trace.isOn("fmc-exh"))
+ if (TraceIsOn("fmc-exh"))
{
Trace("fmc-exh") << "Exhaustive instantiate " << f << std::endl;
Trace("fmc-exh") << "Definition was : " << std::endl;
void QModelBuilder::debugModel( TheoryModel* m ){
//debug the model: cycle through all instantiations for all quantifiers, report ones that are not true
- if( Trace.isOn("quant-check-model") ){
+ if( TraceIsOn("quant-check-model") ){
FirstOrderModel* fm = d_model;
Trace("quant-check-model") << "Testing quantifier instantiations..." << std::endl;
int tests = 0;
//the following will test that the model satisfies all asserted universal quantifiers by
// (model-based) exhaustive instantiation.
double clSet = 0;
- if( Trace.isOn("model-engine") ){
+ if( TraceIsOn("model-engine") ){
Trace("model-engine") << "---Model Engine Round---" << std::endl;
clSet = double(clock())/double(CLOCKS_PER_SEC);
}
Trace("model-engine-debug") << "Check model..." << std::endl;
d_incomplete_check = false;
// print debug
- if (Trace.isOn("fmf-model-complete"))
+ if (TraceIsOn("fmf-model-complete"))
{
Trace("fmf-model-complete") << std::endl;
debugPrint("fmf-model-complete");
// successfully built an acceptable model, now check it
addedLemmas += checkModel();
- if( Trace.isOn("model-engine") ){
+ if( TraceIsOn("model-engine") ){
double clSet2 = double(clock())/double(CLOCKS_PER_SEC);
Trace("model-engine") << "Finished model engine, time = " << (clSet2-clSet) << std::endl;
}
<< "No lemmas added, incomplete = "
<< (d_incomplete_check || !d_incompleteQuants.empty()) << std::endl;
// cvc5 will answer SAT or unknown
- if( Trace.isOn("fmf-consistent") ){
+ if( TraceIsOn("fmf-consistent") ){
Trace("fmf-consistent") << std::endl;
debugPrint("fmf-consistent");
}
}
void ModelEngine::registerQuantifier( Node f ){
- if( Trace.isOn("fmf-warn") ){
+ if( TraceIsOn("fmf-warn") ){
bool canHandle = true;
for( unsigned i=0; i<f[0].getNumChildren(); i++ ){
TypeNode tn = f[0][i].getType();
d_addedLemmas = 0;
d_totalLemmas = 0;
//for statistics
- if( Trace.isOn("model-engine") ){
+ if( TraceIsOn("model-engine") ){
for( unsigned i=0; i<fm->getNumAssertedQuantifiers(); i++ ){
Node f = fm->getAssertedQuantifier( i );
if (fm->isQuantifierActive(f) && shouldProcess(f))
d_triedLemmas += d_builder->getNumTriedLemmas() - prev_tlem;
d_addedLemmas += d_builder->getNumAddedLemmas() - prev_alem;
}else{
- if( Trace.isOn("fmf-exh-inst-debug") ){
+ if( TraceIsOn("fmf-exh-inst-debug") ){
Trace("fmf-exh-inst-debug") << " Instantiation Constants: ";
for( size_t i=0; i<f[0].getNumChildren(); i++ ){
Trace("fmf-exh-inst-debug")
{
m.set(d_qstate, i, riter.getCurrentTerm(i));
}
- Debug("fmf-model-eval") << "* Add instantiation " << m << std::endl;
+ Trace("fmf-model-eval") << "* Add instantiation " << m << std::endl;
triedLemmas++;
//add as instantiation
if (inst->addInstantiation(f,
break;
}
}else{
- Debug("fmf-model-eval") << "* Failed Add instantiation " << m << std::endl;
+ Trace("fmf-model-eval") << "* Failed Add instantiation " << m << std::endl;
}
riter.increment();
}
}
void ModelEngine::debugPrint( const char* c ){
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
Trace(c) << "Quantifiers: " << std::endl;
FirstOrderModel* m = d_treg.getModel();
{
// invoke it on arguments using the evaluator
sbody = evaluate(sbody, args, children);
- if (Trace.isOn("fd-eval-debug2"))
+ if (TraceIsOn("fd-eval-debug2"))
{
Trace("fd-eval-debug2")
<< "FunDefEvaluator: evaluation with args:\n";
for (unsigned i = 0, size = d_vals.size(); i < size; i++)
{
if( !d_vals[i].isNull() ){
- Debug( c ) << " " << i << " -> " << d_vals[i] << std::endl;
+ Trace( c ) << " " << i << " -> " << d_vals[i] << std::endl;
}
}
}
}
Assert(!d_qstate.isInConflict());
double clSet = 0;
- if (Trace.isOn("enum-engine"))
+ if (TraceIsOn("enum-engine"))
{
clSet = double(clock()) / double(CLOCKS_PER_SEC);
Trace("enum-engine") << "---Full Saturation Round, effort = " << e << "---"
}
}
}
- if (Trace.isOn("enum-engine"))
+ if (TraceIsOn("enum-engine"))
{
Trace("enum-engine") << "Added lemmas = " << addedLemmas << std::endl;
double clSet2 = double(clock()) / double(CLOCKS_PER_SEC);
return;
}
double clSet = 0;
- if (Trace.isOn("pool-engine"))
+ if (TraceIsOn("pool-engine"))
{
clSet = double(clock()) / double(CLOCKS_PER_SEC);
Trace("pool-engine") << "---Pool instantiation, effort = " << e << "---"
break;
}
}
- if (Trace.isOn("pool-engine"))
+ if (TraceIsOn("pool-engine"))
{
Trace("pool-engine") << "Added lemmas = " << addedLemmas << std::endl;
double clSet2 = double(clock()) / double(CLOCKS_PER_SEC);
ill->d_list.push_back(body);
// add to temporary debug statistics (# inst on this round)
d_instDebugTemp[q]++;
- if (Trace.isOn("inst"))
+ if (TraceIsOn("inst"))
{
Trace("inst") << "*** Instantiate " << q << " with " << std::endl;
for (unsigned i = 0, size = terms.size(); i < size; i++)
{
- if (Trace.isOn("inst"))
+ if (TraceIsOn("inst"))
{
Trace("inst") << " " << terms[i];
- if (Trace.isOn("inst-debug"))
+ if (TraceIsOn("inst-debug"))
{
Trace("inst-debug") << ", type=" << terms[i].getType()
<< ", var_type=" << q[0][i].getType();
}
}
}
- if (Trace.isOn("inst-exp-fail"))
+ if (TraceIsOn("inst-exp-fail"))
{
Trace("inst-exp-fail") << "Fail mask: ";
for (bool b : failMask)
void Instantiate::notifyEndRound()
{
// debug information
- if (Trace.isOn("inst-per-quant-round"))
+ if (TraceIsOn("inst-per-quant-round"))
{
for (std::pair<const Node, uint32_t>& i : d_instDebugTemp)
{
void Instantiate::debugPrintModel()
{
- if (Trace.isOn("inst-per-quant"))
+ if (TraceIsOn("inst-per-quant"))
{
for (NodeInstListMap::iterator it = d_insts.begin(); it != d_insts.end();
++it)
// apply new classifier
Assert(d_rep_to_class.find(trie->d_lazy_child) != d_rep_to_class.end());
std::vector<Node> prev_sep_class = d_rep_to_class[trie->d_lazy_child];
- if (Trace.isOn("lazy-trie-multi"))
+ if (TraceIsOn("lazy-trie-multi"))
{
Trace("lazy-trie-multi") << "...last level. Prev sep class: \n";
for (const Node& n : prev_sep_class)
for (std::pair<const TNode, size_t>& dd : itd->second)
{
Node cv = getCurrentValue(dd.first);
- Debug("qcf-ccbe") << "compare " << cv << " " << n << std::endl;
+ Trace("qcf-ccbe") << "compare " << cv << " " << n << std::endl;
if (cv == n)
{
return false;
{
Assert(v < d_match.size());
//for handling equalities between variables, and disequalities involving variables
- Debug("qcf-match-debug") << "- " << (doRemove ? "un" : "" ) << "constrain : " << v << " -> " << n << " (cv=" << getCurrentValue( n ) << ")";
- Debug("qcf-match-debug") << ", (vn=" << vn << "), polarity = " << polarity << std::endl;
+ Trace("qcf-match-debug") << "- " << (doRemove ? "un" : "" ) << "constrain : " << v << " -> " << n << " (cv=" << getCurrentValue( n ) << ")";
+ Trace("qcf-match-debug") << ", (vn=" << vn << "), polarity = " << polarity << std::endl;
Assert(doRemove || n == getCurrentValue(n));
Assert(doRemove || v == getCurrentRepVar(v));
Assert(doRemove || (vn == -1 && getVarNum(n) == -1)
bool isGroundRep = false;
bool isGround = false;
if( vn!=-1 ){
- Debug("qcf-match-debug") << " ...Variable bound to variable" << std::endl;
+ Trace("qcf-match-debug") << " ...Variable bound to variable" << std::endl;
if( d_match[v].isNull() ){
//setting variables equal
bool alreadySet = false;
}
else if (d_match[vn] == dv)
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " -> fail, conflicting disequality" << std::endl;
return -1;
}
}
}else{
if( d_match[vn].isNull() ){
- Debug("qcf-match-debug") << " ...Reverse direction" << std::endl;
+ Trace("qcf-match-debug") << " ...Reverse direction" << std::endl;
//set the opposite direction
return addConstraint(vn, d_vars[v], v, true, false);
}else{
- Debug("qcf-match-debug") << " -> Both variables bound, compare" << std::endl;
+ Trace("qcf-match-debug") << " -> Both variables bound, compare" << std::endl;
//are they currently equal
return d_match[v] == d_match[vn] ? 0 : -1;
}
}
}else{
- Debug("qcf-match-debug") << " ...Variable bound to ground" << std::endl;
+ Trace("qcf-match-debug") << " ...Variable bound to ground" << std::endl;
if( d_match[v].isNull() ){
//isGroundRep = true; ??
isGround = true;
}else{
//compare ground values
- Debug("qcf-match-debug") << " -> Ground value, compare " << d_match[v] << " "<< n << std::endl;
+ Trace("qcf-match-debug") << " -> Ground value, compare " << d_match[v] << " "<< n << std::endl;
return d_match[v] == n ? 0 : -1;
}
}
if (setMatch(v, n, isGroundRep, isGround))
{
- Debug("qcf-match-debug") << " -> success" << std::endl;
+ Trace("qcf-match-debug") << " -> success" << std::endl;
return 1;
}
else
{
- Debug("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl;
+ Trace("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl;
return -1;
}
}
}
else
{
- Debug("qcf-match-debug") << " -> redundant, variable identity" << std::endl;
+ Trace("qcf-match-debug") << " -> redundant, variable identity" << std::endl;
return 0;
}
}else{
if (vn == static_cast<int>(v))
{
- Debug("qcf-match-debug") << " -> fail, variable identity" << std::endl;
+ Trace("qcf-match-debug") << " -> fail, variable identity" << std::endl;
return -1;
}
else
TNode nv = getCurrentValue( n );
if (nv == d_match[v])
{
- Debug("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl;
+ Trace("qcf-match-debug") << " -> fail, conflicting disequality" << std::endl;
return -1;
}
}
d_curr_var_deq[v][n] = v;
- Debug("qcf-match-debug") << " -> success" << std::endl;
+ Trace("qcf-match-debug") << " -> success" << std::endl;
return 1;
}else{
- Debug("qcf-match-debug") << " -> redundant disequality" << std::endl;
+ Trace("qcf-match-debug") << " -> redundant disequality" << std::endl;
return 0;
}
}
{
for (size_t index : rd.second)
{
- Debug("qcf-match-debug2") << n << " in relevant domain " << rd.first
+ Trace("qcf-match-debug2") << n << " in relevant domain " << rd.first
<< "." << index << "?" << std::endl;
if (!tdb->inRelevantDomain(rd.first, index, n))
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " -> fail, since " << n << " is not in relevant domain of "
<< rd.first << "." << index << std::endl;
return false;
}
}
}
- Debug("qcf-match-debug") << "-- bind : " << v << " -> " << n << ", checked "
+ Trace("qcf-match-debug") << "-- bind : " << v << " -> " << n << ", checked "
<< d_curr_var_deq[v].size() << " disequalities"
<< std::endl;
if (isGround)
if (d_vars[v].getKind() == BOUND_VARIABLE)
{
d_vars_set.insert(v);
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< "---- now bound " << d_vars_set.size() << " / "
<< d_q[0].getNumChildren() << " base variables." << std::endl;
}
void QuantInfo::unsetMatch(size_t v)
{
- Debug("qcf-match-debug") << "-- unbind : " << v << std::endl;
+ Trace("qcf-match-debug") << "-- unbind : " << v << std::endl;
if( d_vars[v].getKind()==BOUND_VARIABLE && d_vars_set.find( v )!=d_vars_set.end() ){
d_vars_set.erase( v );
}
// the helper method evaluateTerm from the entailment check utility.
Node inst_eval = echeck->evaluateTerm(
d_q[1], subs, false, options().quantifiers.qcfTConstraint, true);
- if( Trace.isOn("qcf-instance-check") ){
+ if( TraceIsOn("qcf-instance-check") ){
Trace("qcf-instance-check") << "Possible propagating instance for " << d_q << " : " << std::endl;
Trace("qcf-instance-check") << " " << terms << std::endl;
Trace("qcf-instance-check") << "...evaluates to " << inst_eval << std::endl;
if( success ){
doFail = true;
Trace("qcf-check-unassign") << " Try: " << std::endl;
- if (Trace.isOn("qcf-check"))
+ if (TraceIsOn("qcf-check"))
{
for (int ui : d_unassigned)
{
Trace("qcf-check") << "done assigning." << std::endl;
}
if( success ){
- if (Trace.isOn("qcf-check"))
+ if (TraceIsOn("qcf-check"))
{
for (int ui : d_unassigned)
{
}else{
cv = d_match[repVar];
}
- Debug("qcf-check-inst") << "INST : " << i << " -> " << cv << ", from " << d_match[i] << std::endl;
+ Trace("qcf-check-inst") << "INST : " << i << " -> " << cv << ", from " << d_match[i] << std::endl;
terms.push_back( cv );
}
}
}
}
Trace("qcf-qregister-debug") << "Done make match gen " << n << ", type = ";
- debugPrintType( "qcf-qregister-debug", d_type, true );
+ debugPrintType( "qcf-qregister-debug", d_type );
Trace("qcf-qregister-debug") << std::endl;
}
void MatchGen::reset(bool tgt)
{
d_tgt = d_type_not ? !tgt : tgt;
- Debug("qcf-match") << " Reset for : " << d_n << ", type : ";
+ Trace("qcf-match") << " Reset for : " << d_n << ", type : ";
debugPrintType( "qcf-match", d_type );
- Debug("qcf-match") << ", tgt = " << d_tgt << ", children = " << d_children.size() << " " << d_children_order.size() << std::endl;
+ Trace("qcf-match") << ", tgt = " << d_tgt << ", children = " << d_children.size() << " " << d_children_order.size() << std::endl;
d_qn.clear();
d_qni.clear();
d_qni_bound.clear();
{
Assert(isHandledUfTerm(d_n));
TNode f = d_parent->getTermDatabase()->getMatchOperator(d_n);
- Debug("qcf-match-debug") << " reset: Var will match operators of " << f << std::endl;
+ Trace("qcf-match-debug") << " reset: Var will match operators of " << f << std::endl;
TNodeTrie* qni =
d_parent->getTermDatabase()->getTermArgTrie(Node::null(), f);
if (qni == nullptr || qni->empty())
size_t repVar = d_qi->getCurrentRepVar(qvn.second);
if (d_qi->d_match[repVar].isNull())
{
- Debug("qcf-match-debug") << "Force matching on child #" << qvn.first
+ Trace("qcf-match-debug") << "Force matching on child #" << qvn.first
<< ", which is var #" << repVar << std::endl;
d_qni_bound[qvn.first] = repVar;
}
bool success;
if( vn[0]==-1 && vn[1]==-1 ){
//Trace("qcf-explain") << " reset : " << d_n << " check ground values " << nn[0] << " " << nn[1] << " (tgt=" << d_tgt << ")" << std::endl;
- Debug("qcf-match-debug") << " reset: check ground values " << nn[0] << " " << nn[1] << " (" << d_tgt << ")" << std::endl;
+ Trace("qcf-match-debug") << " reset: check ground values " << nn[0] << " " << nn[1] << " (" << d_tgt << ")" << std::endl;
//just compare values
if( d_tgt ){
success = nn[0] == nn[1];
vn[0] = vn[1];
vn[1] = -1;
}
- Debug("qcf-match-debug") << " reset: add constraint " << vn[0] << " -> " << nn[1] << " (vn=" << vn[1] << ")" << std::endl;
+ Trace("qcf-match-debug") << " reset: add constraint " << vn[0] << " -> " << nn[1] << " (vn=" << vn[1] << ")" << std::endl;
//add some constraint
int addc = d_qi->addConstraint(vn[0], nn[1], vn[1], d_tgt, false);
success = addc!=-1;
}
d_binding = false;
d_wasSet = true;
- Debug("qcf-match") << " reset: Finished reset for " << d_n << ", success = " << ( !d_qn.empty() || d_child_counter!=-1 ) << std::endl;
+ Trace("qcf-match") << " reset: Finished reset for " << d_n << ", success = " << ( !d_qn.empty() || d_child_counter!=-1 ) << std::endl;
}
bool MatchGen::getNextMatch()
{
- Debug("qcf-match") << " Get next match for : " << d_n << ", type = ";
+ Trace("qcf-match") << " Get next match for : " << d_n << ", type = ";
debugPrintType( "qcf-match", d_type );
- Debug("qcf-match") << ", children = " << d_children.size() << ", binding = " << d_binding << std::endl;
+ Trace("qcf-match") << ", children = " << d_children.size() << ", binding = " << d_binding << std::endl;
if( !d_use_children ){
if( d_child_counter==0 ){
d_child_counter = -1;
if( !d_binding ){
if (doMatching())
{
- Debug("qcf-match-debug") << " - Matching succeeded" << std::endl;
+ Trace("qcf-match-debug") << " - Matching succeeded" << std::endl;
d_binding = true;
d_binding_it = d_qni_bound.begin();
doReset = true;
}
else
{
- Debug("qcf-match-debug") << " - Matching failed" << std::endl;
+ Trace("qcf-match-debug") << " - Matching failed" << std::endl;
success = false;
terminate = true;
}
if( d_binding ){
//also need to create match for each variable we bound
success = true;
- Debug("qcf-match-debug") << " Produce matches for bound variables by " << d_n << ", type = ";
+ Trace("qcf-match-debug") << " Produce matches for bound variables by " << d_n << ", type = ";
debugPrintType( "qcf-match-debug", d_type );
- Debug("qcf-match-debug") << "..." << std::endl;
+ Trace("qcf-match-debug") << "..." << std::endl;
while( ( success && d_binding_it!=d_qni_bound.end() ) || doFail ){
QuantInfo::VarMgMap::const_iterator itm;
if( !doFail ){
- Debug("qcf-match-debug") << " check variable " << d_binding_it->second << std::endl;
+ Trace("qcf-match-debug") << " check variable " << d_binding_it->second << std::endl;
itm = d_qi->var_mg_find(d_binding_it->second);
}
if (doFail || (d_binding_it->first != 0 && itm != d_qi->var_mg_end()))
{
- Debug("qcf-match-debug") << " we had bound variable " << d_binding_it->second << ", reset = " << doReset << std::endl;
+ Trace("qcf-match-debug") << " we had bound variable " << d_binding_it->second << ", reset = " << doReset << std::endl;
if( doReset ){
itm->second->reset(true);
}
{
do {
if( d_binding_it==d_qni_bound.begin() ){
- Debug("qcf-match-debug") << " failed." << std::endl;
+ Trace("qcf-match-debug") << " failed." << std::endl;
success = false;
}else{
--d_binding_it;
- Debug("qcf-match-debug") << " decrement..." << std::endl;
+ Trace("qcf-match-debug") << " decrement..." << std::endl;
}
} while (success
&& (d_binding_it->first == 0
}
else
{
- Debug("qcf-match-debug") << " increment..." << std::endl;
+ Trace("qcf-match-debug") << " increment..." << std::endl;
++d_binding_it;
doReset = true;
}
}
else
{
- Debug("qcf-match-debug") << " skip..." << d_binding_it->second << std::endl;
+ Trace("qcf-match-debug") << " skip..." << d_binding_it->second << std::endl;
++d_binding_it;
doReset = true;
}
{
if (!qb.second.isNull())
{
- Debug("qcf-match")
+ Trace("qcf-match")
<< " Clean up bound var " << qb.first
<< (d_tgt ? "!" : "") << " = " << qb.second << std::endl;
itb = d_qni_bound_cons_var.find(qb.first);
//clean up the matches you set
for (const std::pair<const size_t, size_t>& qb : d_qni_bound)
{
- Debug("qcf-match")
+ Trace("qcf-match")
<< " Clean up bound var " << qb.second << std::endl;
Assert(qb.second < d_qi->getNumVars());
d_qi->unsetMatch(qb.second);
}
}
}
- Debug("qcf-match") << " ...finished matching for " << d_n << ", success = " << success << std::endl;
+ Trace("qcf-match") << " ...finished matching for " << d_n << ", success = " << success << std::endl;
d_wasSet = success;
return success;
}
{
if( d_child_counter<(int)(getNumChildren()-1) ){
d_child_counter++;
- Debug("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << std::endl;
+ Trace("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << std::endl;
getChild(d_child_counter)->reset(d_tgt);
}else{
success = true;
{
if( d_child_counter<(int)(getNumChildren()-1) ){
d_child_counter++;
- Debug("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << ", one match" << std::endl;
+ Trace("qcf-match-debug") << " Reset child " << d_child_counter << " of " << d_n << ", one match" << std::endl;
getChild(d_child_counter)->reset(d_tgt);
}else{
d_child_counter = -1;
}
}
d_wasSet = success;
- Debug("qcf-match") << " ...finished construct match for " << d_n << ", success = " << success << std::endl;
+ Trace("qcf-match") << " ...finished construct match for " << d_n << ", success = " << success << std::endl;
return success;
}
}
- Debug("qcf-match") << " ...already finished for " << d_n << std::endl;
+ Trace("qcf-match") << " ...already finished for " << d_n << std::endl;
return false;
}
do
{
invalidMatch = false;
- Debug("qcf-match-debug") << " Do matching " << d_n << " "
+ Trace("qcf-match-debug") << " Do matching " << d_n << " "
<< d_qn.size() << " " << d_qni.size() << std::endl;
if (d_qn.size() == d_qni.size() + 1)
{
{
// get the representative variable this variable is equal to
size_t repVar = d_qi->getCurrentRepVar(itv->second);
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Match " << index << " is a variable " << itv->second
<< ", which is repVar " << repVar << std::endl;
// get the value the rep variable
if (!d_qi->d_match[repVar].isNull())
{
val = d_qi->d_match[repVar];
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Variable is already bound to " << val << std::endl;
}
else
if (it->first.getType().isComparableTo(d_qi->d_var_types[repVar])
&& d_qi->setMatch(d_qni_bound[index], it->first, true, true))
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Binding variable" << std::endl;
if( d_qn.size()<d_qni_size ){
d_qn.push_back( &it->second );
}
else
{
- Debug("qcf-match")
+ Trace("qcf-match")
<< " Binding variable, currently fail." << std::endl;
invalidMatch = true;
}
}
else
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Binding variable, fail, no more variables to bind"
<< std::endl;
d_qn.pop_back();
}
else
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Match " << index << " is ground term" << std::endl;
Assert(d_qni_gterm.find(index) != d_qni_gterm.end());
val = d_qni_gterm[index];
d_qn[index]->d_data.find(valr);
if (it != d_qn[index]->d_data.end())
{
- Debug("qcf-match-debug") << " Match" << std::endl;
+ Trace("qcf-match-debug") << " Match" << std::endl;
d_qni.push_back(it);
if (d_qn.size() < d_qni_size)
{
}
else
{
- Debug("qcf-match-debug") << " Failed to match" << std::endl;
+ Trace("qcf-match-debug") << " Failed to match" << std::endl;
d_qn.pop_back();
}
}
success = true;
if (d_qi->setMatch(itb->second, d_qni[index]->first, true, true))
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Bind next variable" << std::endl;
if (d_qn.size() < d_qni_size)
{
}
else
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Bind next variable, currently fail" << std::endl;
invalidMatch = true;
}
{
d_qi->unsetMatch(itb->second);
d_qi->d_match_term[itb->second] = TNode::null();
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " Bind next variable, no more variables to bind"
<< std::endl;
}
{
Assert(!d_qni[d_qni.size() - 1]->second.d_data.empty());
TNode t = d_qni[d_qni.size() - 1]->second.d_data.begin()->first;
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " " << d_n << " matched " << t << std::endl;
d_qi->d_match_term[d_qni_var_num[0]] = t;
// set the match terms
Node q = d_qi->getQuantifiedFormula();
for (const std::pair<const size_t, size_t>& qb : d_qni_bound)
{
- Debug("qcf-match-debug")
+ Trace("qcf-match-debug")
<< " position " << qb.first << " bounded " << qb.second << " / "
<< q[0].getNumChildren() << std::endl;
if (qb.first > 0)
return !d_qn.empty();
}
-void MatchGen::debugPrintType( const char * c, short typ, bool isTrace ) {
- if( isTrace ){
+void MatchGen::debugPrintType( const char * c, short typ) {
switch( typ ){
case typ_invalid: Trace(c) << "invalid";break;
case typ_ground: Trace(c) << "ground";break;
case typ_var: Trace(c) << "var";break;
case typ_bool_var: Trace(c) << "bool_var";break;
}
- }else{
- switch( typ ){
- case typ_invalid: Debug(c) << "invalid";break;
- case typ_ground: Debug(c) << "ground";break;
- case typ_eq: Debug(c) << "eq";break;
- case typ_pred: Debug(c) << "pred";break;
- case typ_formula: Debug(c) << "formula";break;
- case typ_var: Debug(c) << "var";break;
- case typ_bool_var: Debug(c) << "bool_var";break;
- }
- }
}
void MatchGen::setInvalid() {
}
d_quants.push_back(q);
d_quant_id[q] = d_quants.size();
- if (Trace.isOn("qcf-qregister"))
+ if (TraceIsOn("qcf-qregister"))
{
Trace("qcf-qregister") << "Register ";
debugPrintQuant("qcf-qregister", q);
d_qinfo[q].reset(new QuantInfo(d_env, this, q));
// debug print
- if (Trace.isOn("qcf-qregister"))
+ if (TraceIsOn("qcf-qregister"))
{
QuantInfo* qi = d_qinfo[q].get();
Trace("qcf-qregister") << "- Flattened structure is :" << std::endl;
++(d_statistics.d_inst_rounds);
double clSet = 0;
int prevEt = 0;
- if (Trace.isOn("qcf-engine"))
+ if (TraceIsOn("qcf-engine"))
{
prevEt = d_statistics.d_entailment_checks.get();
clSet = double(clock()) / double(CLOCKS_PER_SEC);
d_irr_func.clear();
d_irr_quant.clear();
- if (Trace.isOn("qcf-debug"))
+ if (TraceIsOn("qcf-debug"))
{
Trace("qcf-debug") << std::endl;
debugPrint("qcf-debug");
{
d_conflict.set(true);
}
- if (Trace.isOn("qcf-engine"))
+ if (TraceIsOn("qcf-engine"))
{
double clSet2 = double(clock()) / double(CLOCKS_PER_SEC);
Trace("qcf-engine") << "Finished conflict find engine, time = "
// quantified formula is not properly set up for matching
return;
}
- if (Trace.isOn("qcf-check"))
+ if (TraceIsOn("qcf-check"))
{
Trace("qcf-check") << "Check quantified formula ";
debugPrintQuant("qcf-check", q);
<< std::endl;
return;
}
- if (Trace.isOn("qcf-inst"))
+ if (TraceIsOn("qcf-inst"))
{
Trace("qcf-inst") << "*** Produced match at effort " << d_effort << " : "
<< std::endl;
{
// otherwise, we have a conflict/propagating instance
// for debugging
- if (Debug.isOn("qcf-check-inst"))
+ if (TraceIsOn("qcf-check-inst"))
{
Node inst = qinst->getInstantiation(q, terms);
- Debug("qcf-check-inst")
+ Trace("qcf-check-inst")
<< "Check instantiation " << inst << "..." << std::endl;
Assert(!d_treg.getEntailmentCheck()->isEntailed(inst, true));
Assert(d_treg.getEntailmentCheck()->isEntailed(inst, false)
return;
}
Trace("qcf-check") << " ... Added instantiation" << std::endl;
- if (Trace.isOn("qcf-inst"))
+ if (TraceIsOn("qcf-inst"))
{
Trace("qcf-inst") << "*** Was from effort " << d_effort << " : "
<< std::endl;
typ_tconstraint,
typ_tsym,
};
- void debugPrintType( const char * c, short typ, bool isTrace = false );
+ void debugPrintType( const char * c, short typ);
bool d_tgt;
bool d_tgt_orig;
d_phase_reqs[ it->first ] = false;
}
}
- Debug("inst-engine-phase-req") << "Phase requirements for " << n << ":" << std::endl;
+ Trace("inst-engine-phase-req") << "Phase requirements for " << n << ":" << std::endl;
//now, compute if any patterns are equality required
if( computeEq ){
for( std::map< Node, bool >::iterator it = d_phase_reqs.begin(); it != d_phase_reqs.end(); ++it ){
- Debug("inst-engine-phase-req") << " " << it->first << " -> " << it->second << std::endl;
+ Trace("inst-engine-phase-req") << " " << it->first << " -> " << it->second << std::endl;
if( it->first.getKind()==EQUAL ){
if( quantifiers::TermUtil::hasInstConstAttr(it->first[0]) ){
if( !quantifiers::TermUtil::hasInstConstAttr(it->first[1]) ){
d_phase_reqs_equality_term[ it->first[0] ] = it->first[1];
d_phase_reqs_equality[ it->first[0] ] = it->second;
- Debug("inst-engine-phase-req") << " " << it->first[0] << ( it->second ? " == " : " != " ) << it->first[1] << std::endl;
+ Trace("inst-engine-phase-req") << " " << it->first[0] << ( it->second ? " == " : " != " ) << it->first[1] << std::endl;
}
}else if( quantifiers::TermUtil::hasInstConstAttr(it->first[1]) ){
d_phase_reqs_equality_term[ it->first[1] ] = it->first[0];
d_phase_reqs_equality[ it->first[1] ] = it->second;
- Debug("inst-engine-phase-req") << " " << it->first[1] << ( it->second ? " == " : " != " ) << it->first[0] << std::endl;
+ Trace("inst-engine-phase-req") << " " << it->first[1] << ( it->second ? " == " : " != " ) << it->first[0] << std::endl;
}
}
}
}
Assert(q.getKind() == kind::FORALL);
NodeManager* nm = NodeManager::currentNM();
- Debug("quantifiers-engine")
+ Trace("quantifiers-engine")
<< "Instantiation constants for " << q << " : " << std::endl;
for (size_t i = 0, nvars = q[0].getNumChildren(); i < nvars; i++)
{
Node ic = nm->mkInstConstant(q[0][i].getType());
d_inst_constants_map[ic] = q;
d_inst_constants[q].push_back(ic);
- Debug("quantifiers-engine") << " " << ic << std::endl;
+ Trace("quantifiers-engine") << " " << ic << std::endl;
// set the var number attribute
InstVarNumAttribute ivna;
ic.setAttribute(ivna, i);
const std::vector<Node>& args,
Node& var)
{
- if (Trace.isOn("quant-velim-bv"))
+ if (TraceIsOn("quant-velim-bv"))
{
Trace("quant-velim-bv") << "Bv-Elim : " << lit << " varList = { ";
for (const Node& v : args)
void QuantifiersState::debugPrintEqualityEngine(const char* c) const
{
- bool traceEnabled = Trace.isOn(c);
+ bool traceEnabled = TraceIsOn(c);
if (!traceEnabled)
{
return;
const std::vector<Node>& candidates,
std::vector<Node>& candidate_values)
{
- if (Trace.isOn("cegis"))
+ if (TraceIsOn("cegis"))
{
Trace("cegis") << " Enumerators :\n";
for (unsigned i = 0, size = enums.size(); i < size; ++i)
}
else
{
- if (Trace.isOn("cegis-rl"))
+ if (TraceIsOn("cegis-rl"))
{
if (d_refinement_lemma_conj.find(lem) == d_refinement_lemma_conj.end())
{
const std::vector<Node>& vals)
{
Trace("sygus-engine") << " *** Do sample add refinement..." << std::endl;
- if (Trace.isOn("cegis-sample"))
+ if (TraceIsOn("cegis-sample"))
{
Trace("cegis-sample") << "Check sampling for candidate solution"
<< std::endl;
d_refinement_lemmas.begin(), d_refinement_lemmas.end(), rlem)
== d_refinement_lemmas.end())
{
- if (Trace.isOn("cegis-sample"))
+ if (TraceIsOn("cegis-sample"))
{
Trace("cegis-sample") << " false for point #" << i << " : ";
for (const Node& cn : pt)
Assert(candidates.size() == candidate_values.size());
Trace("sygus-ccore-summary")
<< "CegisCoreConnective: construct solution..." << std::endl;
- if (Trace.isOn("sygus-ccore"))
+ if (TraceIsOn("sygus-ccore"))
{
Trace("sygus-ccore")
<< "CegisCoreConnective: Construct candidate solutions..." << std::endl;
Trace("sygus-ccore-summary") << "...success" << std::endl;
return true;
}
- if (Trace.isOn("sygus-ccore-summary"))
+ if (TraceIsOn("sygus-ccore-summary"))
{
std::stringstream ss;
ccheck.debugPrintSummary(ss);
{
Assert(mvMap.find(eu) != mvMap.end());
Node m_eu = mvMap[eu];
- if (Trace.isOn("cegis-unif"))
+ if (TraceIsOn("cegis-unif"))
{
Trace("cegis-unif") << " " << eu << " -> ";
TermDbSygus::toStreamSygus("cegis-unif", m_eu);
return Cegis::processConstructCandidates(
enums, enum_values, candidates, candidate_values, satisfiedRl);
}
- if (Trace.isOn("cegis-unif"))
+ if (TraceIsOn("cegis-unif"))
{
for (const Node& c : d_unif_candidates)
{
if (d_sygus_unif.constructSolution(sols, lemmas))
{
candidate_values.insert(candidate_values.end(), sols.begin(), sols.end());
- if (Trace.isOn("cegis-unif"))
+ if (TraceIsOn("cegis-unif"))
{
Trace("cegis-unif") << "* Candidate solutions are:\n";
for (const Node& sol : sols)
for (const std::pair<const unsigned, std::vector<Node>>& p : d_var_classes)
{
d_perm_state_class.push_back(PermutationState(p.second));
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
Trace("synth-stream-concrete") << " " << p.first << " -> [";
for (const Node& var : p.second)
Node EnumStreamPermutation::getNext()
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, d_value);
// if permuted value is equivalent modulo rewriting to a previous one, look
// for another
} while (!d_perm_values.insert(bultin_perm_value).second);
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, perm_value);
{
for (unsigned i = 0, size = d_last_perm.size(); i < size; ++i)
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, d_vars[d_last_perm[i]]);
void EnumStreamSubstitution::resetValue(Node value)
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, value);
}
d_comb_state_class.push_back(CombinationState(
p.second.size(), perm_var_class_sz, p.first, p.second));
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
Trace("synth-stream-concrete")
<< " " << p.first << " -> " << perm_var_class_sz << " from [ ";
Node EnumStreamSubstitution::getNext()
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, d_value);
}
}
}
- if (Trace.isOn("synth-stream-concrete-debug"))
+ if (TraceIsOn("synth-stream-concrete-debug"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, d_last);
{
builtin_comb_value = d_tds->rewriteNode(builtin_comb_value);
}
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, comb_value);
if (!builtin_comb_value.isConst()
&& !d_comb_values.insert(builtin_comb_value).second)
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss, ss1;
TermDbSygus::toStreamSygus(ss, comb_value);
}
return Node::null();
}
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, comb_value);
{
for (unsigned i = 0, size = d_last_comb.size(); i < size; ++i)
{
- if (Trace.isOn("synth-stream-concrete"))
+ if (TraceIsOn("synth-stream-concrete"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, d_vars[d_last_comb[i]]);
{
// None currently exist. The next abstract value is the model value for e.
absE = getModelValue(e);
- if (Trace.isOn("sygus-active-gen"))
+ if (TraceIsOn("sygus-active-gen"))
{
Trace("sygus-active-gen") << "Active-gen: new abstract value : ";
TermDbSygus::toStreamSygus("sygus-active-gen", e);
Trace("cegqi-lemma") << "Cegqi::Lemma : actively-generated enumerator "
"exclude current solution : "
<< lem << std::endl;
- if (Trace.isOn("sygus-active-gen-debug"))
+ if (TraceIsOn("sygus-active-gen-debug"))
{
Trace("sygus-active-gen-debug") << "Active-gen: block ";
TermDbSygus::toStreamSygus("sygus-active-gen-debug", absE);
{
d_evActiveGenWaiting = v;
}
- if (Trace.isOn("sygus-active-gen"))
+ if (TraceIsOn("sygus-active-gen"))
{
Trace("sygus-active-gen") << "Active-gen : " << e << " : ";
TermDbSygus::toStreamSygus("sygus-active-gen", absE);
return false;
}
- if (Trace.isOn("ex-infer"))
+ if (TraceIsOn("ex-infer"))
{
for (unsigned i = 0; i < candidates.size(); i++)
{
ret = Node::null();
}
}
- if (Trace.isOn("sygus-enum"))
+ if (TraceIsOn("sygus-enum"))
{
Trace("sygus-enum") << "Enumerate : ";
TermDbSygus::toStreamSygus("sygus-enum", ret);
d_currSize++;
Trace("sygus-enum-debug2") << "master(" << d_tn
<< "): size++ : " << d_currSize << "\n";
- if (Trace.isOn("sygus-engine"))
+ if (TraceIsOn("sygus-engine"))
{
// am i the master enumerator? if so, print
if (d_se->d_tlEnum == this)
claimed.end(),
std::back_inserter(difference));
op_pos = difference;
- if (Trace.isOn("sygus-grammar-normalize-chain"))
+ if (TraceIsOn("sygus-grammar-normalize-chain"))
{
Trace("sygus-grammar-normalize-chain")
<< "OP at " << d_chain_op_pos << "\n"
/* Creates a type do be added to root representing next step in the chain */
/* Add + to elems */
d_elem_pos.push_back(d_chain_op_pos);
- if (Trace.isOn("sygus-grammar-normalize-chain"))
+ if (TraceIsOn("sygus-grammar-normalize-chain"))
{
Trace("sygus-grammar-normalize-chain")
<< "\tCreating type for next entry with sygus_ops ";
/* Corresponding type node to tn with the given operator positions. To be
* retrieved (if cached) or defined (otherwise) */
TypeNode unres_tn;
- if (Trace.isOn("sygus-grammar-normalize-trie"))
+ if (TraceIsOn("sygus-grammar-normalize-trie"))
{
Trace("sygus-grammar-normalize-trie")
<< "\tRecursing on " << tn << " with op_positions ";
std::sort(op_pos.begin(), op_pos.end());
if (d_tries[tn].getOrMakeType(tn, unres_tn, op_pos))
{
- if (Trace.isOn("sygus-grammar-normalize-trie"))
+ if (TraceIsOn("sygus-grammar-normalize-trie"))
{
Trace("sygus-grammar-normalize-trie")
<< "\tTypenode " << tn << " has already been normalized with op_pos ";
}
return unres_tn;
}
- if (Trace.isOn("sygus-grammar-normalize-trie"))
+ if (TraceIsOn("sygus-grammar-normalize-trie"))
{
Trace("sygus-grammar-normalize-trie")
<< "\tTypenode " << tn << " not yet normalized with op_pos ";
to.addConsInfo(this, dt[oi]);
}
/* Build normalize datatype */
- if (Trace.isOn("sygus-grammar-normalize"))
+ if (TraceIsOn("sygus-grammar-normalize"))
{
Trace("sygus-grammar-normalize") << "\nFor positions ";
for (unsigned i = 0, size = op_pos.size(); i < size; ++i)
normalizeSygusRec(tn);
/* Resolve created types */
Assert(!d_dt_all.empty() && !d_unres_t_all.empty());
- if (Trace.isOn("sygus-grammar-normalize-build"))
+ if (TraceIsOn("sygus-grammar-normalize-build"))
{
Trace("sygus-grammar-normalize-build")
<< "making mutual datatyes with datatypes \n";
}
else if (contr.getConst<bool>() == d_isUniversal)
{
- if (Trace.isOn("sygus-pbe-cterm"))
+ if (TraceIsOn("sygus-pbe-cterm"))
{
Trace("sygus-pbe-cterm")
<< "PBE-cterm : enumerator : do not consider ";
{
Node nn = it->first;
arg_list.push_back(nn);
- if (Trace.isOn("sygus-process-arg-deps"))
+ if (TraceIsOn("sygus-process-arg-deps"))
{
Trace("sygus-process-arg-deps") << " argument " << nn;
Trace("sygus-process-arg-deps") << " (" << it->second.size()
void SynthConjectureProcess::initialize(Node n, std::vector<Node>& candidates)
{
- if (Trace.isOn("sygus-process"))
+ if (TraceIsOn("sygus-process"))
{
Trace("sygus-process") << "Process conjecture : " << n
<< " with candidates: " << std::endl;
{
return false;
}
- if (Trace.isOn("sygus-repair-const"))
+ if (TraceIsOn("sygus-repair-const"))
{
Trace("sygus-repair-const") << "Repair candidate solutions..." << std::endl;
for (unsigned i = 0, size = candidates.size(); i < size; i++)
Node cv = candidate_values[i];
Node skeleton = getSkeleton(
cv, free_var_count, sk_vars, sk_vars_to_subs, useConstantsAsHoles);
- if (Trace.isOn("sygus-repair-const"))
+ if (TraceIsOn("sygus-repair-const"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, cv);
Node scsk = csk.substitute(
sk_vars.begin(), sk_vars.end(), sk_sygus_m.begin(), sk_sygus_m.end());
repair_cv.push_back(scsk);
- if (Trace.isOn("sygus-repair-const") || Trace.isOn("sygus-engine"))
+ if (TraceIsOn("sygus-repair-const") || TraceIsOn("sygus-engine"))
{
std::stringstream sss;
TermDbSygus::toStreamSygus(sss, repair_cv[i]);
void SygusUnif::indent(const char* c, int ind)
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
for (int i = 0; i < ind; i++)
{
void SygusUnif::print_val(const char* c, std::vector<Node>& vals, bool pol)
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
for (unsigned i = 0; i < vals.size(); i++)
{
}
cond_vals[resb] = true;
results.push_back(resb);
- if (Trace.isOn("sygus-sui-enum"))
+ if (TraceIsOn("sygus-sui-enum"))
{
if (resb.isNull())
{
&& datatypes::utils::getSygusTermSize(vcc)
< d_sol_term_size)))
{
- if (Trace.isOn("sygus-pbe"))
+ if (TraceIsOn("sygus-pbe"))
{
Trace("sygus-pbe") << "**** SygusUnif SOLVED : " << c << " = ";
TermDbSygus::toStreamSygus("sygus-pbe", vcc);
// if the enumerator is in a conditional context, then we are stricter
// about when to exclude
bool isConditional = d_use_str_contains_eexc_conditional[e];
- if (Trace.isOn("sygus-sui-cterm-debug"))
+ if (TraceIsOn("sygus-sui-cterm-debug"))
{
Trace("sygus-sui-enum") << std::endl;
}
Assert(d_candidate == f);
UnifContextIo& x = d_context;
TypeNode etn = e.getType();
- if (Trace.isOn("sygus-sui-dt-debug"))
+ if (TraceIsOn("sygus-sui-dt-debug"))
{
indent("sygus-sui-dt-debug", ind);
Trace("sygus-sui-dt-debug") << "ConstructPBE: (" << e << ", " << nrole
{
ret_dt = *intersection.begin();
}
- if (Trace.isOn("sygus-sui-dt"))
+ if (TraceIsOn("sygus-sui-dt"))
{
indent("sygus-sui-dt", ind);
Trace("sygus-sui-dt") << "ConstructPBE: found in cache: ";
// make the value of the examples
std::vector<Node> ex_vals;
x.getCurrentStrings(this, d_examples_out, ex_vals);
- if (Trace.isOn("sygus-sui-dt-debug"))
+ if (TraceIsOn("sygus-sui-dt-debug"))
{
indent("sygus-sui-dt-debug", ind);
Trace("sygus-sui-dt-debug") << "current strings : " << std::endl;
possible_cond.find(0);
if (itpc != possible_cond.end())
{
- if (Trace.isOn("sygus-sui-dt-debug"))
+ if (TraceIsOn("sygus-sui-dt-debug"))
{
indent("sygus-sui-dt-debug", ind + 1);
Trace("sygus-sui-dt-debug")
}
}
Assert(ret_dt.isNull() || ret_dt.getType() == e.getType());
- if (Trace.isOn("sygus-sui-dt"))
+ if (TraceIsOn("sygus-sui-dt"))
{
indent("sygus-sui-dt", ind);
Trace("sygus-sui-dt") << "ConstructPBE: returned ";
{
if (x.d_vals[i].getConst<bool>())
{
- if (Trace.isOn("sygus-sui-cache"))
+ if (TraceIsOn("sygus-sui-cache"))
{
indent("sygus-sui-cache", ind);
Trace("sygus-sui-cache") << "Cache solution (#" << i << ") : ";
<< "Node " << n << " is parameterized\n";
children.insert(children.begin(), n.getOperator());
}
- if (Trace.isOn("sygus-unif-rl-purify-debug"))
+ if (TraceIsOn("sygus-unif-rl-purify-debug"))
{
Trace("sygus-unif-rl-purify-debug")
<< "...rebuilding " << n << " with kind " << k << " and children:\n";
// Maps new enumerator to its respective tuple of arguments
d_hd_to_pt[new_f] =
std::vector<Node>(children.begin() + 1, children.end());
- if (Trace.isOn("sygus-unif-rl-purify-debug"))
+ if (TraceIsOn("sygus-unif-rl-purify-debug"))
{
Trace("sygus-unif-rl-purify-debug") << "...[" << new_f << "] --> ( ";
for (const Node& pt_i : d_hd_to_pt[new_f])
std::vector<Node>& enums,
std::map<Node, std::unordered_set<unsigned>>& unused_strats)
{
- if (Trace.isOn("sygus-unif-rl-strat"))
+ if (TraceIsOn("sygus-unif-rl-strat"))
{
Trace("sygus-unif-rl-strat")
<< "Strategy for " << f << " is : " << std::endl;
if (d_unif->usingConditionPool())
{
d_cond_mvs.insert(conds.begin(), conds.end());
- if (Trace.isOn("sygus-unif-cond-pool"))
+ if (TraceIsOn("sygus-unif-cond-pool"))
{
for (const Node& condv : conds)
{
// add the head to the trie
e = d_hds[hd_counter];
hd_mv[e] = d_unif->d_parent->getModelValue(e);
- if (Trace.isOn("sygus-unif-sol"))
+ if (TraceIsOn("sygus-unif-sol"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, hd_mv[e]);
Node ce = d_enums[c_counter];
Node cv = d_conds[c_counter];
Assert(ce.getType() == cv.getType());
- if (Trace.isOn("sygus-unif-sol"))
+ if (TraceIsOn("sygus-unif-sol"))
{
std::stringstream ss;
TermDbSygus::toStreamSygus(ss, cv);
Assert(d_dt->d_unif->d_hd_to_pt.find(hd) != d_dt->d_unif->d_hd_to_pt.end());
std::vector<Node> pt = d_dt->d_unif->d_hd_to_pt[hd];
// compute the result
- if (Trace.isOn("sygus-unif-rl-sep"))
+ if (TraceIsOn("sygus-unif-rl-sep"))
{
Trace("sygus-unif-rl-sep")
<< "Evaluate cond " << builtin_cond << " on pt " << hd << " ( ";
std::reverse(cons_strat->d_sol_templ_args.begin(),
cons_strat->d_sol_templ_args.end());
}
- if (Trace.isOn("sygus-unif"))
+ if (TraceIsOn("sygus-unif"))
{
Trace("sygus-unif") << "Initialized strategy " << strat;
Trace("sygus-unif")
void SygusUnifStrategy::debugPrint(const char* c)
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
std::map<Node, std::map<NodeRole, bool> > visited;
debugPrint(c, getRootEnumerator(), role_equal, visited, 0);
void SygusUnifStrategy::indent(const char* c, int ind)
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
for (int i = 0; i < ind; i++)
{
if (d_repair_index < ninst)
{
std::vector<Node> fail_cvs = d_solutionValues[d_repair_index];
- if (Trace.isOn("sygus-engine"))
+ if (TraceIsOn("sygus-engine"))
{
Trace("sygus-engine") << "CegConjuncture : repair previous solution ";
for (const Node& fc : fail_cvs)
if (modelSuccess)
{
// Must separately compute whether trace is on due to compilation of
- // Trace.isOn.
- bool traceIsOn = Trace.isOn("sygus-engine");
+ // TraceIsOn.
+ bool traceIsOn = TraceIsOn("sygus-engine");
if (printDebug || traceIsOn)
{
Trace("sygus-engine") << " * Value is : ";
else
{
Trace("sygus-engine") << ss.str() << " ";
- if (Trace.isOn("sygus-engine-rr"))
+ if (TraceIsOn("sygus-engine-rr"))
{
Node bv = d_tds->sygusToBuiltin(nv, tn);
bv = rewrite(bv);
Node query;
if (constructed_cand)
{
- if (Trace.isOn("cegqi-check"))
+ if (TraceIsOn("cegqi-check"))
{
Trace("cegqi-check") << "CegConjuncture : check candidate : "
<< std::endl;
bool SynthEngine::checkConjecture(SynthConjecture* conj)
{
- if (Trace.isOn("sygus-engine-debug"))
+ if (TraceIsOn("sygus-engine-debug"))
{
conj->debugPrint("sygus-engine-debug");
Trace("sygus-engine-debug") << std::endl;
Trace("sygus-engine") << " ...got " << r << std::endl;
if (r.asSatisfiabilityResult().isSat() == Result::SAT)
{
- if (Trace.isOn("sygus-engine"))
+ if (TraceIsOn("sygus-engine"))
{
Trace("sygus-engine") << " * Verification lemma failed for:\n ";
for (unsigned i = 0, size = vars.size(); i < size; i++)
void TermDbSygus::toStreamSygus(const char* c, Node n)
{
- if (Trace.isOn(c))
+ if (TraceIsOn(c))
{
std::stringstream ss;
toStreamSygus(ss, n);
argts.push_back(ntn);
argts.push_back(disj_types[r][d]);
argts.push_back(disj_types[1 - r][1 - dd]);
- if (Trace.isOn("sygus-cons-kind"))
+ if (TraceIsOn("sygus-cons-kind"))
{
Trace("sygus-cons-kind")
<< "Can construct kind " << k << " in " << tn
{
d_hasBoolConnective = true;
}
- if (Trace.isOn("sygus-db"))
+ if (TraceIsOn("sygus-db"))
{
Node eop = datatypes::utils::getExpandedDefinitionForm(sop);
Trace("sygus-db") << "Expanded form: ";
}
if (d_samples_trie.add(sample_pt))
{
- if (Trace.isOn("sygus-sample"))
+ if (TraceIsOn("sygus-sample"))
{
Trace("sygus-sample") << "Sample point #" << i << " : ";
for (const Node& r : sample_pt)
}
}
Node lem = nm->mkOr(lits);
- if (Trace.isOn("term-db-lemma"))
+ if (TraceIsOn("term-db-lemma"))
{
Trace("term-db-lemma") << "Disequal congruent terms : " << at << " "
<< n << "!!!!" << std::endl;
nonCongruentCount++;
d_op_nonred_count[f]++;
}
- if (Trace.isOn("tdb"))
+ if (TraceIsOn("tdb"))
{
Trace("tdb") << "Term db size [" << f << "] : " << nonCongruentCount
<< " / ";
void TermTupleEnumeratorBase::failureReason(const std::vector<bool>& mask)
{
- if (Trace.isOn("inst-alg"))
+ if (TraceIsOn("inst-alg"))
{
traceMaskedVector("inst-alg", "failureReason", mask, d_termIndex);
}
{
return;
}
- Debug("quantifiers-prereg")
+ Trace("quantifiers-prereg")
<< "TheoryQuantifiers::preRegisterTerm() " << n << std::endl;
// Preregister the quantified formula.
// This initializes the modules used for handling n in this user context.
getQuantifiersEngine()->preRegisterQuantifier(n);
- Debug("quantifiers-prereg")
+ Trace("quantifiers-prereg")
<< "TheoryQuantifiers::preRegisterTerm() done " << n << std::endl;
}
void TheoryQuantifiers::presolve() {
- Debug("quantifiers-presolve") << "TheoryQuantifiers::presolve()" << std::endl;
+ Trace("quantifiers-presolve") << "TheoryQuantifiers::presolve()" << std::endl;
if( getQuantifiersEngine() ){
getQuantifiersEngine()->presolve();
}
for(assertions_iterator i = facts_begin(); i != facts_end(); ++i) {
if ((*i).d_assertion.getKind() == NOT)
{
- Debug("quantifiers::collectModelInfo")
+ Trace("quantifiers::collectModelInfo")
<< "got quant FALSE: " << (*i).d_assertion[0] << std::endl;
if (!m->assertPredicate((*i).d_assertion[0], false))
{
}
else
{
- Debug("quantifiers::collectModelInfo")
+ Trace("quantifiers::collectModelInfo")
<< "got quant TRUE : " << *i << std::endl;
if (!m->assertPredicate(*i, true))
{
TNode n,
bool check)
{
- Debug("typecheck-q") << "type check for fa " << n << std::endl;
+ Trace("typecheck-q") << "type check for fa " << n << std::endl;
Assert((n.getKind() == kind::FORALL || n.getKind() == kind::EXISTS)
&& n.getNumChildren() > 0);
if (check)
}
double clSet = 0;
- if( Trace.isOn("quant-engine") ){
+ if( TraceIsOn("quant-engine") ){
clSet = double(clock())/double(CLOCKS_PER_SEC);
Trace("quant-engine") << ">>>>> Quantifiers Engine Round, effort = " << e << " <<<<<" << std::endl;
}
- if( Trace.isOn("quant-engine-debug") ){
+ if( TraceIsOn("quant-engine-debug") ){
Trace("quant-engine-debug") << "Quantifiers Engine check, level = " << e << std::endl;
Trace("quant-engine-debug")
<< " depth : " << d_qstate.getInstRoundDepth() << std::endl;
Trace("quant-engine-debug")
<< " In conflict : " << d_qstate.isInConflict() << std::endl;
}
- if( Trace.isOn("quant-engine-ee-pre") ){
+ if( TraceIsOn("quant-engine-ee-pre") ){
Trace("quant-engine-ee-pre") << "Equality engine (pre-inference): " << std::endl;
d_qstate.debugPrintEqualityEngine("quant-engine-ee-pre");
}
- if( Trace.isOn("quant-engine-assert") ){
+ if( TraceIsOn("quant-engine-assert") ){
Trace("quant-engine-assert") << "Assertions : " << std::endl;
d_te->printAssertions("quant-engine-assert");
}
}
}
- if( Trace.isOn("quant-engine-ee") ){
+ if( TraceIsOn("quant-engine-ee") ){
Trace("quant-engine-ee") << "Equality engine : " << std::endl;
d_qstate.debugPrintEqualityEngine("quant-engine-ee");
}
d_qim.getInstantiate()->notifyEndRound();
d_numInstRoundsLemma++;
}
- if( Trace.isOn("quant-engine") ){
+ if( TraceIsOn("quant-engine") ){
double clSet2 = double(clock())/double(CLOCKS_PER_SEC);
Trace("quant-engine") << "Finished quantifiers engine, total time = " << (clSet2-clSet);
Trace("quant-engine") << ", sent lemma = " << d_qim.hasSentLemma();
TrustNode lem = d_qim.getSkolemize()->process(f);
if (!lem.isNull())
{
- if (Trace.isOn("quantifiers-sk-debug"))
+ if (TraceIsOn("quantifiers-sk-debug"))
{
Node slem = rewrite(lem.getNode());
Trace("quantifiers-sk-debug")
return;
}
}
- if (Trace.isOn("rel-manager"))
+ if (TraceIsOn("rel-manager"))
{
if (d_inFullEffortCheck)
{
std::vector<unsigned> varOrder;
if (d_rext->getVariableOrder(d_owner, varOrder))
{
- if (Trace.isOn("bound-int-rsi"))
+ if (TraceIsOn("bound-int-rsi"))
{
Trace("bound-int-rsi") << "Variable order : ";
for (unsigned i = 0; i < varOrder.size(); i++)
Assert(varOrder[i] < indexOrder.size());
indexOrder[varOrder[i]] = i;
}
- if (Trace.isOn("bound-int-rsi"))
+ if (TraceIsOn("bound-int-rsi"))
{
Trace("bound-int-rsi") << "Will use index order : ";
for (unsigned i = 0; i < indexOrder.size(); i++)
void RepSetIterator::debugPrint( const char* c ){
for( unsigned v=0; v<d_index.size(); v++ ){
- Debug( c ) << v << " : " << getCurrentTerm( v ) << std::endl;
+ Trace( c ) << v << " : " << getCurrentTerm( v ) << std::endl;
}
}
void RepSetIterator::debugPrintSmall( const char* c ){
- Debug( c ) << "RI: ";
+ Trace( c ) << "RI: ";
for( unsigned v=0; v<d_index.size(); v++ ){
- Debug( c ) << v << ": " << getCurrentTerm( v ) << " ";
+ Trace( c ) << v << ": " << getCurrentTerm( v ) << " ";
}
- Debug( c ) << std::endl;
+ Trace( c ) << std::endl;
}
} // namespace theory
TrustNode TheorySep::explain(TNode literal)
{
- Debug("sep") << "TheorySep::explain(" << literal << ")" << std::endl;
+ Trace("sep") << "TheorySep::explain(" << literal << ")" << std::endl;
return d_im.explainLit(literal);
}
/////////////////////////////////////////////////////////////////////////////
void TheorySep::computeCareGraph() {
- Debug("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl;
+ Trace("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl;
for (unsigned i = 0; i < d_sharedTerms.size(); ++ i) {
TNode a = d_sharedTerms[i];
TypeNode aType = a.getType();
}
}
// debug print
- if (Trace.isOn("sep-process"))
+ if (TraceIsOn("sep-process"))
{
Trace("sep-process") << "--- Current spatial assertions : " << std::endl;
for( NodeList::const_iterator i = d_spatial_assertions.begin(); i != d_spatial_assertions.end(); ++i ) {
}
Trace("sep-process") << "---" << std::endl;
}
- if (Trace.isOn("sep-eqc"))
+ if (TraceIsOn("sep-eqc"))
{
Trace("sep-eqc") << d_equalityEngine->debugPrintEqc();
}
}
else
{
- if( Trace.isOn("sep-inst") ){
+ if( TraceIsOn("sep-inst") ){
if( n.getKind()==kind::SEP_STAR || n.getKind()==kind::SEP_WAND || n.getKind()==kind::SEP_PTO || n.getKind()==kind::SEP_EMP ){
for( unsigned j=0; j<ind; j++ ){ Trace("sep-inst") << " "; }
Trace("sep-inst") << n << "[" << lbl << "] :: " << lbl_v << std::endl;
bool eqNotifyTriggerPredicate(TNode predicate, bool value) override
{
- Debug("sep::propagate")
+ Trace("sep::propagate")
<< "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", "
<< (value ? "true" : "false") << ")" << std::endl;
Assert(predicate.getKind() == kind::EQUAL);
TNode t2,
bool value) override
{
- Debug("sep::propagate")
+ Trace("sep::propagate")
<< "NotifyClass::eqNotifyTriggerTermEquality(" << t1 << ", " << t2
<< ", " << (value ? "true" : "false") << ")" << std::endl;
if (value)
void eqNotifyConstantTermMerge(TNode t1, TNode t2) override
{
- Debug("sep::propagate") << "NotifyClass::eqNotifyConstantTermMerge(" << t1
+ Trace("sep::propagate") << "NotifyClass::eqNotifyConstantTermMerge(" << t1
<< ", " << t2 << ")" << std::endl;
d_sep.conflict(t1, t2);
}
}
if (!only[0].empty() || !only[1].empty())
{
- if (Trace.isOn("sets-nf-debug"))
+ if (TraceIsOn("sets-nf-debug"))
{
Trace("sets-nf-debug") << "Unique venn regions : " << std::endl;
for (unsigned e = 0; e < 2; e++)
* Also handles the corner cases of empty set and singleton set.
*/
static bool checkNormalConstant(TNode n) {
- Debug("sets-checknormal") << "[sets-checknormal] checkNormal " << n << " :"
+ Trace("sets-checknormal") << "[sets-checknormal] checkNormal " << n << " :"
<< std::endl;
if (n.getKind() == kind::SET_EMPTY)
{
<< n[0] << std::endl;
return false;
}
- Debug("sets-checknormal")
+ Trace("sets-checknormal")
<< "[sets-checknormal] element = " << n[0][0] << " "
<< n[0][0].getId() << std::endl;
if (!prvs.isNull() && n[0][0] >= prvs)
<< " not due to final " << n << std::endl;
return false;
}
- Debug("sets-checknormal")
+ Trace("sets-checknormal")
<< "[sets-checknormal] lst element = " << n[0] << " "
<< n[0].getId() << std::endl;
// compare last ID
TrustNode tin, TrustSubstitutionMap& outSubstitutions)
{
TNode in = tin.getNode();
- Debug("sets-proc") << "ppAssert : " << in << std::endl;
+ Trace("sets-proc") << "ppAssert : " << in << std::endl;
Theory::PPAssertStatus status = Theory::PP_ASSERT_STATUS_UNSOLVED;
// this is based off of Theory::ppAssert
void TheorySets::NotifyClass::eqNotifyNewClass(TNode t)
{
- Debug("sets-eq") << "[sets-eq] eqNotifyNewClass:"
+ Trace("sets-eq") << "[sets-eq] eqNotifyNewClass:"
<< " t = " << t << std::endl;
d_theory.eqNotifyNewClass(t);
}
void TheorySets::NotifyClass::eqNotifyMerge(TNode t1, TNode t2)
{
- Debug("sets-eq") << "[sets-eq] eqNotifyMerge:"
+ Trace("sets-eq") << "[sets-eq] eqNotifyMerge:"
<< " t1 = " << t1 << " t2 = " << t2 << std::endl;
d_theory.eqNotifyMerge(t1, t2);
}
void TheorySets::NotifyClass::eqNotifyDisequal(TNode t1, TNode t2, TNode reason)
{
- Debug("sets-eq") << "[sets-eq] eqNotifyDisequal:"
+ Trace("sets-eq") << "[sets-eq] eqNotifyDisequal:"
<< " t1 = " << t1 << " t2 = " << t2 << " reason = " << reason
<< std::endl;
d_theory.eqNotifyDisequal(t1, t2, reason);
Trace("sets-eqc") << "...finished equality engine." << std::endl;
- if (Trace.isOn("sets-state"))
+ if (TraceIsOn("sets-state"))
{
Trace("sets-state") << "Equivalence class counters:" << std::endl;
for (std::pair<const TypeNode, unsigned>& ec : eqcTypeCount)
{
continue;
}
- if (Trace.isOn("sets-mem"))
+ if (TraceIsOn("sets-mem"))
{
const std::vector<Node>& sec = d_state.getSetsEqClasses();
for (const Node& s : sec)
Node TheorySetsPrivate::explain(TNode literal)
{
- Debug("sets") << "TheorySetsPrivate::explain(" << literal << ")" << std::endl;
+ Trace("sets") << "TheorySetsPrivate::explain(" << literal << ")" << std::endl;
bool polarity = literal.getKind() != kind::NOT;
TNode atom = polarity ? literal : literal[0];
}
else
{
- Debug("sets") << "unhandled: " << literal << "; (" << atom << ", "
+ Trace("sets") << "unhandled: " << literal << "; (" << atom << ", "
<< polarity << "); kind" << atom.getKind() << std::endl;
Unhandled();
}
void TheorySetsPrivate::preRegisterTerm(TNode node)
{
- Debug("sets") << "TheorySetsPrivate::preRegisterTerm(" << node << ")"
+ Trace("sets") << "TheorySetsPrivate::preRegisterTerm(" << node << ")"
<< std::endl;
TypeNode tn = node.getType();
if (tn.isSet())
TrustNode TheorySetsPrivate::ppRewrite(Node node,
std::vector<SkolemLemma>& lems)
{
- Debug("sets-proc") << "ppRewrite : " << node << std::endl;
+ Trace("sets-proc") << "ppRewrite : " << node << std::endl;
switch (node.getKind())
{
void TupleTrie::debugPrint( const char * c, Node n, unsigned depth ) {
for( std::map< Node, TupleTrie >::iterator it = d_data.begin(); it != d_data.end(); ++it ){
- for( unsigned i=0; i<depth; i++ ){ Debug(c) << " "; }
- Debug(c) << it->first << std::endl;
+ for( unsigned i=0; i<depth; i++ ){ Trace(c) << " "; }
+ Trace(c) << it->first << std::endl;
it->second.debugPrint( c, n, depth+1 );
}
}
TNode term,
TheoryIdSet theories)
{
- Debug("register") << "SharedTermsDatabase::addSharedTerm(" << atom << ", "
+ Trace("register") << "SharedTermsDatabase::addSharedTerm(" << atom << ", "
<< term << ", " << TheoryIdSetUtil::setToString(theories)
<< ")" << std::endl;
bool SharedTermsDatabase::propagateSharedEquality(TheoryId theory, TNode a, TNode b, bool value)
{
- Debug("shared-terms-database") << "SharedTermsDatabase::newEquality(" << theory << "," << a << "," << b << ", " << (value ? "true" : "false") << ")" << endl;
+ Trace("shared-terms-database") << "SharedTermsDatabase::newEquality(" << theory << "," << a << "," << b << ", " << (value ? "true" : "false") << ")" << endl;
if (d_inConflict) {
return false;
return;
}
- Debug("shared-terms-database") << "SharedTermsDatabase::markNotified(" << term << ")" << endl;
+ Trace("shared-terms-database") << "SharedTermsDatabase::markNotified(" << term << ")" << endl;
// First update the set of notified theories for this term
d_alreadyNotifiedMap[term] =
void SharedTermsDatabase::assertShared(TNode n, bool polarity, TNode reason)
{
Assert(d_equalityEngine != nullptr);
- Debug("shared-terms-database::assert")
+ Trace("shared-terms-database::assert")
<< "SharedTermsDatabase::assertShared(" << n << ", "
<< (polarity ? "true" : "false") << ", " << reason << ")" << endl;
// Add it to the equality engine
}
}
}
- if (Trace.isOn("sort-inference-rewrite"))
+ if (TraceIsOn("sort-inference-rewrite"))
{
Trace("sort-inference-rewrite")
<< "Add the following injections for " << tss.first
{
return false;
}
- if (Trace.isOn("strings-ent-approx"))
+ if (TraceIsOn("strings-ent-approx"))
{
Trace("strings-ent-approx")
<< "---- Check arithmetic entailment by under-approximation " << ar
NodeManager* nm = NodeManager::currentNM();
Trace("seq-array-debug") << "NTH SIZE: " << nthTerms.size() << std::endl;
- if (Trace.isOn("seq-array-terms"))
+ if (TraceIsOn("seq-array-terms"))
{
for (const Node& n : nthTerms)
{
}
Trace("seq-array-debug") << "UPDATE SIZE: " << updateTerms.size()
<< std::endl;
- if (Trace.isOn("seq-array-terms"))
+ if (TraceIsOn("seq-array-terms"))
{
for (const Node& n : updateTerms)
{
const std::map<Node, Node>& ArrayCoreSolver::getWriteModel(Node eqc)
{
- if (Trace.isOn("seq-write-model"))
+ if (TraceIsOn("seq-write-model"))
{
Trace("seq-write-model") << "write model of " << eqc << ":" << std::endl;
for (auto& x : d_writeModel[eqc])
}
++eqcs_i;
}
- if (Trace.isOn("strings-base"))
+ if (TraceIsOn("strings-base"))
{
for (const std::pair<const Kind, std::pair<uint32_t, uint32_t>>& cc :
congruentCount)
}
if (!isConst || !d_state.areEqual(n, c))
{
- if (Trace.isOn("strings-debug"))
+ if (TraceIsOn("strings-debug"))
{
Trace("strings-debug")
<< "Constant eqc : " << c << " for " << n << std::endl;
void CoreSolver::checkFlatForms()
{
// debug print flat forms
- if (Trace.isOn("strings-ff"))
+ if (TraceIsOn("strings-ff"))
{
Trace("strings-ff") << "Flat forms : " << std::endl;
debugPrintFlatForms("strings-ff");
Node lcc = d_state.getLength(bc, lexp2);
if (d_state.areEqual(lcurr, lcc))
{
- if (Trace.isOn("strings-ff-debug"))
+ if (TraceIsOn("strings-ff-debug"))
{
Trace("strings-ff-debug")
<< "Infer " << ac << " == " << bc << " since " << lcurr
Trace("strings-process-debug")
<< "Done verifying normal forms are the same for " << eqc << std::endl;
}
- if (Trace.isOn("strings-nf"))
+ if (TraceIsOn("strings-nf"))
{
Trace("strings-nf") << "**** Normal forms are : " << std::endl;
for (std::map<Node, Node>::iterator it = eqc_to_exp.begin();
{
for (const Node& nn : nfrv)
{
- if (Trace.isOn("strings-error"))
+ if (TraceIsOn("strings-error"))
{
if (nn.getKind() == STRING_CONCAT)
{
{
for (unsigned i = 0; i < currv.size(); i++)
{
- if (Trace.isOn("strings-error"))
+ if (TraceIsOn("strings-error"))
{
Trace("strings-error") << "Cycle for normal form ";
utils::printConcatTrace(currv, "strings-error");
nf_triv.init(eqc_non_c);
normal_forms.push_back(nf_triv);
}else{
- if(Trace.isOn("strings-solve")) {
+ if(TraceIsOn("strings-solve")) {
Trace("strings-solve") << "--- Normal forms for equivalance class " << eqc << " : " << std::endl;
for (unsigned i = 0, size = normal_forms.size(); i < size; i++)
{
{
n[i] = ee->getRepresentative(eq[i]);
}
- if (Trace.isOn("strings-solve"))
+ if (TraceIsOn("strings-solve"))
{
Trace("strings-solve") << "- Compare " << n[0] << ", nf ";
utils::printConcatTrace(getNormalForm(n[0]).d_nf, "strings-solve");
if (ei->d_normalizedLength.get().isNull())
{
Node nf = d_termReg.mkNConcat(nfi.d_nf, stype);
- if (Trace.isOn("strings-process-debug"))
+ if (TraceIsOn("strings-process-debug"))
{
Trace("strings-process-debug")
<< " normal form is " << nf << " from base " << nfi.d_base
{
checkExtfInference(n, to_reduce, einfo, effort);
}
- if (Trace.isOn("strings-extf-list"))
+ if (TraceIsOn("strings-extf-list"))
{
Trace("strings-extf-list") << " * " << to_reduce;
if (!einfo.d_const.isNull())
utils::flattenOp(AND, ec, ps.d_children);
}
// debug print
- if (Trace.isOn("strings-ipc-debug"))
+ if (TraceIsOn("strings-ipc-debug"))
{
Trace("strings-ipc-debug") << "InferProofCons::convert: " << infer
<< (isRev ? " :rev " : " ") << conc << std::endl;
if (!success)
{
// debug print
- if (Trace.isOn("strings-ipc-fail"))
+ if (TraceIsOn("strings-ipc-fail"))
{
Trace("strings-ipc-fail")
<< "InferProofCons::convert: Failed " << infer
// use the trust rule
ps.d_rule = PfRule::THEORY_INFERENCE;
}
- if (Trace.isOn("strings-ipc-debug"))
+ if (TraceIsOn("strings-ipc-debug"))
{
if (useBuffer)
{
InferInfo iiSubsLem(ii.getId());
iiSubsLem.d_sim = this;
iiSubsLem.d_conc = eqs;
- if (Trace.isOn("strings-lemma-debug"))
+ if (TraceIsOn("strings-lemma-debug"))
{
Trace("strings-lemma-debug")
<< "Strings::Infer " << iiSubsLem << std::endl;
addPendingLemma(std::unique_ptr<InferInfo>(new InferInfo(iiSubsLem)));
return;
}
- if (Trace.isOn("strings-lemma-debug"))
+ if (TraceIsOn("strings-lemma-debug"))
{
for (const Node& u : unproc)
{
{
if (a != b)
{
- Debug("strings-explain")
+ Trace("strings-explain")
<< "Add to explanation : " << a << " == " << b << std::endl;
Assert(d_state.areEqual(a, b));
exp.push_back(a.eqNode(b));
d_fset_cache[r] = p;
}
- if(Trace.isOn("regexp-fset")) {
+ if(TraceIsOn("regexp-fset")) {
Trace("regexp-fset") << "END FSET(" << mkString(r) << ") = {";
for (std::set<unsigned>::const_iterator it = pcset.begin();
it != pcset.end();
Unreachable();
}
}
- if(Trace.isOn("regexp-int-debug")) {
+ if(TraceIsOn("regexp-int-debug")) {
Trace("regexp-int-debug") << "Try CSET(" << cset.size() << ") = {";
for (std::vector<unsigned>::const_iterator it = cset.begin();
it != cset.end();
} while (!visit.empty());
Assert(visited.find(r) != visited.end());
Assert(!visited.find(r)->second.isNull());
- if (Trace.isOn("regexp-intersect"))
+ if (TraceIsOn("regexp-intersect"))
{
Trace("regexp-intersect") << "Remove INTERSECTION( " << mkString(r)
<< " ) = " << mkString(visited[r]) << std::endl;
{
lengthTerm = lengthTerm[0];
}
- Debug("strings") << "SolverState::getLengthTerm " << t << " is " << lengthTerm
+ Trace("strings") << "SolverState::getLengthTerm " << t << " is " << lengthTerm
<< std::endl;
if (te != lengthTerm)
{
TrustNode TheoryStrings::explain(TNode literal)
{
- Debug("strings-explain") << "explain called on " << literal << std::endl;
+ Trace("strings-explain") << "explain called on " << literal << std::endl;
return d_im.explainLit(literal);
}
void TheoryStrings::presolve() {
- Debug("strings-presolve")
+ Trace("strings-presolve")
<< "TheoryStrings::Presolving : get fmf options "
<< (options().strings.stringFMF ? "true" : "false") << std::endl;
d_strat.initializeStrategy();
d_stringsFmf.getDecisionStrategy(),
DecisionManager::STRAT_SCOPE_LOCAL_SOLVE);
}
- Debug("strings-presolve") << "Finished presolve" << std::endl;
+ Trace("strings-presolve") << "Finished presolve" << std::endl;
}
/////////////////////////////////////////////////////////////////////////////
bool TheoryStrings::collectModelValues(TheoryModel* m,
const std::set<Node>& termSet)
{
- if (Trace.isOn("strings-debug-model"))
+ if (TraceIsOn("strings-debug-model"))
{
Trace("strings-debug-model")
<< "TheoryStrings::collectModelValues" << std::endl;
if (processed.find(rn) == processed.end())
{
NormalForm& nf = d_csolver.getNormalForm(rn);
- if (Trace.isOn("strings-model"))
+ if (TraceIsOn("strings-model"))
{
Trace("strings-model")
<< "Construct model for " << rn << " based on normal form ";
{
Trace("strings-check-debug")
<< "Theory of strings " << e << " effort check " << std::endl;
- if (Trace.isOn("strings-eqc"))
+ if (TraceIsOn("strings-eqc"))
{
Trace("strings-eqc") << debugPrintStringsEqc() << std::endl;
}
// (2) unsuccessfully processed pending lemmas.
// In either case, we repeat the strategy if we are not in conflict.
sentLemma = d_im.hasSentLemma();
- if (Trace.isOn("strings-check"))
+ if (TraceIsOn("strings-check"))
{
Trace("strings-check") << " ...finish run strategy: ";
Trace("strings-check") << (hadPending ? "hadPending " : "");
NotifyClass(TheoryStrings& ts) : d_str(ts) {}
bool eqNotifyTriggerPredicate(TNode predicate, bool value) override
{
- Debug("strings") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate
+ Trace("strings") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate
<< ", " << (value ? "true" : "false") << ")" << std::endl;
if (value)
{
TNode t2,
bool value) override
{
- Debug("strings") << "NotifyClass::eqNotifyTriggerTermMerge(" << tag << ", " << t1 << ", " << t2 << ")" << std::endl;
+ Trace("strings") << "NotifyClass::eqNotifyTriggerTermMerge(" << tag << ", " << t1 << ", " << t2 << ")" << std::endl;
if (value) {
return d_str.propagateLit(t1.eqNode(t2));
}
}
void eqNotifyConstantTermMerge(TNode t1, TNode t2) override
{
- Debug("strings") << "NotifyClass::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << ")" << std::endl;
+ Trace("strings") << "NotifyClass::eqNotifyConstantTermMerge(" << t1 << ", " << t2 << ")" << std::endl;
d_str.conflict(t1, t2);
}
void eqNotifyNewClass(TNode t) override
{
- Debug("strings") << "NotifyClass::eqNotifyNewClass(" << t << std::endl;
+ Trace("strings") << "NotifyClass::eqNotifyNewClass(" << t << std::endl;
d_str.eqNotifyNewClass(t);
}
void eqNotifyMerge(TNode t1, TNode t2) override
{
- Debug("strings") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2
+ Trace("strings") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2
<< std::endl;
d_str.eqNotifyMerge(t1, t2);
}
std::set<TNode>* tracker,
const ShouldTraverseCallback* stc)
{
- Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << ")" << endl;
+ Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << ")" << endl;
if (d_substitutions.empty()) {
return t;
substitution_stack_element& stackHead = toVisit.back();
TNode current = stackHead.d_node;
- Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): processing " << current << endl;
+ Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): processing " << current << endl;
// If node already in the cache we're done, pop from the stack
NodeCache::iterator find = cache.find(current);
}
}
}
- Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << result << endl;
+ Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << result << endl;
cache[current] = result;
toVisit.pop_back();
}
else
{
// No children, so we're done
- Debug("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << current << endl;
+ Trace("substitution::internal") << "SubstitutionMap::internalSubstitute(" << t << "): setting " << current << " -> " << current << endl;
cache[current] = current;
toVisit.pop_back();
}
void SubstitutionMap::addSubstitution(TNode x, TNode t, bool invalidateCache)
{
- Debug("substitution") << "SubstitutionMap::addSubstitution(" << x << ", " << t << ")" << endl;
+ Trace("substitution") << "SubstitutionMap::addSubstitution(" << x << ", " << t << ")" << endl;
Assert(d_substitutions.find(x) == d_substitutions.end());
// this causes a later assert-fail (the rhs != current one, above) anyway
std::set<TNode>* tracker,
const ShouldTraverseCallback* stc)
{
- Debug("substitution") << "SubstitutionMap::apply(" << t << ")" << endl;
+ Trace("substitution") << "SubstitutionMap::apply(" << t << ")" << endl;
// Setup the cache
if (d_cacheInvalidated) {
d_substitutionCache.clear();
d_cacheInvalidated = false;
- Debug("substitution") << "-- reset the cache" << endl;
+ Trace("substitution") << "-- reset the cache" << endl;
}
// Perform the substitution
Node result = internalSubstitute(t, d_substitutionCache, tracker, stc);
- Debug("substitution") << "SubstitutionMap::apply(" << t << ") => " << result << endl;
+ Trace("substitution") << "SubstitutionMap::apply(" << t << ") => " << result << endl;
if (r != nullptr)
{
bool PreRegisterVisitor::alreadyVisited(TNode current, TNode parent) {
- Debug("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
+ Trace("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
if ((parent.isClosure()
|| parent.getKind() == kind::SEP_STAR
)
&& current != parent)
{
- Debug("register::internal") << "quantifier:true" << std::endl;
+ Trace("register::internal") << "quantifier:true" << std::endl;
return true;
}
void PreRegisterVisitor::visit(TNode current, TNode parent) {
- Debug("register") << "PreRegisterVisitor::visit(" << current << "," << parent << ")" << std::endl;
- if (Debug.isOn("register::internal")) {
- Debug("register::internal") << toString() << std::endl;
+ Trace("register") << "PreRegisterVisitor::visit(" << current << "," << parent << ")" << std::endl;
+ if (TraceIsOn("register::internal")) {
+ Trace("register::internal") << toString() << std::endl;
}
// get the theories we already preregistered with
preRegister(
d_env, d_engine, visitedTheories, current, parent, visitedTheories);
- Debug("register::internal")
+ Trace("register::internal")
<< "PreRegisterVisitor::visit(" << current << "," << parent
<< "): now registered with "
<< TheoryIdSetUtil::setToString(visitedTheories) << std::endl;
}
if (Configuration::isAssertionBuild())
{
- Debug("register::internal")
+ Trace("register::internal")
<< "PreRegisterVisitor::visit(" << current << "," << parent
<< "): adding " << id << std::endl;
// This should never throw an exception, since theories should be
bool SharedTermsVisitor::alreadyVisited(TNode current, TNode parent) const {
- Debug("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
+ Trace("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
if ((parent.isClosure()
|| parent.getKind() == kind::SEP_STAR
)
&& current != parent)
{
- Debug("register::internal") << "quantifier:true" << std::endl;
+ Trace("register::internal") << "quantifier:true" << std::endl;
return true;
}
TNodeVisitedMap::const_iterator find = d_visited.find(current);
// If node is not visited at all, just return false
if (find == d_visited.end()) {
- Debug("register::internal") << "1:false" << std::endl;
+ Trace("register::internal") << "1:false" << std::endl;
return false;
}
void SharedTermsVisitor::visit(TNode current, TNode parent) {
- Debug("register") << "SharedTermsVisitor::visit(" << current << "," << parent << ")" << std::endl;
- if (Debug.isOn("register::internal")) {
- Debug("register::internal") << toString() << std::endl;
+ Trace("register") << "SharedTermsVisitor::visit(" << current << "," << parent << ")" << std::endl;
+ if (TraceIsOn("register::internal")) {
+ Trace("register::internal") << toString() << std::endl;
}
TheoryIdSet visitedTheories = d_visited[current];
TheoryIdSet preregTheories = d_preregistered[current];
}
void Theory::computeCareGraph() {
- Debug("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl;
+ Trace("sharing") << "Theory::computeCareGraph<" << getId() << ">()" << endl;
for (unsigned i = 0; i < d_sharedTerms.size(); ++ i) {
TNode a = d_sharedTerms[i];
TypeNode aType = a.getType();
}
void Theory::debugPrintFacts() const{
- DebugChannel.getStream() << "Theory::debugPrintFacts()" << endl;
- printFacts(DebugChannel.getStream());
+ TraceChannel.getStream() << "Theory::debugPrintFacts()" << endl;
+ printFacts(TraceChannel.getStream());
}
bool Theory::isLegalElimination(TNode x, TNode val)
void Theory::addSharedTerm(TNode n)
{
- Debug("sharing") << "Theory::addSharedTerm<" << getId() << ">(" << n << ")"
+ Trace("sharing") << "Theory::addSharedTerm<" << getId() << ">(" << n << ")"
<< std::endl;
- Debug("theory::assertions")
+ Trace("theory::assertions")
<< "Theory::addSharedTerm<" << getId() << ">(" << n << ")" << std::endl;
d_sharedTerms.push_back(n);
// now call theory-specific method notifySharedTerm
void TheoryEngine::interrupt() { d_interrupted = true; }
void TheoryEngine::preRegister(TNode preprocessed) {
- Debug("theory") << "TheoryEngine::preRegister( " << preprocessed << ")"
+ Trace("theory") << "TheoryEngine::preRegister( " << preprocessed << ")"
<< std::endl;
d_preregisterQueue.push(preprocessed);
d_preregisterQueue.pop();
// the atom should not have free variables
- Debug("theory") << "TheoryEngine::preRegister: " << preprocessed
+ Trace("theory") << "TheoryEngine::preRegister: " << preprocessed
<< std::endl;
if (Configuration::isAssertionBuild())
{
}
void TheoryEngine::printAssertions(const char* tag) {
- if (Trace.isOn(tag)) {
+ if (TraceIsOn(tag)) {
for (TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) {
Theory* theory = d_theoryTable[theoryId];
theoryOf(THEORY)->check(effort); \
if (d_inConflict) \
{ \
- Debug("conflict") << THEORY << " in conflict. " << std::endl; \
+ Trace("conflict") << THEORY << " in conflict. " << std::endl; \
break; \
} \
}
// Mark the lemmas flag (no lemmas added)
d_lemmasAdded = false;
- Debug("theory") << "TheoryEngine::check(" << effort << "): d_factsAsserted = " << (d_factsAsserted ? "true" : "false") << endl;
+ Trace("theory") << "TheoryEngine::check(" << effort << "): d_factsAsserted = " << (d_factsAsserted ? "true" : "false") << endl;
// If in full effort, we have a fake new assertion just to jumpstart the checking
if (Theory::fullEffort(effort)) {
// Check until done
while (d_factsAsserted && !d_inConflict && !d_lemmasAdded) {
- Debug("theory") << "TheoryEngine::check(" << effort << "): running check" << endl;
+ Trace("theory") << "TheoryEngine::check(" << effort << "): running check" << endl;
Trace("theory::assertions") << endl;
- if (Trace.isOn("theory::assertions")) {
+ if (TraceIsOn("theory::assertions")) {
printAssertions("theory::assertions");
}
if(Theory::fullEffort(effort)) {
Trace("theory::assertions::fulleffort") << endl;
- if (Trace.isOn("theory::assertions::fulleffort")) {
+ if (TraceIsOn("theory::assertions::fulleffort")) {
printAssertions("theory::assertions::fulleffort");
}
}
// Do the checking
CVC5_FOR_EACH_THEORY;
- Debug("theory") << "TheoryEngine::check(" << effort << "): running propagation after the initial check" << endl;
+ Trace("theory") << "TheoryEngine::check(" << effort << "): running propagation after the initial check" << endl;
// We are still satisfiable, propagate as much as possible
propagate(effort);
&& !d_factsAsserted && !needCheck() && !d_inConflict)
{
// Do the combination
- Debug("theory") << "TheoryEngine::check(" << effort << "): running combination" << endl;
+ Trace("theory") << "TheoryEngine::check(" << effort << "): running combination" << endl;
{
TimerStat::CodeTimer combineTheoriesTimer(d_combineTheoriesTime);
d_tc->combineTheories();
// Must consult quantifiers theory for last call to ensure sat, or otherwise add a lemma
if( Theory::fullEffort(effort) && ! d_inConflict && ! needCheck() ) {
Trace("theory::assertions-model") << endl;
- if (Trace.isOn("theory::assertions-model")) {
+ if (TraceIsOn("theory::assertions-model")) {
printAssertions("theory::assertions-model");
}
// reset the model in the combination engine
}
}
- Debug("theory") << "TheoryEngine::check(" << effort << "): done, we are " << (d_inConflict ? "unsat" : "sat") << (d_lemmasAdded ? " with new lemmas" : " with no new lemmas");
- Debug("theory") << ", need check = " << (needCheck() ? "YES" : "NO") << endl;
+ Trace("theory") << "TheoryEngine::check(" << effort << "): done, we are " << (d_inConflict ? "unsat" : "sat") << (d_lemmasAdded ? " with new lemmas" : " with no new lemmas");
+ Trace("theory") << ", need check = " << (needCheck() ? "YES" : "NO") << endl;
if (Theory::fullEffort(effort))
{
if (conflict.getKind() == kind::AND) {
for (unsigned i = 0; i < conflict.getNumChildren(); ++ i) {
if (! getPropEngine()->hasValue(conflict[i], value)) {
- Debug("properConflict") << "Bad conflict is due to unassigned atom: "
+ Trace("properConflict") << "Bad conflict is due to unassigned atom: "
<< conflict[i] << endl;
return false;
}
if (! value) {
- Debug("properConflict") << "Bad conflict is due to false atom: "
+ Trace("properConflict") << "Bad conflict is due to false atom: "
<< conflict[i] << endl;
return false;
}
if (conflict[i] != rewrite(conflict[i]))
{
- Debug("properConflict")
+ Trace("properConflict")
<< "Bad conflict is due to atom not in normal form: " << conflict[i]
<< " vs " << rewrite(conflict[i]) << endl;
return false;
}
} else {
if (! getPropEngine()->hasValue(conflict, value)) {
- Debug("properConflict") << "Bad conflict is due to unassigned atom: "
+ Trace("properConflict") << "Bad conflict is due to unassigned atom: "
<< conflict << endl;
return false;
}
if(! value) {
- Debug("properConflict") << "Bad conflict is due to false atom: "
+ Trace("properConflict") << "Bad conflict is due to false atom: "
<< conflict << endl;
return false;
}
if (conflict != rewrite(conflict))
{
- Debug("properConflict")
+ Trace("properConflict")
<< "Bad conflict is due to atom not in normal form: " << conflict
<< " vs " << rewrite(conflict) << endl;
return false;
const AtomRequests::Request& request = it.get();
Node toAssert =
polarity ? (Node)request.d_atom : request.d_atom.notNode();
- Debug("theory::atoms") << "TheoryEngine::assertFact(" << literal
+ Trace("theory::atoms") << "TheoryEngine::assertFact(" << literal
<< "): sending requested " << toAssert << endl;
assertToTheory(
toAssert, literal, request.d_toTheory, THEORY_SAT_SOLVER);
}
bool TheoryEngine::propagate(TNode literal, theory::TheoryId theory) {
- Debug("theory::propagate")
+ Trace("theory::propagate")
<< "TheoryEngine::propagate(" << literal << ", " << theory << ")" << endl;
Trace("dtview::prop") << std::string(context()->getLevel(), ' ')
TrustNode TheoryEngine::getExplanation(TNode node)
{
- Debug("theory::explain") << "TheoryEngine::getExplanation(" << node
+ Trace("theory::explain") << "TheoryEngine::getExplanation(" << node
<< "): current propagation index = "
<< d_propagationMapTimestamp << endl;
bool polarity = node.getKind() != kind::NOT;
// If we're not in shared mode, explanations are simple
if (!d_logicInfo.isSharingEnabled())
{
- Debug("theory::explain")
+ Trace("theory::explain")
<< "TheoryEngine::getExplanation: sharing is NOT enabled. "
<< " Responsible theory is: " << theoryOf(atom)->getId() << std::endl;
TrustNode texplanation = theoryOf(atom)->explain(node);
Node explanation = texplanation.getNode();
- Debug("theory::explain") << "TheoryEngine::getExplanation(" << node
+ Trace("theory::explain") << "TheoryEngine::getExplanation(" << node
<< ") => " << explanation << endl;
if (isProofEnabled())
{
return texplanation;
}
- Debug("theory::explain") << "TheoryEngine::getExplanation: sharing IS enabled"
+ Trace("theory::explain") << "TheoryEngine::getExplanation: sharing IS enabled"
<< std::endl;
// Initial thing to explain
Assert(d_propagationMap.find(toExplain) != d_propagationMap.end());
NodeTheoryPair nodeExplainerPair = d_propagationMap[toExplain];
- Debug("theory::explain")
+ Trace("theory::explain")
<< "TheoryEngine::getExplanation: explainer for node "
<< nodeExplainerPair.d_node
<< " is theory: " << nodeExplainerPair.d_theory << std::endl;
std::vector<NodeTheoryPair> vec{d_propagationMap[toExplain]};
// Process the explanation
TrustNode texplanation = getExplanation(vec);
- Debug("theory::explain") << "TheoryEngine::getExplanation(" << node << ") => "
+ Trace("theory::explain") << "TheoryEngine::getExplanation(" << node << ") => "
<< texplanation.getNode() << endl;
return texplanation;
}
void TheoryEngine::ensureLemmaAtoms(TNode n, theory::TheoryId atomsTo)
{
Assert(atomsTo != THEORY_LAST);
- Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(" << n << ", "
+ Trace("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(" << n << ", "
<< atomsTo << ")" << endl;
AtomsCollect collectAtoms;
NodeVisitor<AtomsCollect>::run(collectAtoms, n);
// Rewrite the equality
Node eqNormalized = rewrite(atoms[i]);
- Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq
+ Trace("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq
<< " with nf " << eqNormalized << endl;
// If the equality is a boolean constant, we send immediately
Assert(tconflict.getKind() == TrustNodeKind::CONFLICT);
TNode conflict = tconflict.getNode();
- Debug("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", "
+ Trace("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", "
<< theoryId << ")" << endl;
Trace("te-proof-debug") << "Check closed conflict" << std::endl;
// doesn't require proof generator, yet, since THEORY_LEMMA is added below
// pass the processed trust node
TrustNode tconf =
TrustNode::mkTrustConflict(fullConflict, d_lazyProof.get());
- Debug("theory::conflict")
+ Trace("theory::conflict")
<< "TheoryEngine::conflict(" << conflict << ", " << theoryId
<< "): full = " << fullConflict << endl;
Assert(properConflict(fullConflict));
// Get the current literal to explain
NodeTheoryPair toExplain = explanationVector[i];
- Debug("theory::explain")
+ Trace("theory::explain")
<< "[i=" << i << "] TheoryEngine::explain(): processing ["
<< toExplain.d_timestamp << "] " << toExplain.d_node << " sent from "
<< toExplain.d_theory << endl;
// If from the SAT solver, keep it
if (toExplain.d_theory == THEORY_SAT_SOLVER)
{
- Debug("theory::explain")
+ Trace("theory::explain")
<< "\tLiteral came from THEORY_SAT_SOLVER. Keeping it." << endl;
exp.insert(explanationVector[i++].d_node);
// it will be a free assumption in the proof
// If an and, expand it
if (toExplain.d_node.getKind() == kind::AND)
{
- Debug("theory::explain")
+ Trace("theory::explain")
<< "TheoryEngine::explain(): expanding " << toExplain.d_node
<< " got from " << toExplain.d_theory << endl;
size_t nchild = toExplain.d_node.getNumChildren();
// See if it was sent to the theory by another theory
PropagationMap::const_iterator find = d_propagationMap.find(toExplain);
if (find != d_propagationMap.end()) {
- Debug("theory::explain")
+ Trace("theory::explain")
<< "\tTerm was propagated by another theory (theory = "
<< getTheoryString((*find).second.d_theory) << ")" << std::endl;
// There is some propagation, check if its a timely one
if ((*find).second.d_timestamp < toExplain.d_timestamp)
{
- Debug("theory::explain")
+ Trace("theory::explain")
<< "\tRelevant timetsamp, pushing " << (*find).second.d_node
<< "to index = " << explanationVector.size() << std::endl;
explanationVector.push_back((*find).second);
}
Node explanation = texplanation.getNode();
- Debug("theory::explain")
+ Trace("theory::explain")
<< "TheoryEngine::explain(): got explanation " << explanation
<< " got from " << toExplain.d_theory << endl;
Assert(explanation != toExplain.d_node)
// build the proof
if (lcp != nullptr)
{
- if (Trace.isOn("te-proof-exp"))
+ if (TraceIsOn("te-proof-exp"))
{
Trace("te-proof-exp") << "Explanation is:" << std::endl;
for (TNode e : exp)
for (; d_propagatedLiteralsIndex < d_propagatedLiterals.size();
d_propagatedLiteralsIndex = d_propagatedLiteralsIndex + 1)
{
- Debug("getPropagatedLiterals")
+ Trace("getPropagatedLiterals")
<< "TheoryEngine::getPropagatedLiterals: propagating: "
<< d_propagatedLiterals[d_propagatedLiteralsIndex] << std::endl;
literals.push_back(d_propagatedLiterals[d_propagatedLiteralsIndex]);
//apply substitutions
Node nn = d_env.getTopLevelSubstitutions().apply(n);
nn = rewrite(nn);
- Debug("model-getvalue-debug") << "[model-getvalue] getValue : substitute " << n << " to " << nn << std::endl;
+ Trace("model-getvalue-debug") << "[model-getvalue] getValue : substitute " << n << " to " << nn << std::endl;
//get value in model
nn = getModelValue(nn);
if (nn.isNull())
//normalize
nn = rewrite(nn);
}
- Debug("model-getvalue") << "[model-getvalue] getValue( " << n << " ): " << std::endl
+ Trace("model-getvalue") << "[model-getvalue] getValue( " << n << " ): " << std::endl
<< "[model-getvalue] returning " << nn << std::endl;
Assert(nn.getType().isSubtypeOf(n.getType()));
return nn;
//for now, we only handle cardinalities for uninterpreted sorts
if (!tn.isSort())
{
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "Get cardinality other sort, unknown." << std::endl;
return Cardinality( CardinalityUnknown() );
}
if (d_rep_set.hasType(tn))
{
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "Get cardinality sort, #rep : "
<< d_rep_set.getNumRepresentatives(tn) << std::endl;
return Cardinality(d_rep_set.getNumRepresentatives(tn));
}
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "Get cardinality sort, unconstrained, return 1." << std::endl;
return Cardinality(1);
}
if (it != d_modelCache.end()) {
return (*it).second;
}
- Debug("model-getvalue-debug") << "Get model value " << n << " ... ";
- Debug("model-getvalue-debug") << d_equalityEngine->hasTerm(n) << std::endl;
+ Trace("model-getvalue-debug") << "Get model value " << n << " ... ";
+ Trace("model-getvalue-debug") << d_equalityEngine->hasTerm(n) << std::endl;
Kind nk = n.getKind();
if (n.isConst() || nk == BOUND_VARIABLE)
{
// e.g. forall x. P(x) where P = lambda x. true.
if (n.getNumChildren() > 0)
{
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "Get model value children " << n << std::endl;
std::vector<Node> children;
if (n.getKind() == APPLY_UF)
{
Node op = getModelValue(n.getOperator());
- Debug("model-getvalue-debug") << " operator : " << op << std::endl;
+ Trace("model-getvalue-debug") << " operator : " << op << std::endl;
children.push_back(op);
}
else if (n.getMetaKind() == kind::metakind::PARAMETERIZED)
{
ret = getModelValue(n[i]);
}
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< " " << n << "[" << i << "] is " << ret << std::endl;
children.push_back(ret);
}
ret = nm->mkNode(n.getKind(), children);
- Debug("model-getvalue-debug") << "ret (pre-rewrite): " << ret << std::endl;
+ Trace("model-getvalue-debug") << "ret (pre-rewrite): " << ret << std::endl;
ret = rewrite(ret);
- Debug("model-getvalue-debug") << "ret (post-rewrite): " << ret << std::endl;
+ Trace("model-getvalue-debug") << "ret (post-rewrite): " << ret << std::endl;
// special cases
if (ret.getKind() == kind::CARDINALITY_CONSTRAINT)
{
const CardinalityConstraint& cc =
ret.getOperator().getConst<CardinalityConstraint>();
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "get cardinality constraint " << cc.getType() << std::endl;
ret = nm->mkConst(getCardinality(cc.getType()).getFiniteCardinality()
<= cc.getUpperBound());
}
if (eeHasTerm)
{
- Debug("model-getvalue-debug")
+ Trace("model-getvalue-debug")
<< "get value from representative " << ret << "..." << std::endl;
ret = d_equalityEngine->getRepresentative(ret);
Assert(d_reps.find(ret) != d_reps.end());
std::sort(funcs_to_assign.begin(), funcs_to_assign.end(), sts);
}
- if (Trace.isOn("model-builder"))
+ if (TraceIsOn("model-builder"))
{
Trace("model-builder") << "...have " << funcs_to_assign.size()
<< " functions to assign:" << std::endl;
TrustNode tpp = theoryPreprocess(irNode, newLemmas);
Node ppNode = tpp.getNode();
- if (Trace.isOn("tpp-debug"))
+ if (TraceIsOn("tpp-debug"))
{
if (node != irNode)
{
}
void Region::setDisequal( Node n1, Node n2, int type, bool valid ){
- //Debug("uf-ss-region-debug") << "set disequal " << n1 << " " << n2 << " "
+ //Trace("uf-ss-region-debug") << "set disequal " << n1 << " " << n2 << " "
// << type << " " << valid << std::endl;
//debugPrint("uf-ss-region-debug");
//Assert( isDisequal( n1, n2, type )!=valid );
d_testClique.find( n2 )!=d_testClique.end() && d_testClique[n2] ){
Node eq = NodeManager::currentNM()->mkNode( EQUAL, n1, n2 );
if( d_splits.find( eq )!=d_splits.end() && d_splits[ eq ] ){
- Debug("uf-ss-debug") << "removing split for " << n1 << " " << n2
+ Trace("uf-ss-debug") << "removing split for " << n1 << " " << n2
<< std::endl;
d_splits[ eq ] = false;
d_splitsSize = d_splitsSize - 1;
}
//check splits internal to new members
for( int j=0; j<(int)newClique.size(); j++ ){
- Debug("uf-ss-debug") << "Choose to add clique member "
+ Trace("uf-ss-debug") << "Choose to add clique member "
<< newClique[j] << std::endl;
for( int k=(j+1); k<(int)newClique.size(); k++ ){
if( !isDisequal( newClique[j], newClique[k], 1 ) ){
}
void Region::debugPrint( const char* c, bool incClique ) {
- Debug( c ) << "Num reps: " << d_reps_size << std::endl;
+ Trace( c ) << "Num reps: " << d_reps_size << std::endl;
for( Region::iterator it = begin(); it != end(); ++it ){
RegionNodeInfo* rni = it->second;
if( rni->valid() ){
Node n = it->first;
- Debug( c ) << " " << n << std::endl;
+ Trace( c ) << " " << n << std::endl;
for( int i=0; i<2; i++ ){
- Debug( c ) << " " << ( i==0 ? "Ext" : "Int" ) << " disequal:";
+ Trace( c ) << " " << ( i==0 ? "Ext" : "Int" ) << " disequal:";
DiseqList* del = rni->get(i);
for( DiseqList::iterator it2 = del->begin(); it2 != del->end(); ++it2 ){
if( (*it2).second ){
- Debug( c ) << " " << (*it2).first;
+ Trace( c ) << " " << (*it2).first;
}
}
- Debug( c ) << ", total = " << del->size() << std::endl;
+ Trace( c ) << ", total = " << del->size() << std::endl;
}
}
}
- Debug( c ) << "Total disequal: " << d_total_diseq_external << " external,";
- Debug( c ) << " " << d_total_diseq_internal << " internal." << std::endl;
+ Trace( c ) << "Total disequal: " << d_total_diseq_external << " external,";
+ Trace( c ) << " " << d_total_diseq_internal << " internal." << std::endl;
if( incClique ){
if( !d_testClique.empty() ){
- Debug( c ) << "Candidate clique members: " << std::endl;
- Debug( c ) << " ";
+ Trace( c ) << "Candidate clique members: " << std::endl;
+ Trace( c ) << " ";
for( NodeBoolMap::iterator it = d_testClique.begin();
it != d_testClique.end(); ++ it ){
if( (*it).second ){
- Debug( c ) << (*it).first << " ";
+ Trace( c ) << (*it).first << " ";
}
}
- Debug( c ) << ", size = " << d_testCliqueSize << std::endl;
+ Trace( c ) << ", size = " << d_testCliqueSize << std::endl;
}
if( !d_splits.empty() ){
- Debug( c ) << "Required splits: " << std::endl;
- Debug( c ) << " ";
+ Trace( c ) << "Required splits: " << std::endl;
+ Trace( c ) << " ";
for( NodeBoolMap::iterator it = d_splits.begin(); it != d_splits.end();
++ it ){
if( (*it).second ){
- Debug( c ) << (*it).first << " ";
+ Trace( c ) << (*it).first << " ";
}
}
- Debug( c ) << ", size = " << d_splitsSize << std::endl;
+ Trace( c ) << ", size = " << d_splitsSize << std::endl;
}
}
}
{
if( d_regions_map.find( n )==d_regions_map.end() ){
d_regions_map[n] = d_regions_index;
- Debug("uf-ss") << "CardinalityExtension: New Eq Class " << n << std::endl;
- Debug("uf-ss-debug") << d_regions_index << " " << (int)d_regions.size()
+ Trace("uf-ss") << "CardinalityExtension: New Eq Class " << n << std::endl;
+ Trace("uf-ss-debug") << d_regions_index << " " << (int)d_regions.size()
<< std::endl;
if (d_regions_index < d_regions.size())
{
{
return;
}
- Debug("uf-ss") << "CardinalityExtension: Merging " << a << " = " << b << "..."
+ Trace("uf-ss") << "CardinalityExtension: Merging " << a << " = " << b << "..."
<< std::endl;
if (a != b)
{
Assert(d_regions_map.find(b) != d_regions_map.end());
int ai = d_regions_map[a];
int bi = d_regions_map[b];
- Debug("uf-ss") << " regions: " << ai << " " << bi << std::endl;
+ Trace("uf-ss") << " regions: " << ai << " " << bi << std::endl;
if (ai != bi)
{
if (d_regions[ai]->getNumReps() == 1)
// already disequal
return;
}
- Debug("uf-ss") << "Assert disequal " << a << " != " << b << "..."
+ Trace("uf-ss") << "Assert disequal " << a << " != " << b << "..."
<< std::endl;
- Debug("uf-ss-disequal") << "Assert disequal " << a << " != " << b << "..."
+ Trace("uf-ss-disequal") << "Assert disequal " << a << " != " << b << "..."
<< std::endl;
// add to list of disequalities
if (d_disequalities_index < d_disequalities.size())
// now, add disequalities to regions
Assert(d_regions_map.find(a) != d_regions_map.end());
Assert(d_regions_map.find(b) != d_regions_map.end());
- Debug("uf-ss") << " regions: " << ai << " " << bi << std::endl;
+ Trace("uf-ss") << " regions: " << ai << " " << bi << std::endl;
if (ai == bi)
{
// internal disequality
// not necessary to check
return;
}
- Debug("uf-ss") << "CardinalityExtension: Check " << level << " " << d_type
+ Trace("uf-ss") << "CardinalityExtension: Check " << level << " " << d_type
<< std::endl;
if (level == Theory::EFFORT_FULL)
{
- Debug("fmf-full-check") << std::endl;
- Debug("fmf-full-check")
+ Trace("fmf-full-check") << std::endl;
+ Trace("fmf-full-check")
<< "Full check for SortModel " << d_type << ", status : " << std::endl;
debugPrint("fmf-full-check");
- Debug("fmf-full-check") << std::endl;
+ Trace("fmf-full-check") << std::endl;
}
if (d_reps <= (unsigned)d_cardinality)
{
- Debug("uf-ss-debug") << "We have " << d_reps << " representatives for type "
+ Trace("uf-ss-debug") << "We have " << d_reps << " representatives for type "
<< d_type << ", <= " << d_cardinality << std::endl;
if( level==Theory::EFFORT_FULL ){
- Debug("uf-ss-sat") << "We have " << d_reps << " representatives for type "
+ Trace("uf-ss-sat") << "We have " << d_reps << " representatives for type "
<< d_type << ", <= " << d_cardinality << std::endl;
}
return;
int sort_id = si->getSortId(op);
if (sortsFound.find(sort_id) != sortsFound.end())
{
- Debug("fmf-full-check") << "Combined regions " << i << " "
+ Trace("fmf-full-check") << "Combined regions " << i << " "
<< sortsFound[sort_id] << std::endl;
combineRegions(sortsFound[sort_id], i);
recheck = true;
if (d_regions[i]->valid())
{
int fcr = forceCombineRegion(i, false);
- Debug("fmf-full-check")
+ Trace("fmf-full-check")
<< "Combined regions " << i << " " << fcr << std::endl;
Trace("uf-ss-debug")
<< "Combined regions " << i << " " << fcr << std::endl;
return -1;
}else{
//this region must merge with another
- if( Debug.isOn("uf-ss-check-region") ){
- Debug("uf-ss-check-region") << "We must combine Region #" << ri << ". " << std::endl;
+ if( TraceIsOn("uf-ss-check-region") ){
+ Trace("uf-ss-check-region") << "We must combine Region #" << ri << ". " << std::endl;
d_regions[ri]->debugPrint("uf-ss-check-region");
}
//take region with maximum disequality density
std::map< int, int > regions_diseq;
getDisequalitiesToRegions( ri, regions_diseq );
for( std::map< int, int >::iterator it = regions_diseq.begin(); it != regions_diseq.end(); ++it ){
- Debug("uf-ss-check-region") << it->first << " : " << it->second << std::endl;
+ Trace("uf-ss-check-region") << it->first << " : " << it->second << std::endl;
}
for( std::map< int, int >::iterator it = regions_diseq.begin(); it != regions_diseq.end(); ++it ){
Assert(it->first != ri);
}
}
if( maxRegion!=-1 ){
- if( Debug.isOn("uf-ss-check-region") ){
- Debug("uf-ss-check-region") << "Combine with region #" << maxRegion << ":" << std::endl;
+ if( TraceIsOn("uf-ss-check-region") ){
+ Trace("uf-ss-check-region") << "Combine with region #" << maxRegion << ":" << std::endl;
d_regions[maxRegion]->debugPrint("uf-ss-check-region");
}
return combineRegions( ri, maxRegion );
int SortModel::combineRegions( int ai, int bi ){
- Debug("uf-ss-region") << "uf-ss: Combine Region #" << bi << " with Region #" << ai << std::endl;
+ Trace("uf-ss-region") << "uf-ss: Combine Region #" << bi << " with Region #" << ai << std::endl;
Assert(isValid(ai) && isValid(bi));
Region* region_bi = d_regions[bi];
for(Region::iterator it = region_bi->begin(); it != region_bi->end(); ++it){
}
void SortModel::moveNode( Node n, int ri ){
- Debug("uf-ss-region") << "uf-ss: Move node " << n << " to Region #" << ri << std::endl;
+ Trace("uf-ss-region") << "uf-ss: Move node " << n << " to Region #" << ri << std::endl;
Assert(isValid(d_regions_map[n]));
Assert(isValid(ri));
//move node to region ri
AlwaysAssert(false) << "Bad split " << s << std::endl;
}
}
- if (Trace.isOn("uf-ss-split-si"))
+ if (TraceIsOn("uf-ss-split-si"))
{
SortInference* si = d_state.getSortInference();
if (si != nullptr)
}
void SortModel::debugPrint( const char* c ){
- if( Debug.isOn( c ) ){
- Debug( c ) << "Number of reps = " << d_reps << std::endl;
- Debug( c ) << "Cardinality req = " << d_cardinality << std::endl;
+ if( TraceIsOn( c ) ){
+ Trace( c ) << "Number of reps = " << d_reps << std::endl;
+ Trace( c ) << "Cardinality req = " << d_cardinality << std::endl;
unsigned debugReps = 0;
for( unsigned i=0; i<d_regions_index; i++ ){
Region* region = d_regions[i];
if( region->valid() ){
- Debug( c ) << "Region #" << i << ": " << std::endl;
+ Trace( c ) << "Region #" << i << ": " << std::endl;
region->debugPrint( c, true );
- Debug( c ) << std::endl;
+ Trace( c ) << std::endl;
for( Region::iterator it = region->begin(); it != region->end(); ++it ){
if( it->second->valid() ){
if( d_regions_map[ it->first ]!=(int)i ){
- Debug( c ) << "***Bad regions map : " << it->first
+ Trace( c ) << "***Bad regions map : " << it->first
<< " " << d_regions_map[ it->first ].get() << std::endl;
}
}
}
if( debugReps!=d_reps ){
- Debug( c ) << "***Bad reps: " << d_reps << ", "
+ Trace( c ) << "***Bad reps: " << d_reps << ", "
<< "actual = " << debugReps << std::endl;
}
}
NodeManager* nm = NodeManager::currentNM();
SkolemManager* sm = nm->getSkolemManager();
TheoryModel* m = d_state.getModel();
- if( Trace.isOn("uf-ss-warn") ){
+ if( TraceIsOn("uf-ss-warn") ){
std::vector< Node > eqcs;
eq::EqClassesIterator eqcs_i =
eq::EqClassesIterator(m->getEqualityEngine());
}
}
}else{
- if( Trace.isOn("uf-ss-warn") ){
+ if( TraceIsOn("uf-ss-warn") ){
////FIXME: this is too strict: theory propagations are showing up as isDecision=true, but
//// a theory propagation is not a decision.
if( isDecision ){
<< "CardinalityExtension: check " << level << std::endl;
if (level == Theory::EFFORT_FULL)
{
- if (Debug.isOn("uf-ss-debug"))
+ if (TraceIsOn("uf-ss-debug"))
{
debugPrint("uf-ss-debug");
}
- if (Trace.isOn("uf-ss-state"))
+ if (TraceIsOn("uf-ss-state"))
{
Trace("uf-ss-state")
<< "CardinalityExtension::check " << level << std::endl;
void CardinalityExtension::debugPrint(const char* c)
{
for( std::map< TypeNode, SortModel* >::iterator it = d_rep_model.begin(); it != d_rep_model.end(); ++it ){
- Debug( c ) << "Conflict find structure for " << it->first << ": " << std::endl;
+ Trace( c ) << "Conflict find structure for " << it->first << ": " << std::endl;
it->second->debugPrint( c );
- Debug( c ) << std::endl;
+ Trace( c ) << std::endl;
}
}
{
std::stringstream ss;
debug_print(ss, tb);
- Debug(c) << ss.str();
+ Trace(c) << ss.str();
}
void EqProof::debug_print(std::ostream& os, unsigned tb) const
<< "EqProof::addToProof: New conclusion " << conclusion << "\n";
}
}
- if (Trace.isOn("eqproof-conv"))
+ if (TraceIsOn("eqproof-conv"))
{
Trace("eqproof-conv")
<< "EqProof::addToProof: premises from reduced cong of " << conclusion
EqualityEngineNotifyNone EqualityEngine::s_notifyNone;
void EqualityEngine::init() {
- Debug("equality") << "EqualityEdge::EqualityEngine(): id_null = " << +null_id << std::endl;
- Debug("equality") << "EqualityEdge::EqualityEngine(): edge_null = " << +null_edge << std::endl;
- Debug("equality") << "EqualityEdge::EqualityEngine(): trigger_null = " << +null_trigger << std::endl;
+ Trace("equality") << "EqualityEdge::EqualityEngine(): id_null = " << +null_id << std::endl;
+ Trace("equality") << "EqualityEdge::EqualityEngine(): edge_null = " << +null_edge << std::endl;
+ Trace("equality") << "EqualityEdge::EqualityEngine(): trigger_null = " << +null_trigger << std::endl;
// If we are not at level zero when we initialize this equality engine, we
// may remove true/false from the equality engine when we pop to level zero,
}
void EqualityEngine::enqueue(const MergeCandidate& candidate, bool back) {
- Debug("equality") << d_name << "::eq::enqueue({" << candidate.d_t1Id << "} "
+ Trace("equality") << d_name << "::eq::enqueue({" << candidate.d_t1Id << "} "
<< d_nodes[candidate.d_t1Id] << ", {" << candidate.d_t2Id
<< "} " << d_nodes[candidate.d_t2Id] << ", "
<< static_cast<MergeReasonType>(candidate.d_type)
}
EqualityNodeId EqualityEngine::newApplicationNode(TNode original, EqualityNodeId t1, EqualityNodeId t2, FunctionApplicationType type) {
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original
<< ", {" << t1 << "} " << d_nodes[t1] << ", {" << t2 << "} "
<< d_nodes[t2] << ")" << std::endl;
EqualityNodeId t2ClassId = getEqualityNode(t2).getFind();
FunctionApplication funNormalized(type, t1ClassId, t2ClassId);
- Debug("equality") << d_name << "::eq::newApplicationNode: funOriginal: ("
+ Trace("equality") << d_name << "::eq::newApplicationNode: funOriginal: ("
<< type << " " << d_nodes[t1] << " " << d_nodes[t2]
<< "), funNorm: (" << type << " " << d_nodes[t1ClassId]
<< " " << d_nodes[t2ClassId] << ")\n";
// Add the lookup data, if it's not already there
ApplicationIdsMap::iterator find = d_applicationLookup.find(funNormalized);
if (find == d_applicationLookup.end()) {
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original
<< ", " << t1 << ", " << t2
<< "): no lookup, setting up funNorm: (" << type << " "
<< d_nodes[t1ClassId] << " " << d_nodes[t2ClassId]
storeApplicationLookup(funNormalized, funId);
} else {
// If it's there, we need to merge these two
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup exists, adding to queue" << std::endl;
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup = " << d_nodes[find->second] << std::endl;
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup exists, adding to queue" << std::endl;
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): lookup = " << d_nodes[find->second] << std::endl;
enqueue(MergeCandidate(funId, find->second, MERGED_THROUGH_CONGRUENCE, TNode::null()));
}
// Add to the use lists
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t1] << std::endl;
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t1] << std::endl;
d_equalityNodes[t1].usedIn(funId, d_useListNodes);
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t2] << std::endl;
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << "): adding " << original << " to the uselist of " << d_nodes[t2] << std::endl;
d_equalityNodes[t2].usedIn(funId, d_useListNodes);
// Return the new id
- Debug("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << ") => " << funId << std::endl;
+ Trace("equality") << d_name << "::eq::newApplicationNode(" << original << ", " << t1 << ", " << t2 << ") => " << funId << std::endl;
return funId;
}
EqualityNodeId EqualityEngine::newNode(TNode node) {
- Debug("equality") << d_name << "::eq::newNode(" << node << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::newNode(" << node << ")" << std::endl;
++d_stats.d_termsCount;
// Increase the counters
d_nodesCount = d_nodesCount + 1;
- Debug("equality") << d_name << "::eq::newNode(" << node << ") => " << newId << std::endl;
+ Trace("equality") << d_name << "::eq::newNode(" << node << ") => " << newId << std::endl;
return newId;
}
{
if (interpreted)
{
- Debug("equality::evaluation")
+ Trace("equality::evaluation")
<< d_name << "::eq::addFunctionKind(): " << fun << " is interpreted "
<< std::endl;
d_congruenceKindsInterpreted.set(fun);
}
if (extOperator)
{
- Debug("equality::extoperator")
+ Trace("equality::extoperator")
<< d_name << "::eq::addFunctionKind(): " << fun
<< " is an external operator kind " << std::endl;
d_congruenceKindsExtOperators.set(fun);
}
void EqualityEngine::subtermEvaluates(EqualityNodeId id) {
- Debug("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): " << d_subtermsToEvaluate[id] << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): " << d_subtermsToEvaluate[id] << std::endl;
Assert(!d_isInternal[id]);
Assert(d_subtermsToEvaluate[id] > 0);
if ((-- d_subtermsToEvaluate[id]) == 0) {
}
d_subtermEvaluates.push_back(id);
d_subtermEvaluatesSize = d_subtermEvaluates.size();
- Debug("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): new " << d_subtermsToEvaluate[id] << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::subtermEvaluates(" << d_nodes[id] << "): new " << d_subtermsToEvaluate[id] << std::endl;
}
void EqualityEngine::addTermInternal(TNode t, bool isOperator) {
- Debug("equality") << d_name << "::eq::addTermInternal(" << t << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addTermInternal(" << t << ")" << std::endl;
// If there already, we're done
if (hasTerm(t)) {
- Debug("equality") << d_name << "::eq::addTermInternal(" << t << "): already there" << std::endl;
+ Trace("equality") << d_name << "::eq::addTermInternal(" << t << "): already there" << std::endl;
return;
}
d_subtermsToEvaluate[result] = t.getNumChildren();
for (unsigned i = 0; i < t.getNumChildren(); ++ i) {
if (isConstant(getNodeId(t[i]))) {
- Debug("equality::evaluation") << d_name << "::eq::addTermInternal(" << t << "): evaluates " << t[i] << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::addTermInternal(" << t << "): evaluates " << t[i] << std::endl;
subtermEvaluates(result);
}
}
Assert(hasTerm(t));
- Debug("equality") << d_name << "::eq::addTermInternal(" << t << ") => " << result << std::endl;
+ Trace("equality") << d_name << "::eq::addTermInternal(" << t << ") => " << result << std::endl;
}
bool EqualityEngine::hasTerm(TNode t) const {
}
void EqualityEngine::assertEqualityInternal(TNode t1, TNode t2, TNode reason, unsigned pid) {
- Debug("equality") << d_name << "::eq::addEqualityInternal(" << t1 << "," << t2
+ Trace("equality") << d_name << "::eq::addEqualityInternal(" << t1 << "," << t2
<< "), reason = " << reason
<< ", pid = " << static_cast<MergeReasonType>(pid)
<< std::endl;
TNode reason,
unsigned pid)
{
- Debug("equality") << d_name << "::eq::addPredicate(" << t << "," << (polarity ? "true" : "false") << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addPredicate(" << t << "," << (polarity ? "true" : "false") << ")" << std::endl;
Assert(t.getKind() != kind::EQUAL) << "Use assertEquality instead";
TNode b = polarity ? d_true : d_false;
if (hasTerm(t) && areEqual(t, b))
TNode reason,
unsigned pid)
{
- Debug("equality") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl;
if (polarity) {
// If two terms are already equal, don't assert anything
if (hasTerm(eq[0]) && hasTerm(eq[1]) && areEqual(eq[0], eq[1])) {
// notify the theory
d_notify->eqNotifyDisequal(eq[0], eq[1], reason);
- Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl;
+ Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ")" << std::endl;
assertEqualityInternal(eq, d_false, reason, pid);
propagate();
TriggerTermSetRef aTriggerRef = d_nodeIndividualTrigger[aClassId];
TriggerTermSetRef bTriggerRef = d_nodeIndividualTrigger[bClassId];
if (aTriggerRef != +null_set_id && bTriggerRef != +null_set_id) {
- Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": have triggers" << std::endl;
+ Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": have triggers" << std::endl;
// The sets of trigger terms
TriggerTermSet& aTriggerTerms = getTriggerTermSet(aTriggerRef);
TriggerTermSet& bTriggerTerms = getTriggerTermSet(bTriggerRef);
// Store the propagation
storePropagatedDisequality(aTag, aSharedId, bSharedId);
// Notify
- Debug("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": notifying " << aTag << " for " << d_nodes[aSharedId] << " != " << d_nodes[bSharedId] << std::endl;
+ Trace("equality::trigger") << d_name << "::eq::addEquality(" << eq << "," << (polarity ? "true" : "false") << ": notifying " << aTag << " for " << d_nodes[aSharedId] << " != " << d_nodes[bSharedId] << std::endl;
if (!d_notify->eqNotifyTriggerTermEquality(aTag, d_nodes[aSharedId], d_nodes[bSharedId], false)) {
break;
}
}
TNode EqualityEngine::getRepresentative(TNode t) const {
- Debug("equality::internal") << d_name << "::eq::getRepresentative(" << t << ")" << std::endl;
+ Trace("equality::internal") << d_name << "::eq::getRepresentative(" << t << ")" << std::endl;
Assert(hasTerm(t));
EqualityNodeId representativeId = getEqualityNode(t).getFind();
Assert(!d_isInternal[representativeId]);
- Debug("equality::internal") << d_name << "::eq::getRepresentative(" << t << ") => " << d_nodes[representativeId] << std::endl;
+ Trace("equality::internal") << d_name << "::eq::getRepresentative(" << t << ") => " << d_nodes[representativeId] << std::endl;
return d_nodes[representativeId];
}
bool EqualityEngine::merge(EqualityNode& class1, EqualityNode& class2, std::vector<TriggerId>& triggersFired) {
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << ")" << std::endl;
Assert(triggersFired.empty());
}
// Update class2 representative information
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating class " << class2Id << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating class " << class2Id << std::endl;
EqualityNodeId currentId = class2Id;
do {
// Get the current node
EqualityNode& currentNode = getEqualityNode(currentId);
// Update it's find to class1 id
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << currentId << "->" << class1Id << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << currentId << "->" << class1Id << std::endl;
currentNode.setFind(class1Id);
// Go through the triggers and inform if necessary
// Update class2 table lookup and information if not a boolean
// since booleans can't be in an application
if (!d_isEquality[class2Id]) {
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of " << class2Id << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of " << class2Id << std::endl;
do {
// Get the current node
EqualityNode& currentNode = getEqualityNode(currentId);
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of node " << currentId << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): updating lookups of node " << currentId << std::endl;
// Go through the uselist and check for congruences
UseListNodeId currentUseId = currentNode.getUseList();
UseListNode& useNode = d_useListNodes[currentUseId];
// Get the function application
EqualityNodeId funId = useNode.getApplicationId();
- Debug("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << d_nodes[currentId] << " in " << d_nodes[funId] << std::endl;
+ Trace("equality") << d_name << "::eq::merge(" << class1.getFind() << "," << class2.getFind() << "): " << d_nodes[currentId] << " in " << d_nodes[funId] << std::endl;
const FunctionApplication& fun =
d_applications[useNode.getApplicationId()].d_normalized;
// If it's interpreted and we can interpret
void EqualityEngine::undoMerge(EqualityNode& class1, EqualityNode& class2, EqualityNodeId class2Id) {
- Debug("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << ")" << std::endl;
// Now unmerge the lists (same as merge)
class1.merge<false>(class2);
// Update class2 representative information
EqualityNodeId currentId = class2Id;
- Debug("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << "): undoing representative info" << std::endl;
+ Trace("equality") << d_name << "::eq::undoMerge(" << class1.getFind() << "," << class2Id << "): undoing representative info" << std::endl;
do {
// Get the current node
EqualityNode& currentNode = getEqualityNode(currentId);
void EqualityEngine::backtrack() {
- Debug("equality::backtrack") << "backtracking" << std::endl;
+ Trace("equality::backtrack") << "backtracking" << std::endl;
// If we need to backtrack then do it
if (d_assertedEqualitiesCount < d_assertedEqualities.size()) {
d_propagationQueue.pop_front();
}
- Debug("equality") << d_name << "::eq::backtrack(): nodes" << std::endl;
+ Trace("equality") << d_name << "::eq::backtrack(): nodes" << std::endl;
for (int i = (int)d_assertedEqualities.size() - 1, i_end = (int)d_assertedEqualitiesCount; i >= i_end; --i) {
// Get the ids of the merged classes
d_assertedEqualities.resize(d_assertedEqualitiesCount);
- Debug("equality") << d_name << "::eq::backtrack(): edges" << std::endl;
+ Trace("equality") << d_name << "::eq::backtrack(): edges" << std::endl;
for (int i = (int)d_equalityEdges.size() - 2, i_end = (int)(2*d_assertedEqualitiesCount); i >= i_end; i -= 2) {
EqualityEdge& edge1 = d_equalityEdges[i];
// Go down the nodes, check the application nodes and remove them from use-lists
for(int i = d_nodes.size() - 1, i_end = (int)d_nodesCount; i >= i_end; -- i) {
// Remove from the node -> id map
- Debug("equality") << d_name << "::eq::backtrack(): removing node " << d_nodes[i] << std::endl;
+ Trace("equality") << d_name << "::eq::backtrack(): removing node " << d_nodes[i] << std::endl;
d_nodeIds.erase(d_nodes[i]);
const FunctionApplication& app = d_applications[i].d_original;
}
void EqualityEngine::addGraphEdge(EqualityNodeId t1, EqualityNodeId t2, unsigned type, TNode reason) {
- Debug("equality") << d_name << "::eq::addGraphEdge({" << t1 << "} "
+ Trace("equality") << d_name << "::eq::addGraphEdge({" << t1 << "} "
<< d_nodes[t1] << ", {" << t2 << "} " << d_nodes[t2] << ","
<< reason << ")" << std::endl;
EqualityEdgeId edge = d_equalityEdges.size();
d_equalityGraph[t1] = edge;
d_equalityGraph[t2] = edge | 1;
- if (Debug.isOn("equality::internal")) {
+ if (TraceIsOn("equality::internal")) {
debugPrintGraph();
}
}
{
return;
}
- Debug("equality") << "buildEqConclusion: {" << id1 << "} " << d_nodes[id1]
+ Trace("equality") << "buildEqConclusion: {" << id1 << "} " << d_nodes[id1]
<< "\n";
- Debug("equality") << "buildEqConclusion: {" << id2 << "} " << d_nodes[id2]
+ Trace("equality") << "buildEqConclusion: {" << id2 << "} " << d_nodes[id2]
<< "\n";
Node eq[2];
NodeManager* nm = NodeManager::currentNM();
void EqualityEngine::explainEquality(TNode t1, TNode t2, bool polarity,
std::vector<TNode>& equalities,
EqProof* eqp) const {
- Debug("pf::ee") << d_name << "::eq::explainEquality(" << t1 << ", " << t2
+ Trace("pf::ee") << d_name << "::eq::explainEquality(" << t1 << ", " << t2
<< ", " << (polarity ? "true" : "false") << ")"
<< ", proof = " << (eqp ? "ON" : "OFF") << std::endl;
// The terms must be there already
Assert(hasTerm(t1) && hasTerm(t2));
- if (Debug.isOn("equality::internal"))
+ if (TraceIsOn("equality::internal"))
{
debugPrintGraph();
}
DisequalityReasonRef reasonRef = d_disequalityReasonsMap.find(pair)->second;
if (eqp)
{
- Debug("pf::ee") << "Deq reason for " << eqp->d_node << " "
+ Trace("pf::ee") << "Deq reason for " << eqp->d_node << " "
<< reasonRef.d_mergesStart << "..."
<< reasonRef.d_mergesEnd << std::endl;
}
// If we're constructing a (transitivity) proof, we don't need to include an explanation for x=x.
if (eqp && toExplain.first != toExplain.second) {
eqpc = std::make_shared<EqProof>();
- Debug("pf::ee") << "Deq getExplanation #" << i << " for " << eqp->d_node
+ Trace("pf::ee") << "Deq getExplanation #" << i << " for " << eqp->d_node
<< " : " << toExplain.first << " " << toExplain.second
<< std::endl;
}
toExplain.first, toExplain.second, equalities, cache, eqpc.get());
if (eqpc) {
- if (Debug.isOn("pf::ee"))
+ if (TraceIsOn("pf::ee"))
{
- Debug("pf::ee") << "Child proof is:" << std::endl;
+ Trace("pf::ee") << "Child proof is:" << std::endl;
eqpc->debug_print("pf::ee", 1);
}
if (eqpc->d_id == MERGED_THROUGH_TRANS)
&& child->d_node.isNull())
{
nullCongruenceFound = true;
- Debug("pf::ee")
+ Trace("pf::ee")
<< "Have congruence with empty d_node. Splitting..."
<< std::endl;
orderedChildren.insert(orderedChildren.begin(),
if (nullCongruenceFound) {
eqpc->d_children = orderedChildren;
- if (Debug.isOn("pf::ee"))
+ if (TraceIsOn("pf::ee"))
{
- Debug("pf::ee")
+ Trace("pf::ee")
<< "Child proof's children have been reordered. It is now:"
<< std::endl;
eqpc->debug_print("pf::ee", 1);
if (eqp) {
if (eqp->d_children.size() == 0) {
// Corner case where this is actually a disequality between two constants
- Debug("pf::ee") << "Encountered a constant disequality (not a transitivity proof): "
+ Trace("pf::ee") << "Encountered a constant disequality (not a transitivity proof): "
<< eqp->d_node << std::endl;
Assert(eqp->d_node[0][0].isConst());
Assert(eqp->d_node[0][1].isConst());
eqp->d_id = MERGED_THROUGH_CONSTANTS;
} else if (eqp->d_children.size() == 1) {
Node cnode = eqp->d_children[0]->d_node;
- Debug("pf::ee") << "Simplifying " << cnode << " from " << eqp->d_node
+ Trace("pf::ee") << "Simplifying " << cnode << " from " << eqp->d_node
<< std::endl;
bool simpTrans = true;
if (cnode.getKind() == kind::EQUAL)
}
}
- if (Debug.isOn("pf::ee"))
+ if (TraceIsOn("pf::ee"))
{
- Debug("pf::ee") << "Disequality explanation final proof: " << std::endl;
+ Trace("pf::ee") << "Disequality explanation final proof: " << std::endl;
eqp->debug_print("pf::ee", 1);
}
}
void EqualityEngine::explainPredicate(TNode p, bool polarity,
std::vector<TNode>& assertions,
EqProof* eqp) const {
- Debug("equality") << d_name << "::eq::explainPredicate(" << p << ")"
+ Trace("equality") << d_name << "::eq::explainPredicate(" << p << ")"
<< std::endl;
// Must have the term
Assert(hasTerm(p));
std::map<std::pair<EqualityNodeId, EqualityNodeId>, EqProof*> cache;
- if (Debug.isOn("equality::internal"))
+ if (TraceIsOn("equality::internal"))
{
debugPrintGraph();
}
BfsData current = bfsQueue[currentIndex];
EqualityNodeId currentNode = current.d_nodeId;
- Debug("equality") << d_name << "::eq::getExplanation(): currentNode = {"
+ Trace("equality") << d_name << "::eq::getExplanation(): currentNode = {"
<< currentNode << "} " << d_nodes[currentNode]
<< std::endl;
// Go through the equality edges of this node
EqualityEdgeId currentEdge = d_equalityGraph[currentNode];
- if (Debug.isOn("equality")) {
- Debug("equality") << d_name << "::eq::getExplanation(): edgesId = " << currentEdge << std::endl;
- Debug("equality") << d_name << "::eq::getExplanation(): edges = " << edgesToString(currentEdge) << std::endl;
+ if (TraceIsOn("equality")) {
+ Trace("equality") << d_name << "::eq::getExplanation(): edgesId = " << currentEdge << std::endl;
+ Trace("equality") << d_name << "::eq::getExplanation(): edges = " << edgesToString(currentEdge) << std::endl;
}
while (currentEdge != null_edge) {
// If not just the backwards edge
if ((currentEdge | 1u) != (current.d_edgeId | 1u))
{
- Debug("equality") << d_name
+ Trace("equality") << d_name
<< "::eq::getExplanation(): currentEdge = ({"
<< currentNode << "} " << d_nodes[currentNode]
<< ", {" << edge.getNodeId() << "} "
// Did we find the path
if (edge.getNodeId() == t2Id) {
- Debug("equality") << d_name << "::eq::getExplanation(): path found: " << std::endl;
+ Trace("equality") << d_name << "::eq::getExplanation(): path found: " << std::endl;
std::vector<std::shared_ptr<EqProof>> eqp_trans;
d_equalityEdges[currentEdge].getReasonType());
Node reason = d_equalityEdges[currentEdge].getReason();
- Debug("equality")
+ Trace("equality")
<< d_name
<< "::eq::getExplanation(): currentEdge = " << currentEdge
<< ", currentNode = " << currentNode << std::endl;
- Debug("equality")
+ Trace("equality")
<< d_name << " targetNode = {" << edgeNode
<< "} " << d_nodes[edgeNode] << std::endl;
- Debug("equality")
+ Trace("equality")
<< d_name << " in currentEdge = ({"
<< currentNode << "} " << d_nodes[currentNode] << ", {"
<< edge.getNodeId() << "} " << d_nodes[edge.getNodeId()] << ")"
<< std::endl;
- Debug("equality")
+ Trace("equality")
<< d_name
<< " reason type = " << reasonType
<< "\n";
switch (reasonType) {
case MERGED_THROUGH_CONGRUENCE: {
// f(x1, x2) == f(y1, y2) because x1 = y1 and x2 = y2
- Debug("equality")
+ Trace("equality")
<< d_name
<< "::eq::getExplanation(): due to congruence, going deeper"
<< std::endl;
const FunctionApplication& f2 =
d_applications[edgeNode].d_original;
- Debug("equality") << push;
- Debug("equality") << "Explaining left hand side equalities" << std::endl;
+ Trace("equality") << push;
+ Trace("equality") << "Explaining left hand side equalities" << std::endl;
std::shared_ptr<EqProof> eqpc1 =
eqpc ? std::make_shared<EqProof>() : nullptr;
getExplanation(f1.d_a, f2.d_a, equalities, cache, eqpc1.get());
- Debug("equality") << "Explaining right hand side equalities" << std::endl;
+ Trace("equality") << "Explaining right hand side equalities" << std::endl;
std::shared_ptr<EqProof> eqpc2 =
eqpc ? std::make_shared<EqProof>() : nullptr;
getExplanation(f1.d_b, f2.d_b, equalities, cache, eqpc2.get());
<< " with non-congruence with " << k << "\n";
}
}
- Debug("equality") << pop;
+ Trace("equality") << pop;
break;
}
case MERGED_THROUGH_REFLEXIVITY: {
// x1 == x1
- Debug("equality") << d_name << "::eq::getExplanation(): due to reflexivity, going deeper" << std::endl;
+ Trace("equality") << d_name << "::eq::getExplanation(): due to reflexivity, going deeper" << std::endl;
EqualityNodeId eqId = currentNode == d_trueId ? edgeNode : currentNode;
const FunctionApplication& eq = d_applications[eqId].d_original;
Assert(eq.isEquality()) << "Must be an equality";
// Explain why a = b constant
- Debug("equality") << push;
+ Trace("equality") << push;
std::shared_ptr<EqProof> eqpc1 =
eqpc ? std::make_shared<EqProof>() : nullptr;
getExplanation(eq.d_a, eq.d_b, equalities, cache, eqpc1.get());
if( eqpc ){
eqpc->d_children.push_back( eqpc1 );
}
- Debug("equality") << pop;
+ Trace("equality") << pop;
break;
}
case MERGED_THROUGH_CONSTANTS: {
// f(c1, ..., cn) = c semantically, we can just ignore it
- Debug("equality") << d_name << "::eq::getExplanation(): due to constants, explain the constants" << std::endl;
- Debug("equality") << push;
+ Trace("equality") << d_name << "::eq::getExplanation(): due to constants, explain the constants" << std::endl;
+ Trace("equality") << push;
// Get the node we interpreted
TNode interpreted;
eqpcc.get());
if( eqpc ) {
eqpc->d_children.push_back( eqpcc );
- if (Debug.isOn("pf::ee"))
+ if (TraceIsOn("pf::ee"))
{
- Debug("pf::ee")
+ Trace("pf::ee")
<< "MERGED_THROUGH_CONSTANTS. Dumping the child proof"
<< std::endl;
eqpc->debug_print("pf::ee", 1);
}
}
- Debug("equality") << pop;
+ Trace("equality") << pop;
break;
}
default: {
// Construct the equality
- Debug("equality") << d_name << "::eq::getExplanation(): adding: "
+ Trace("equality") << d_name << "::eq::getExplanation(): adding: "
<< reason << std::endl;
- Debug("equality")
+ Trace("equality")
<< d_name
<< "::eq::getExplanation(): reason type = " << reasonType
<< "\n";
// EqProof::reduceNestedCongruence for more details.
buildEqConclusion(t1Id, t2Id, eqp);
}
- if (Debug.isOn("pf::ee"))
+ if (TraceIsOn("pf::ee"))
{
eqp->debug_print("pf::ee", 1);
}
void EqualityEngine::addTriggerEqualityInternal(TNode t1, TNode t2, TNode trigger, bool polarity) {
- Debug("equality") << d_name << "::eq::addTrigger(" << t1 << ", " << t2 << ", " << trigger << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addTrigger(" << t1 << ", " << t2 << ", " << trigger << ")" << std::endl;
Assert(hasTerm(t1));
Assert(hasTerm(t2));
// We will attach it to the class representative, since then we know how to backtrack it
TriggerId t2TriggerId = d_nodeTriggers[t2classId];
- Debug("equality") << d_name << "::eq::addTrigger(" << trigger << "): " << t1Id << " (" << t1classId << ") = " << t2Id << " (" << t2classId << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addTrigger(" << trigger << "): " << t1Id << " (" << t1classId << ") = " << t2Id << " (" << t2classId << ")" << std::endl;
// Create the triggers
TriggerId t1NewTriggerId = d_equalityTriggers.size();
d_nodeTriggers[t1classId] = t1NewTriggerId;
d_nodeTriggers[t2classId] = t2NewTriggerId;
- if (Debug.isOn("equality::internal")) {
+ if (TraceIsOn("equality::internal")) {
debugPrintGraph();
}
- Debug("equality") << d_name << "::eq::addTrigger(" << t1 << "," << t2 << ") => (" << t1NewTriggerId << ", " << t2NewTriggerId << ")" << std::endl;
+ Trace("equality") << d_name << "::eq::addTrigger(" << t1 << "," << t2 << ") => (" << t1NewTriggerId << ", " << t2NewTriggerId << ")" << std::endl;
}
Node EqualityEngine::evaluateTerm(TNode node) {
- Debug("equality::evaluation") << d_name << "::eq::evaluateTerm(" << node << ")" << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::evaluateTerm(" << node << ")" << std::endl;
NodeBuilder builder;
builder << node.getKind();
if (node.getMetaKind() == kind::metakind::PARAMETERIZED) {
for (unsigned i = 0; i < node.getNumChildren(); ++ i) {
TNode child = node[i];
TNode childRep = getRepresentative(child);
- Debug("equality::evaluation") << d_name << "::eq::evaluateTerm: " << child << " -> " << childRep << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::evaluateTerm: " << child << " -> " << childRep << std::endl;
Assert(childRep.isConst());
builder << childRep;
}
void EqualityEngine::processEvaluationQueue() {
- Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): start" << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): start" << std::endl;
while (!d_evaluationQueue.empty()) {
// Get the node
// Replace the children with their representatives (must be constants)
Node nodeEvaluated = evaluateTerm(d_nodes[id]);
- Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): " << d_nodes[id] << " evaluates to " << nodeEvaluated << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): " << d_nodes[id] << " evaluates to " << nodeEvaluated << std::endl;
Assert(nodeEvaluated.isConst());
addTermInternal(nodeEvaluated);
EqualityNodeId nodeEvaluatedId = getNodeId(nodeEvaluated);
enqueue(MergeCandidate(id, nodeEvaluatedId, MERGED_THROUGH_CONSTANTS, TNode::null()));
}
- Debug("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): done" << std::endl;
+ Trace("equality::evaluation") << d_name << "::eq::processEvaluationQueue(): done" << std::endl;
}
void EqualityEngine::propagate() {
// Make sure we don't get in again
ScopedBool inPropagate(d_inPropagate, true);
- Debug("equality") << d_name << "::eq::propagate()" << std::endl;
+ Trace("equality") << d_name << "::eq::propagate()" << std::endl;
while (!d_propagationQueue.empty() || !d_evaluationQueue.empty()) {
continue;
}
- Debug("equality::internal") << d_name << "::eq::propagate(): t1: " << (d_isInternal[t1classId] ? "internal" : "proper") << std::endl;
- Debug("equality::internal") << d_name << "::eq::propagate(): t2: " << (d_isInternal[t2classId] ? "internal" : "proper") << std::endl;
+ Trace("equality::internal") << d_name << "::eq::propagate(): t1: " << (d_isInternal[t1classId] ? "internal" : "proper") << std::endl;
+ Trace("equality::internal") << d_name << "::eq::propagate(): t2: " << (d_isInternal[t2classId] ? "internal" : "proper") << std::endl;
// Get the nodes of the representatives
EqualityNode& node1 = getEqualityNode(t1classId);
}
if (mergeInto == t2classId) {
- Debug("equality") << d_name << "::eq::propagate(): merging "
+ Trace("equality") << d_name << "::eq::propagate(): merging "
<< d_nodes[current.d_t1Id] << " into "
<< d_nodes[current.d_t2Id] << std::endl;
d_assertedEqualities.push_back(Equality(t2classId, t1classId));
d_done = true;
}
} else {
- Debug("equality") << d_name << "::eq::propagate(): merging "
+ Trace("equality") << d_name << "::eq::propagate(): merging "
<< d_nodes[current.d_t2Id] << " into "
<< d_nodes[current.d_t1Id] << std::endl;
d_assertedEqualities.push_back(Equality(t1classId, t2classId));
}
void EqualityEngine::debugPrintGraph() const {
- Debug("equality::graph") << std::endl << "Dumping graph" << std::endl;
+ Trace("equality::graph") << std::endl << "Dumping graph" << std::endl;
for (EqualityNodeId nodeId = 0; nodeId < d_nodes.size(); ++ nodeId) {
- Debug("equality::graph") << d_nodes[nodeId] << " " << nodeId << "(" << getEqualityNode(nodeId).getFind() << "):";
+ Trace("equality::graph") << d_nodes[nodeId] << " " << nodeId << "(" << getEqualityNode(nodeId).getFind() << "):";
EqualityEdgeId edgeId = d_equalityGraph[nodeId];
while (edgeId != null_edge) {
const EqualityEdge& edge = d_equalityEdges[edgeId];
- Debug("equality::graph") << " [" << edge.getNodeId() << "] " << d_nodes[edge.getNodeId()] << ":" << edge.getReason();
+ Trace("equality::graph") << " [" << edge.getNodeId() << "] " << d_nodes[edge.getNodeId()] << ":" << edge.getReason();
edgeId = edge.getNext();
}
- Debug("equality::graph") << std::endl;
+ Trace("equality::graph") << std::endl;
}
- Debug("equality::graph") << std::endl;
+ Trace("equality::graph") << std::endl;
}
std::string EqualityEngine::debugPrintEqc() const
}
bool EqualityEngine::areEqual(TNode t1, TNode t2) const {
- Debug("equality") << d_name << "::eq::areEqual(" << t1 << "," << t2 << ")";
+ Trace("equality") << d_name << "::eq::areEqual(" << t1 << "," << t2 << ")";
Assert(hasTerm(t1));
Assert(hasTerm(t2));
bool result = getEqualityNode(t1).getFind() == getEqualityNode(t2).getFind();
- Debug("equality") << (result ? "\t(YES)" : "\t(NO)") << std::endl;
+ Trace("equality") << (result ? "\t(YES)" : "\t(NO)") << std::endl;
return result;
}
bool EqualityEngine::areDisequal(TNode t1, TNode t2, bool ensureProof) const
{
- Debug("equality") << d_name << "::eq::areDisequal(" << t1 << "," << t2 << ")";
+ Trace("equality") << d_name << "::eq::areDisequal(" << t1 << "," << t2 << ")";
// Add the terms
Assert(hasTerm(t1));
// If we propagated this disequality we're true
if (hasPropagatedDisequality(t1Id, t2Id)) {
- Debug("equality") << "\t(YES)" << std::endl;
+ Trace("equality") << "\t(YES)" << std::endl;
return true;
}
nonConst->d_deducedDisequalityReasons.push_back(EqualityPair(t2Id, t2ClassId));
nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id);
}
- Debug("equality") << "\t(YES)" << std::endl;
+ Trace("equality") << "\t(YES)" << std::endl;
return true;
}
EqualityPair(t2Id, original.d_b));
nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id);
}
- Debug("equality") << "\t(YES)" << std::endl;
+ Trace("equality") << "\t(YES)" << std::endl;
return true;
}
}
EqualityPair(t1Id, original.d_b));
nonConst->storePropagatedDisequality(THEORY_LAST, t1Id, t2Id);
}
- Debug("equality") << "\t(YES)" << std::endl;
+ Trace("equality") << "\t(YES)" << std::endl;
return true;
}
}
// Couldn't deduce dis-equalityReturn whether the terms are disequal
- Debug("equality") << "\t(NO)" << std::endl;
+ Trace("equality") << "\t(NO)" << std::endl;
return false;
}
void EqualityEngine::addTriggerTerm(TNode t, TheoryId tag)
{
- Debug("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << ")" << std::endl;
+ Trace("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << ")" << std::endl;
Assert(tag != THEORY_LAST);
if (triggerSetRef != +null_set_id && getTriggerTermSet(triggerSetRef).hasTrigger(tag)) {
// If the term already is in the equivalence class that a tagged representative, just notify
EqualityNodeId triggerId = getTriggerTermSet(triggerSetRef).getTrigger(tag);
- Debug("equality::trigger")
+ Trace("equality::trigger")
<< d_name << "::eq::addTriggerTerm(" << t << ", " << tag
<< "): already have this trigger in class with " << d_nodes[triggerId]
<< std::endl;
d_nodeIndividualTrigger[classId] = triggerSetRef = newTriggerTermSet(newSetTags, newSetTriggers, newSetTriggersSize);
// Propagate trigger term disequalities we remembered
- Debug("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << "): propagating " << disequalitiesToNotify.size() << " disequalities " << std::endl;
+ Trace("equality::trigger") << d_name << "::eq::addTriggerTerm(" << t << ", " << tag << "): propagating " << disequalitiesToNotify.size() << " disequalities " << std::endl;
propagateTriggerTermDisequalities(tags, triggerSetRef, disequalitiesToNotify);
}
}
d_applicationLookup[funNormalized] = funId;
d_applicationLookups.push_back(funNormalized);
d_applicationLookupsCount = d_applicationLookupsCount + 1;
- Debug("equality::backtrack") << "d_applicationLookupsCount = " << d_applicationLookupsCount << std::endl;
- Debug("equality::backtrack") << "d_applicationLookups.size() = " << d_applicationLookups.size() << std::endl;
+ Trace("equality::backtrack") << "d_applicationLookupsCount = " << d_applicationLookupsCount << std::endl;
+ Trace("equality::backtrack") << "d_applicationLookups.size() = " << d_applicationLookups.size() << std::endl;
Assert(d_applicationLookupsCount == d_applicationLookups.size());
// If an equality over constants we merge to false
bool stored = d_disequalityReasonsMap.find(eq) != d_disequalityReasonsMap.end();
Assert(propagated == stored) << "These two should be in sync";
#endif
- Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (propagated ? "true" : "false") << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (propagated ? "true" : "false") << std::endl;
return propagated;
}
if (it == d_propagatedDisequalities.end()) {
Assert(d_disequalityReasonsMap.find(eq) == d_disequalityReasonsMap.end())
<< "Why do we have a proof if not propagated";
- Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => false" << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => false" << std::endl;
return false;
}
Assert(d_disequalityReasonsMap.find(eq) != d_disequalityReasonsMap.end())
<< "We propagated but there is no proof";
bool result = TheoryIdSetUtil::setContains(tag, (*it).second);
- Debug("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (result ? "true" : "false") << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::hasPropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ") => " << (result ? "true" : "false") << std::endl;
return result;
}
<< "Check before you store it";
Assert(lhsId != rhsId) << "Wow, wtf!";
- Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ")" << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << ")" << std::endl;
EqualityPair pair1(lhsId, rhsId);
EqualityPair pair2(rhsId, lhsId);
// Store the proof if provided
if (d_deducedDisequalityReasons.size() > d_deducedDisequalityReasonsSize) {
- Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << "): storing proof" << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(" << tag << ", " << d_nodes[lhsId] << ", " << d_nodes[rhsId] << "): storing proof" << std::endl;
Assert(d_disequalityReasonsMap.find(pair1) == d_disequalityReasonsMap.end())
<< "There can't be a proof if you're adding a new one";
DisequalityReasonRef ref(d_deducedDisequalityReasonsSize, d_deducedDisequalityReasons.size());
== getEqualityNode(d_deducedDisequalityReasons[i].second).getFind());
}
#endif
- if (Debug.isOn("equality::disequality")) {
+ if (TraceIsOn("equality::disequality")) {
for (unsigned i = ref.d_mergesStart; i < ref.d_mergesEnd; ++i)
{
TNode lhs = d_nodes[d_deducedDisequalityReasons[i].first];
TNode rhs = d_nodes[d_deducedDisequalityReasons[i].second];
- Debug("equality::disequality") << d_name << "::eq::storePropagatedDisequality(): because " << lhs << " == " << rhs << std::endl;
+ Trace("equality::disequality") << d_name << "::eq::storePropagatedDisequality(): because " << lhs << " == " << rhs << std::endl;
}
}
EqualityNodeId currentId = classId;
do {
- Debug("equality::trigger") << d_name << "::getDisequalities() : going through uselist of " << d_nodes[currentId] << std::endl;
+ Trace("equality::trigger") << d_name << "::getDisequalities() : going through uselist of " << d_nodes[currentId] << std::endl;
// Current node in the equivalence class
EqualityNode& currentNode = getEqualityNode(currentId);
UseListNode& useListNode = d_useListNodes[currentUseId];
EqualityNodeId funId = useListNode.getApplicationId();
- Debug("equality::trigger") << d_name << "::getDisequalities() : checking " << d_nodes[funId] << std::endl;
+ Trace("equality::trigger") << d_name << "::getDisequalities() : checking " << d_nodes[funId] << std::endl;
const FunctionApplication& fun =
d_applications[useListNode.getApplicationId()].d_original;
<< std::endl;
// should always be non-null
Assert(pf != nullptr);
- if (Trace.isOn("pfee-proof") || Trace.isOn("pfee-proof-final"))
+ if (TraceIsOn("pfee-proof") || TraceIsOn("pfee-proof-final"))
{
Trace("pfee-proof") << "pfee::ensureProofForFact: printing proof"
<< std::endl;
assumps.push_back(a);
}
}
- if (Trace.isOn("pfee-proof"))
+ if (TraceIsOn("pfee-proof"))
{
Trace("pfee-proof") << "pfee::explainWithProof: add to proof ---"
<< std::endl;
}
bool SymmetryBreaker::Template::matchRecursive(TNode t, TNode n) {
- IndentedScope scope(Debug("ufsymm:match"));
+ IndentedScope scope(Trace("ufsymm:match"));
- Debug("ufsymm:match") << "UFSYMM matching " << t << endl
+ Trace("ufsymm:match") << "UFSYMM matching " << t << endl
<< "UFSYMM to " << n << endl;
if(t.getKind() != n.getKind() || t.getNumChildren() != n.getNumChildren()) {
- Debug("ufsymm:match") << "UFSYMM BAD MATCH on kind, #children" << endl;
+ Trace("ufsymm:match") << "UFSYMM BAD MATCH on kind, #children" << endl;
return false;
}
if(t.getNumChildren() == 0) {
if (!t.isVar())
{
- Debug("ufsymm:match") << "UFSYMM non-variables, failing match" << endl;
+ Trace("ufsymm:match") << "UFSYMM non-variables, failing match" << endl;
return false;
}
t = find(t);
n = find(n);
- Debug("ufsymm:match") << "UFSYMM variable match " << t << " , " << n << endl;
- Debug("ufsymm:match") << "UFSYMM sets: " << t << " =>";
+ Trace("ufsymm:match") << "UFSYMM variable match " << t << " , " << n << endl;
+ Trace("ufsymm:match") << "UFSYMM sets: " << t << " =>";
if(d_sets.find(t) != d_sets.end()) {
for(set<TNode>::iterator i = d_sets[t].begin(); i != d_sets[t].end(); ++i) {
- Debug("ufsymm:match") << " " << *i;
+ Trace("ufsymm:match") << " " << *i;
}
}
- Debug("ufsymm:match") << endl;
+ Trace("ufsymm:match") << endl;
if(t != n) {
- Debug("ufsymm:match") << "UFSYMM sets: " << n << " =>";
+ Trace("ufsymm:match") << "UFSYMM sets: " << n << " =>";
if(d_sets.find(n) != d_sets.end()) {
for(set<TNode>::iterator i = d_sets[n].begin(); i != d_sets[n].end(); ++i) {
- Debug("ufsymm:match") << " " << *i;
+ Trace("ufsymm:match") << " " << *i;
}
}
- Debug("ufsymm:match") << endl;
+ Trace("ufsymm:match") << endl;
if(d_sets.find(t) == d_sets.end()) {
- Debug("ufsymm:match") << "UFSYMM inserting " << t << " in with " << n << endl;
+ Trace("ufsymm:match") << "UFSYMM inserting " << t << " in with " << n << endl;
d_reps[t] = n;
d_sets[n].insert(t);
} else {
if(d_sets.find(n) != d_sets.end()) {
- Debug("ufsymm:match") << "UFSYMM merging " << n << " and " << t << " in with " << n << endl;
+ Trace("ufsymm:match") << "UFSYMM merging " << n << " and " << t << " in with " << n << endl;
d_sets[n].insert(d_sets[t].begin(), d_sets[t].end());
d_sets[n].insert(t);
d_reps[t] = n;
d_sets.erase(t);
} else {
- Debug("ufsymm:match") << "UFSYMM inserting " << n << " in with " << t << endl;
+ Trace("ufsymm:match") << "UFSYMM inserting " << n << " in with " << t << endl;
d_sets[t].insert(n);
d_reps[n] = t;
}
if(t.getMetaKind() == kind::metakind::PARAMETERIZED) {
if(t.getOperator() != n.getOperator()) {
- Debug("ufsymm:match") << "UFSYMM BAD MATCH on operators: " << t.getOperator() << " != " << n.getOperator() << endl;
+ Trace("ufsymm:match") << "UFSYMM BAD MATCH on operators: " << t.getOperator() << " != " << n.getOperator() << endl;
return false;
}
}
while(ti != t.end()) {
if(*ti != *ni) { // nothing to do if equal
if(!matchRecursive(*ti, *ni)) {
- Debug("ufsymm:match") << "UFSYMM BAD MATCH, withdrawing.." << endl;
+ Trace("ufsymm:match") << "UFSYMM BAD MATCH, withdrawing.." << endl;
return false;
}
}
bool SymmetryBreaker::Template::match(TNode n) {
// try to "match" n and d_template
if(d_template.isNull()) {
- Debug("ufsymm") << "UFSYMM setting template " << n << endl;
+ Trace("ufsymm") << "UFSYMM setting template " << n << endl;
d_template = n;
return true;
} else {
bool d_old;
public:
SBGuard(bool& b) : d_ref(b), d_old(b) {}
- ~SBGuard() { Debug("uf") << "reset to " << d_old << std::endl; d_ref = d_old; }
+ ~SBGuard() { Trace("uf") << "reset to " << d_old << std::endl; d_ref = d_old; }
};/* class SBGuard */
void SymmetryBreaker::rerunAssertionsIfNecessary() {
SBGuard g(d_rerunningAssertions);
d_rerunningAssertions = true;
- Debug("ufsymm") << "UFSYMM: rerunning assertions..." << std::endl;
+ Trace("ufsymm") << "UFSYMM: rerunning assertions..." << std::endl;
for(CDList<Node>::const_iterator i = d_assertionsToRerun.begin();
i != d_assertionsToRerun.end();
++i) {
assertFormula(*i);
}
- Debug("ufsymm") << "UFSYMM: DONE rerunning assertions..." << std::endl;
+ Trace("ufsymm") << "UFSYMM: DONE rerunning assertions..." << std::endl;
}
Node SymmetryBreaker::norm(TNode phi) {
kids.reserve(n.getNumChildren());
queue<TNode> work;
work.push(n);
- Debug("ufsymm:norm") << "UFSYMM processing " << n << endl;
+ Trace("ufsymm:norm") << "UFSYMM processing " << n << endl;
do {
TNode m = work.front();
work.pop();
if(level == 0) {
d_termEqsOnly[(*i)[0]].insert((*i)[1]);
d_termEqsOnly[(*i)[1]].insert((*i)[0]);
- Debug("ufsymm:eq") << "UFSYMM " << (*i)[0] << " <==> " << (*i)[1] << endl;
+ Trace("ufsymm:eq") << "UFSYMM " << (*i)[0] << " <==> " << (*i)[1] << endl;
}
}
} else {
}
}
} while(!work.empty());
- Debug("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl;
+ Trace("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl;
sort(kids.begin(), kids.end());
return result = NodeManager::currentNM()->mkNode(k, kids);
}
kids.reserve(n.getNumChildren());
queue<TNode> work;
work.push(n);
- Debug("ufsymm:norm") << "UFSYMM processing " << n << endl;
+ Trace("ufsymm:norm") << "UFSYMM processing " << n << endl;
TNode matchingTerm = TNode::null();
vector<TNode> matchingTermEquals;
bool first = true, matchedVar = false;
}
} while(!work.empty());
if(!matchingTerm.isNull()) {
- if(Debug.isOn("ufsymm:eq")) {
- Debug("ufsymm:eq") << "UFSYMM here we can conclude that " << matchingTerm << " is one of {";
+ if(TraceIsOn("ufsymm:eq")) {
+ Trace("ufsymm:eq") << "UFSYMM here we can conclude that " << matchingTerm << " is one of {";
for(vector<TNode>::const_iterator i = matchingTermEquals.begin(); i != matchingTermEquals.end(); ++i) {
- Debug("ufsymm:eq") << " " << *i;
+ Trace("ufsymm:eq") << " " << *i;
}
- Debug("ufsymm:eq") << " }" << endl;
+ Trace("ufsymm:eq") << " }" << endl;
}
d_termEqsOnly[matchingTerm].insert(matchingTermEquals.begin(), matchingTermEquals.end());
}
- Debug("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl;
+ Trace("ufsymm:norm") << "UFSYMM got " << kids.size() << " kids for the " << k << "-kinded Node" << endl;
sort(kids.begin(), kids.end());
return result = NodeManager::currentNM()->mkNode(k, kids);
}
if(level == 0) {
d_termEqsOnly[n[0]].insert(n[1]);
d_termEqsOnly[n[1]].insert(n[0]);
- Debug("ufsymm:eq") << "UFSYMM " << n[0] << " <==> " << n[1] << endl;
+ Trace("ufsymm:eq") << "UFSYMM " << n[0] << " <==> " << n[1] << endl;
}
}
CVC5_FALLTHROUGH;
d_assertionsToRerun.push_back(phi);
}
// use d_phi, put into d_permutations
- Debug("ufsymm") << "UFSYMM assertFormula(): phi is " << phi << endl;
+ Trace("ufsymm") << "UFSYMM assertFormula(): phi is " << phi << endl;
d_phi.push_back(phi);
if(phi.getKind() == kind::OR) {
Template t;
unordered_map<TNode, set<TNode>>& ps = t.partitions();
for (auto& kv : ps)
{
- Debug("ufsymm") << "UFSYMM partition*: " << kv.first;
+ Trace("ufsymm") << "UFSYMM partition*: " << kv.first;
set<TNode>& p = kv.second;
for(set<TNode>::iterator j = p.begin();
j != p.end();
++j) {
- Debug("ufsymm") << " " << *j;
+ Trace("ufsymm") << " " << *j;
}
- Debug("ufsymm") << endl;
+ Trace("ufsymm") << endl;
p.insert(kv.first);
Permutations::iterator pi = d_permutations.find(p);
if(pi == d_permutations.end()) {
if(!d_template.match(phi)) {
// we hit a bad match, extract the partitions and reset the template
unordered_map<TNode, set<TNode>>& ps = d_template.partitions();
- Debug("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl;
+ Trace("ufsymm") << "UFSYMM hit a bad match---have " << ps.size() << " partitions:" << endl;
for (unordered_map<TNode, set<TNode>>::iterator i = ps.begin();
i != ps.end();
++i)
{
- Debug("ufsymm") << "UFSYMM partition: " << (*i).first;
+ Trace("ufsymm") << "UFSYMM partition: " << (*i).first;
set<TNode>& p = (*i).second;
- if(Debug.isOn("ufsymm")) {
+ if(TraceIsOn("ufsymm")) {
for(set<TNode>::iterator j = p.begin();
j != p.end();
++j) {
- Debug("ufsymm") << " " << *j;
+ Trace("ufsymm") << " " << *j;
}
}
- Debug("ufsymm") << endl;
+ Trace("ufsymm") << endl;
p.insert((*i).first);
d_permutations.insert(p);
}
void SymmetryBreaker::apply(std::vector<Node>& newClauses) {
rerunAssertionsIfNecessary();
guessPermutations();
- Debug("ufsymm") << "UFSYMM =====================================================" << endl
+ Trace("ufsymm") << "UFSYMM =====================================================" << endl
<< "UFSYMM have " << d_permutations.size() << " permutation sets" << endl;
if(!d_permutations.empty()) {
{ TimerStat::CodeTimer codeTimer(d_stats.d_initNormalizationTimer);
Node n = *i;
*i = norm(n);
d_phiSet.insert(*i);
- Debug("ufsymm:norm") << "UFSYMM init-norm-rewrite " << n << endl
+ Trace("ufsymm:norm") << "UFSYMM init-norm-rewrite " << n << endl
<< "UFSYMM to " << *i << endl;
}
}
for (const Permutation& p : d_permutations)
{
++(d_stats.d_permutationSetsConsidered);
- Debug("ufsymm") << "UFSYMM looking at permutation: " << p << endl;
+ Trace("ufsymm") << "UFSYMM looking at permutation: " << p << endl;
size_t n = p.size() - 1;
if(invariantByPermutations(p)) {
++(d_stats.d_permutationSetsInvariant);
selectTerms(p);
set<Node> cts;
while(!d_terms.empty() && cts.size() <= n) {
- Debug("ufsymm") << "UFSYMM ==== top of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl;
+ Trace("ufsymm") << "UFSYMM ==== top of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl;
Terms::iterator ti = selectMostPromisingTerm(d_terms);
Node t = *ti;
- Debug("ufsymm") << "UFSYMM promising term is " << t << endl;
+ Trace("ufsymm") << "UFSYMM promising term is " << t << endl;
d_terms.erase(ti);
insertUsedIn(t, p, cts);
- if(Debug.isOn("ufsymm")) {
+ if(TraceIsOn("ufsymm")) {
if(cts.empty()) {
- Debug("ufsymm") << "UFSYMM cts is empty" << endl;
+ Trace("ufsymm") << "UFSYMM cts is empty" << endl;
} else {
for(set<Node>::iterator ctsi = cts.begin(); ctsi != cts.end(); ++ctsi) {
- Debug("ufsymm") << "UFSYMM cts: " << *ctsi << endl;
+ Trace("ufsymm") << "UFSYMM cts: " << *ctsi << endl;
}
}
}
TNode c;
- Debug("ufsymm") << "UFSYMM looking for c \\in " << p << " \\ cts" << endl;
+ Trace("ufsymm") << "UFSYMM looking for c \\in " << p << " \\ cts" << endl;
set<TNode>::const_iterator i;
for(i = p.begin(); i != p.end(); ++i) {
if(cts.find(*i) == cts.end()) {
if(c.isNull()) {
c = *i;
- Debug("ufsymm") << "UFSYMM found first: " << c << endl;
+ Trace("ufsymm") << "UFSYMM found first: " << c << endl;
} else {
- Debug("ufsymm") << "UFSYMM found second: " << *i << endl;
+ Trace("ufsymm") << "UFSYMM found second: " << *i << endl;
break;
}
}
}
if(c.isNull()) {
- Debug("ufsymm") << "UFSYMM can't find a c, restart outer loop" << endl;
+ Trace("ufsymm") << "UFSYMM can't find a c, restart outer loop" << endl;
break;
}
- Debug("ufsymm") << "UFSYMM inserting into cts: " << c << endl;
+ Trace("ufsymm") << "UFSYMM inserting into cts: " << c << endl;
cts.insert(c);
// This tests cts != p: if "i == p.end()", we got all the way
// through p without seeing two elements not in cts (on the
// second one, we break from the above loop). We know we
// found at least one (and subsequently added it to cts). So
// now cts == p.
- Debug("ufsymm") << "UFSYMM p == " << p << endl;
+ Trace("ufsymm") << "UFSYMM p == " << p << endl;
if(i != p.end() || p.size() != cts.size()) {
- Debug("ufsymm") << "UFSYMM cts != p" << endl;
+ Trace("ufsymm") << "UFSYMM cts != p" << endl;
NodeBuilder disj(kind::OR);
NodeManager* nm = NodeManager::currentNM();
for (const Node& nn : cts)
disj.clear();
++(d_stats.d_units);
}
- if(Debug.isOn("ufsymm")) {
- Debug("ufsymm") << "UFSYMM symmetry-breaking clause: " << d << endl;
+ if(TraceIsOn("ufsymm")) {
+ Trace("ufsymm") << "UFSYMM symmetry-breaking clause: " << d << endl;
} else {
- Debug("ufsymm:clauses") << "UFSYMM symmetry-breaking clause: " << d << endl;
+ Trace("ufsymm:clauses") << "UFSYMM symmetry-breaking clause: " << d << endl;
}
newClauses.push_back(d);
} else {
- Debug("ufsymm") << "UFSYMM cts == p" << endl;
+ Trace("ufsymm") << "UFSYMM cts == p" << endl;
}
- Debug("ufsymm") << "UFSYMM ==== end of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl;
+ Trace("ufsymm") << "UFSYMM ==== end of loop, d_terms.size() == " << d_terms.size() << " , cts.size() == " << cts.size() << " , n == " << n << endl;
}
}
}
void SymmetryBreaker::guessPermutations() {
// use d_phi, put into d_permutations
- Debug("ufsymm") << "UFSYMM guessPermutations()" << endl;
+ Trace("ufsymm") << "UFSYMM guessPermutations()" << endl;
}
bool SymmetryBreaker::invariantByPermutations(const Permutation& p) {
TimerStat::CodeTimer codeTimer(d_stats.d_invariantByPermutationsTimer);
// use d_phi
- Debug("ufsymm") << "UFSYMM invariantByPermutations()? " << p << endl;
+ Trace("ufsymm") << "UFSYMM invariantByPermutations()? " << p << endl;
Assert(p.size() > 1);
TypeNode type = (*permIt++).getType();
do {
if(type != (*permIt++).getType()) {
- Debug("ufsymm") << "UFSYMM types don't match, aborting.." << endl;
+ Trace("ufsymm") << "UFSYMM types don't match, aborting.." << endl;
return false;
}
} while(permIt != p.end());
Node n = norm(s);
if (nn != n && d_phiSet.find(n) == d_phiSet.end())
{
- Debug("ufsymm")
+ Trace("ufsymm")
<< "UFSYMM P_swap is NOT an inv perm op for " << p << endl
<< "UFSYMM because this node: " << nn << endl
<< "UFSYMM rewrite-norms to : " << n << endl
<< "UFSYMM which is not in our set of normalized assertions" << endl;
return false;
}
- else if (Debug.isOn("ufsymm:p"))
+ else if (TraceIsOn("ufsymm:p"))
{
if (nn == s)
{
- Debug("ufsymm:p") << "UFSYMM P_swap passes trivially: " << nn << endl;
+ Trace("ufsymm:p") << "UFSYMM P_swap passes trivially: " << nn << endl;
}
else
{
- Debug("ufsymm:p") << "UFSYMM P_swap passes: " << nn << endl
+ Trace("ufsymm:p") << "UFSYMM P_swap passes: " << nn << endl
<< "UFSYMM rewrites: " << s << endl
<< "UFSYMM norms: " << n << endl;
}
}
}
- Debug("ufsymm") << "UFSYMM P_swap is an inv perm op for " << p << endl;
+ Trace("ufsymm") << "UFSYMM P_swap is an inv perm op for " << p << endl;
// check P_circ, unless size == 2 in which case P_circ == P_swap
if(p.size() > 2) {
Node n = norm(s);
if (nn != n && d_phiSet.find(n) == d_phiSet.end())
{
- Debug("ufsymm")
+ Trace("ufsymm")
<< "UFSYMM P_circ is NOT an inv perm op for " << p << endl
<< "UFSYMM because this node: " << nn << endl
<< "UFSYMM rewrite-norms to : " << n << endl
<< endl;
return false;
}
- else if (Debug.isOn("ufsymm:p"))
+ else if (TraceIsOn("ufsymm:p"))
{
if (nn == s)
{
- Debug("ufsymm:p") << "UFSYMM P_circ passes trivially: " << nn << endl;
+ Trace("ufsymm:p") << "UFSYMM P_circ passes trivially: " << nn << endl;
}
else
{
- Debug("ufsymm:p") << "UFSYMM P_circ passes: " << nn << endl
+ Trace("ufsymm:p") << "UFSYMM P_circ passes: " << nn << endl
<< "UFSYMM rewrites: " << s << endl
<< "UFSYMM norms: " << n << endl;
}
}
}
- Debug("ufsymm") << "UFSYMM P_circ is an inv perm op for " << p << endl;
+ Trace("ufsymm") << "UFSYMM P_circ is an inv perm op for " << p << endl;
} else {
- Debug("ufsymm") << "UFSYMM no need to check P_circ, since P_circ == P_swap for perm sets of size 2" << endl;
+ Trace("ufsymm") << "UFSYMM no need to check P_circ, since P_circ == P_swap for perm sets of size 2" << endl;
}
return true;
template <class T1, class T2>
static bool isSubset(const T1& s, const T2& t) {
if(s.size() > t.size()) {
- //Debug("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t "
+ //Trace("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t "
// << "because size(s) > size(t)" << endl;
return false;
}
for(typename T1::const_iterator si = s.begin(); si != s.end(); ++si) {
if(t.find(*si) == t.end()) {
- //Debug("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t "
+ //Trace("ufsymm") << "DEBUG ASSERTION FAIL: s not a subset of t "
// << "because s element \"" << *si << "\" not in t" << endl;
return false;
}
TimerStat::CodeTimer codeTimer(d_stats.d_selectTermsTimer);
// use d_phi, put into d_terms
- Debug("ufsymm") << "UFSYMM selectTerms(): " << p << endl;
+ Trace("ufsymm") << "UFSYMM selectTerms(): " << p << endl;
d_terms.clear();
set<Node> terms;
for(Permutation::iterator i = p.begin(); i != p.end(); ++i) {
const TermEq& teq = d_termEqs[*i];
for(TermEq::const_iterator j = teq.begin(); j != teq.end(); ++j) {
- Debug("ufsymm") << "selectTerms: insert in terms " << *j << std::endl;
+ Trace("ufsymm") << "selectTerms: insert in terms " << *j << std::endl;
}
terms.insert(teq.begin(), teq.end());
}
if(d_termEqsOnly.find(*i) != d_termEqsOnly.end()) {
const TermEq& teq = d_termEqsOnly[*i];
if(isSubset(teq, p)) {
- Debug("ufsymm") << "selectTerms: teq = {";
+ Trace("ufsymm") << "selectTerms: teq = {";
for(TermEq::const_iterator j = teq.begin(); j != teq.end(); ++j) {
- Debug("ufsymm") << " " << *j << std::endl;
+ Trace("ufsymm") << " " << *j << std::endl;
}
- Debug("ufsymm") << " } is subset of p " << p << std::endl;
+ Trace("ufsymm") << " } is subset of p " << p << std::endl;
d_terms.insert(d_terms.end(), *i);
} else {
- if(Debug.isOn("ufsymm")) {
- Debug("ufsymm") << "UFSYMM selectTerms() threw away candidate: " << *i << endl;
- Debug("ufsymm:eq") << "UFSYMM selectTerms() #teq == " << teq.size() << " #p == " << p.size() << endl;
+ if(TraceIsOn("ufsymm")) {
+ Trace("ufsymm") << "UFSYMM selectTerms() threw away candidate: " << *i << endl;
+ Trace("ufsymm:eq") << "UFSYMM selectTerms() #teq == " << teq.size() << " #p == " << p.size() << endl;
TermEq::iterator j;
for(j = teq.begin(); j != teq.end(); ++j) {
- Debug("ufsymm:eq") << "UFSYMM -- teq " << *j << " in " << p << " ?" << endl;
+ Trace("ufsymm:eq") << "UFSYMM -- teq " << *j << " in " << p << " ?" << endl;
if(p.find(*j) == p.end()) {
- Debug("ufsymm") << "UFSYMM -- because its teq " << *j
+ Trace("ufsymm") << "UFSYMM -- because its teq " << *j
<< " isn't in " << p << endl;
break;
} else {
- Debug("ufsymm:eq") << "UFSYMM -- yep" << endl;
+ Trace("ufsymm:eq") << "UFSYMM -- yep" << endl;
}
}
Assert(j != teq.end())
}
}
} else {
- Debug("ufsymm") << "selectTerms: don't have data for " << *i << " so can't conclude anything" << endl;
+ Trace("ufsymm") << "selectTerms: don't have data for " << *i << " so can't conclude anything" << endl;
}
}
- if(Debug.isOn("ufsymm")) {
+ if(TraceIsOn("ufsymm")) {
for(list<Term>::iterator i = d_terms.begin(); i != d_terms.end(); ++i) {
- Debug("ufsymm") << "UFSYMM selectTerms() returning: " << *i << endl;
+ Trace("ufsymm") << "UFSYMM selectTerms() returning: " << *i << endl;
}
}
}
SymmetryBreaker::Terms::iterator
SymmetryBreaker::selectMostPromisingTerm(Terms& terms) {
// use d_phi
- Debug("ufsymm") << "UFSYMM selectMostPromisingTerm()" << endl;
+ Trace("ufsymm") << "UFSYMM selectMostPromisingTerm()" << endl;
return terms.begin();
}
void SymmetryBreaker::insertUsedIn(Term term, const Permutation& p, set<Node>& cts) {
// insert terms from p used in term into cts
- //Debug("ufsymm") << "UFSYMM usedIn(): " << term << " , " << p << endl;
+ //Trace("ufsymm") << "UFSYMM usedIn(): " << term << " , " << p << endl;
if (p.find(term) != p.end()) {
cts.insert(term);
} else {
protected:
void contextNotifyPop() override
{
- Debug("ufsymm") << "UFSYMM: clearing state due to pop" << std::endl;
+ Trace("ufsymm") << "UFSYMM: clearing state due to pop" << std::endl;
clear();
}
void TheoryUF::preRegisterTerm(TNode node)
{
- Debug("uf") << "TheoryUF::preRegisterTerm(" << node << ")" << std::endl;
+ Trace("uf") << "TheoryUF::preRegisterTerm(" << node << ")" << std::endl;
if (d_thss != nullptr)
{
void TheoryUF::explain(TNode literal, Node& exp)
{
- Debug("uf") << "TheoryUF::explain(" << literal << ")" << std::endl;
+ Trace("uf") << "TheoryUF::explain(" << literal << ")" << std::endl;
std::vector<TNode> assumptions;
// Do the work
bool polarity = literal.getKind() != kind::NOT;
}
}
- Debug("uf") << "UF : finish collectModelInfo " << std::endl;
+ Trace("uf") << "UF : finish collectModelInfo " << std::endl;
return true;
}
void TheoryUF::presolve() {
// TimerStat::CodeTimer codeTimer(d_presolveTimer);
- Debug("uf") << "uf: begin presolve()" << endl;
+ Trace("uf") << "uf: begin presolve()" << endl;
if (options().uf.ufSymmetryBreaker)
{
vector<Node> newClauses;
for(vector<Node>::const_iterator i = newClauses.begin();
i != newClauses.end();
++i) {
- Debug("uf") << "uf: generating a lemma: " << *i << std::endl;
+ Trace("uf") << "uf: generating a lemma: " << *i << std::endl;
// no proof generator provided
d_im.lemma(*i, InferenceId::UF_BREAK_SYMMETRY);
}
if( d_thss ){
d_thss->presolve();
}
- Debug("uf") << "uf: end presolve()" << endl;
+ Trace("uf") << "uf: end presolve()" << endl;
}
void TheoryUF::ppStaticLearn(TNode n, NodeBuilder& learned)
// == DIAMONDS ==
- Debug("diamonds") << "===================== looking at" << endl
+ Trace("diamonds") << "===================== looking at" << endl
<< n << endl;
// binary OR of binary ANDs of EQUALities
(n[1][1].getKind() == kind::EQUAL)) {
// now we have (a = b && c = d) || (e = f && g = h)
- Debug("diamonds") << "has form of a diamond!" << endl;
+ Trace("diamonds") << "has form of a diamond!" << endl;
TNode
a = n[0][0][0], b = n[0][0][1],
d = c;
} else {
// condition not satisfied
- Debug("diamonds") << "+ A fails" << endl;
+ Trace("diamonds") << "+ A fails" << endl;
continue;
}
- Debug("diamonds") << "+ A holds" << endl;
+ Trace("diamonds") << "+ A holds" << endl;
// same: one of {e, f} = one of {g, h}, and make "f" the
// shared node (i.e. put in the form (e = f && f = h))
h = g;
} else {
// condition not satisfied
- Debug("diamonds") << "+ B fails" << endl;
+ Trace("diamonds") << "+ B fails" << endl;
continue;
}
- Debug("diamonds") << "+ B holds" << endl;
+ Trace("diamonds") << "+ B holds" << endl;
// now we have (a = b && b = d) || (e = f && f = h)
// test that {a, d} == {e, h}
if( (a == e && d == h) ||
(a == h && d == e) ) {
// learn: n implies a == d
- Debug("diamonds") << "+ C holds" << endl;
+ Trace("diamonds") << "+ C holds" << endl;
Node newEquality = a.eqNode(d);
- Debug("diamonds") << " ==> " << newEquality << endl;
+ Trace("diamonds") << " ==> " << newEquality << endl;
learned << n.impNode(newEquality);
} else {
- Debug("diamonds") << "+ C fails" << endl;
+ Trace("diamonds") << "+ C fails" << endl;
}
}
}
Node f2 = t2->getData();
if (!d_state.areEqual(f1, f2))
{
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): checking function " << f1 << " and " << f2 << std::endl;
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): checking function " << f1 << " and " << f2 << std::endl;
vector< pair<TNode, TNode> > currentPairs;
for (size_t k = 0, nchildren = f1.getNumChildren(); k < nchildren; ++k)
{
}
}
for (unsigned c = 0; c < currentPairs.size(); ++ c) {
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): adding to care-graph" << std::endl;
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): adding to care-graph" << std::endl;
addCarePair(currentPairs[c].first, currentPairs[c].second);
}
}
// Use term indexing. We build separate indices for APPLY_UF and HO_APPLY.
// We maintain indices per operator for the former, and indices per
// function type for the latter.
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Build term indices..."
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Build term indices..."
<< std::endl;
// temporary keep set for higher-order indexing below
std::vector<Node> keep;
// for each index
for (std::pair<const Node, TNodeTrie>& tt : index)
{
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Process index "
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Process index "
<< tt.first << "..." << std::endl;
Assert(arity.find(tt.first) != arity.end());
addCarePairs(&tt.second, nullptr, arity[tt.first], 0);
}
for (std::pair<const TypeNode, TNodeTrie>& tt : hoIndex)
{
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): Process ho index "
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): Process ho index "
<< tt.first << "..." << std::endl;
// the arity of HO_APPLY is always two
addCarePairs(&tt.second, nullptr, 2, 0);
}
- Debug("uf::sharing") << "TheoryUf::computeCareGraph(): finished."
+ Trace("uf::sharing") << "TheoryUf::computeCareGraph(): finished."
<< std::endl;
}/* TheoryUF::computeCareGraph() */
void eqNotifyNewClass(TNode t) override
{
- Debug("uf-notify") << "NotifyClass::eqNotifyNewClass(" << t << ")"
+ Trace("uf-notify") << "NotifyClass::eqNotifyNewClass(" << t << ")"
<< std::endl;
d_uf.eqNotifyNewClass(t);
}
void eqNotifyMerge(TNode t1, TNode t2) override
{
- Debug("uf-notify") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2
+ Trace("uf-notify") << "NotifyClass::eqNotifyMerge(" << t1 << ", " << t2
<< ")" << std::endl;
d_uf.eqNotifyMerge(t1, t2);
}
void eqNotifyDisequal(TNode t1, TNode t2, TNode reason) override
{
- Debug("uf-notify") << "NotifyClass::eqNotifyDisequal(" << t1 << ", " << t2 << ", " << reason << ")" << std::endl;
+ Trace("uf-notify") << "NotifyClass::eqNotifyDisequal(" << t1 << ", " << t2 << ", " << reason << ")" << std::endl;
d_uf.eqNotifyDisequal(t1, t2, reason);
}
{
subs.push_back(s);
}
- if (Trace.isOn("uf-ho-beta"))
+ if (TraceIsOn("uf-ho-beta"))
{
Trace("uf-ho-beta") << "uf-ho-beta: ..sub of " << subs.size()
<< " vars into " << subs.size() << " terms :\n";
++d_statistics->d_spendResourceCalls;
d_cumulativeResourceUsed += amount;
- Debug("limit") << "ResourceManager::spendResource()" << std::endl;
+ Trace("limit") << "ResourceManager::spendResource()" << std::endl;
d_thisCallResourceUsed += amount;
if (out())
{
c.setAttribute(VarNameAttr(), "c");
// test that all boolean flags are FALSE to start
- Debug("boolattr") << "get flag 1 on a (should be F)\n";
+ Trace("boolattr") << "get flag 1 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on b (should be F)\n";
+ Trace("boolattr") << "get flag 1 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on c (should be F)\n";
+ Trace("boolattr") << "get flag 1 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 1 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 2 on a (should be F)\n";
+ Trace("boolattr") << "get flag 2 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on b (should be F)\n";
+ Trace("boolattr") << "get flag 2 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on c (should be F)\n";
+ Trace("boolattr") << "get flag 2 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 2 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 3 on a (should be F)\n";
+ Trace("boolattr") << "get flag 3 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on b (should be F)\n";
+ Trace("boolattr") << "get flag 3 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on c (should be F)\n";
+ Trace("boolattr") << "get flag 3 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 3 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 4 on a (should be F)\n";
+ Trace("boolattr") << "get flag 4 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on b (should be F)\n";
+ Trace("boolattr") << "get flag 4 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on c (should be F)\n";
+ Trace("boolattr") << "get flag 4 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 4 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 5 on a (should be F)\n";
+ Trace("boolattr") << "get flag 5 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on b (should be F)\n";
+ Trace("boolattr") << "get flag 5 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on c (should be F)\n";
+ Trace("boolattr") << "get flag 5 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 5 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag5()));
// test that they all HAVE the boolean attributes
// test two-arg version of hasAttribute()
bool bb = false;
- Debug("boolattr") << "get flag 1 on a (should be F)\n";
+ Trace("boolattr") << "get flag 1 on a (should be F)\n";
ASSERT_TRUE(a.getAttribute(TestFlag1(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 1 on b (should be F)\n";
+ Trace("boolattr") << "get flag 1 on b (should be F)\n";
ASSERT_TRUE(b.getAttribute(TestFlag1(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 1 on c (should be F)\n";
+ Trace("boolattr") << "get flag 1 on c (should be F)\n";
ASSERT_TRUE(c.getAttribute(TestFlag1(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 1 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 1 on unnamed (should be F)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag1(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 2 on a (should be F)\n";
+ Trace("boolattr") << "get flag 2 on a (should be F)\n";
ASSERT_TRUE(a.getAttribute(TestFlag2(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 2 on b (should be F)\n";
+ Trace("boolattr") << "get flag 2 on b (should be F)\n";
ASSERT_TRUE(b.getAttribute(TestFlag2(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 2 on c (should be F)\n";
+ Trace("boolattr") << "get flag 2 on c (should be F)\n";
ASSERT_TRUE(c.getAttribute(TestFlag2(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 2 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 2 on unnamed (should be F)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag2(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 3 on a (should be F)\n";
+ Trace("boolattr") << "get flag 3 on a (should be F)\n";
ASSERT_TRUE(a.getAttribute(TestFlag3(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 3 on b (should be F)\n";
+ Trace("boolattr") << "get flag 3 on b (should be F)\n";
ASSERT_TRUE(b.getAttribute(TestFlag3(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 3 on c (should be F)\n";
+ Trace("boolattr") << "get flag 3 on c (should be F)\n";
ASSERT_TRUE(c.getAttribute(TestFlag3(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 3 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 3 on unnamed (should be F)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag3(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 4 on a (should be F)\n";
+ Trace("boolattr") << "get flag 4 on a (should be F)\n";
ASSERT_TRUE(a.getAttribute(TestFlag4(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 4 on b (should be F)\n";
+ Trace("boolattr") << "get flag 4 on b (should be F)\n";
ASSERT_TRUE(b.getAttribute(TestFlag4(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 4 on c (should be F)\n";
+ Trace("boolattr") << "get flag 4 on c (should be F)\n";
ASSERT_TRUE(c.getAttribute(TestFlag4(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 4 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 4 on unnamed (should be F)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag4(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 5 on a (should be F)\n";
+ Trace("boolattr") << "get flag 5 on a (should be F)\n";
ASSERT_TRUE(a.getAttribute(TestFlag5(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 5 on b (should be F)\n";
+ Trace("boolattr") << "get flag 5 on b (should be F)\n";
ASSERT_TRUE(b.getAttribute(TestFlag5(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 5 on c (should be F)\n";
+ Trace("boolattr") << "get flag 5 on c (should be F)\n";
ASSERT_TRUE(c.getAttribute(TestFlag5(), bb));
ASSERT_FALSE(bb);
- Debug("boolattr") << "get flag 5 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 5 on unnamed (should be F)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag5(), bb));
ASSERT_FALSE(bb);
// setting boolean flags
- Debug("boolattr") << "set flag 1 on a to T\n";
+ Trace("boolattr") << "set flag 1 on a to T\n";
a.setAttribute(TestFlag1(), true);
- Debug("boolattr") << "set flag 1 on b to F\n";
+ Trace("boolattr") << "set flag 1 on b to F\n";
b.setAttribute(TestFlag1(), false);
- Debug("boolattr") << "set flag 1 on c to F\n";
+ Trace("boolattr") << "set flag 1 on c to F\n";
c.setAttribute(TestFlag1(), false);
- Debug("boolattr") << "set flag 1 on unnamed to T\n";
+ Trace("boolattr") << "set flag 1 on unnamed to T\n";
unnamed.setAttribute(TestFlag1(), true);
- Debug("boolattr") << "set flag 2 on a to F\n";
+ Trace("boolattr") << "set flag 2 on a to F\n";
a.setAttribute(TestFlag2(), false);
- Debug("boolattr") << "set flag 2 on b to T\n";
+ Trace("boolattr") << "set flag 2 on b to T\n";
b.setAttribute(TestFlag2(), true);
- Debug("boolattr") << "set flag 2 on c to T\n";
+ Trace("boolattr") << "set flag 2 on c to T\n";
c.setAttribute(TestFlag2(), true);
- Debug("boolattr") << "set flag 2 on unnamed to F\n";
+ Trace("boolattr") << "set flag 2 on unnamed to F\n";
unnamed.setAttribute(TestFlag2(), false);
- Debug("boolattr") << "set flag 3 on a to T\n";
+ Trace("boolattr") << "set flag 3 on a to T\n";
a.setAttribute(TestFlag3(), true);
- Debug("boolattr") << "set flag 3 on b to T\n";
+ Trace("boolattr") << "set flag 3 on b to T\n";
b.setAttribute(TestFlag3(), true);
- Debug("boolattr") << "set flag 3 on c to T\n";
+ Trace("boolattr") << "set flag 3 on c to T\n";
c.setAttribute(TestFlag3(), true);
- Debug("boolattr") << "set flag 3 on unnamed to T\n";
+ Trace("boolattr") << "set flag 3 on unnamed to T\n";
unnamed.setAttribute(TestFlag3(), true);
- Debug("boolattr") << "set flag 4 on a to T\n";
+ Trace("boolattr") << "set flag 4 on a to T\n";
a.setAttribute(TestFlag4(), true);
- Debug("boolattr") << "set flag 4 on b to T\n";
+ Trace("boolattr") << "set flag 4 on b to T\n";
b.setAttribute(TestFlag4(), true);
- Debug("boolattr") << "set flag 4 on c to T\n";
+ Trace("boolattr") << "set flag 4 on c to T\n";
c.setAttribute(TestFlag4(), true);
- Debug("boolattr") << "set flag 4 on unnamed to T\n";
+ Trace("boolattr") << "set flag 4 on unnamed to T\n";
unnamed.setAttribute(TestFlag4(), true);
- Debug("boolattr") << "set flag 5 on a to T\n";
+ Trace("boolattr") << "set flag 5 on a to T\n";
a.setAttribute(TestFlag5(), true);
- Debug("boolattr") << "set flag 5 on b to T\n";
+ Trace("boolattr") << "set flag 5 on b to T\n";
b.setAttribute(TestFlag5(), true);
- Debug("boolattr") << "set flag 5 on c to F\n";
+ Trace("boolattr") << "set flag 5 on c to F\n";
c.setAttribute(TestFlag5(), false);
- Debug("boolattr") << "set flag 5 on unnamed to T\n";
+ Trace("boolattr") << "set flag 5 on unnamed to T\n";
unnamed.setAttribute(TestFlag5(), true);
ASSERT_EQ(a.getAttribute(VarNameAttr()), "a");
ASSERT_FALSE(c.hasAttribute(TestStringAttr2()));
ASSERT_FALSE(unnamed.hasAttribute(TestStringAttr2()));
- Debug("boolattr") << "get flag 1 on a (should be T)\n";
+ Trace("boolattr") << "get flag 1 on a (should be T)\n";
ASSERT_TRUE(a.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on b (should be F)\n";
+ Trace("boolattr") << "get flag 1 on b (should be F)\n";
ASSERT_FALSE(b.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on c (should be F)\n";
+ Trace("boolattr") << "get flag 1 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 1 on unnamed (should be T)\n";
+ Trace("boolattr") << "get flag 1 on unnamed (should be T)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag1()));
- Debug("boolattr") << "get flag 2 on a (should be F)\n";
+ Trace("boolattr") << "get flag 2 on a (should be F)\n";
ASSERT_FALSE(a.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on b (should be T)\n";
+ Trace("boolattr") << "get flag 2 on b (should be T)\n";
ASSERT_TRUE(b.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on c (should be T)\n";
+ Trace("boolattr") << "get flag 2 on c (should be T)\n";
ASSERT_TRUE(c.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 2 on unnamed (should be F)\n";
+ Trace("boolattr") << "get flag 2 on unnamed (should be F)\n";
ASSERT_FALSE(unnamed.getAttribute(TestFlag2()));
- Debug("boolattr") << "get flag 3 on a (should be T)\n";
+ Trace("boolattr") << "get flag 3 on a (should be T)\n";
ASSERT_TRUE(a.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on b (should be T)\n";
+ Trace("boolattr") << "get flag 3 on b (should be T)\n";
ASSERT_TRUE(b.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on c (should be T)\n";
+ Trace("boolattr") << "get flag 3 on c (should be T)\n";
ASSERT_TRUE(c.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 3 on unnamed (should be T)\n";
+ Trace("boolattr") << "get flag 3 on unnamed (should be T)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag3()));
- Debug("boolattr") << "get flag 4 on a (should be T)\n";
+ Trace("boolattr") << "get flag 4 on a (should be T)\n";
ASSERT_TRUE(a.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on b (should be T)\n";
+ Trace("boolattr") << "get flag 4 on b (should be T)\n";
ASSERT_TRUE(b.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on c (should be T)\n";
+ Trace("boolattr") << "get flag 4 on c (should be T)\n";
ASSERT_TRUE(c.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 4 on unnamed (should be T)\n";
+ Trace("boolattr") << "get flag 4 on unnamed (should be T)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag4()));
- Debug("boolattr") << "get flag 5 on a (should be T)\n";
+ Trace("boolattr") << "get flag 5 on a (should be T)\n";
ASSERT_TRUE(a.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on b (should be T)\n";
+ Trace("boolattr") << "get flag 5 on b (should be T)\n";
ASSERT_TRUE(b.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on c (should be F)\n";
+ Trace("boolattr") << "get flag 5 on c (should be F)\n";
ASSERT_FALSE(c.getAttribute(TestFlag5()));
- Debug("boolattr") << "get flag 5 on unnamed (should be T)\n";
+ Trace("boolattr") << "get flag 5 on unnamed (should be T)\n";
ASSERT_TRUE(unnamed.getAttribute(TestFlag5()));
a.setAttribute(TestStringAttr1(), "foo");
Command* cmd;
while ((cmd = parser->nextCommand()) != NULL)
{
- Debug("parser") << "Parsed command: " << (*cmd) << std::endl;
+ Trace("parser") << "Parsed command: " << (*cmd) << std::endl;
delete cmd;
}
Command* cmd;
while ((cmd = parser->nextCommand()) != NULL)
{
- Debug("parser") << "Parsed command: " << (*cmd) << std::endl;
+ Trace("parser") << "Parsed command: " << (*cmd) << std::endl;
delete cmd;
}
std::cout << "\nBad input succeeded:\n" << badInput << std::endl;
TEST_F(TestTheoryArithRewriterBlack, RealAlgebraicNumber)
{
- Trace.on("arith-rewriter");
{
RealAlgebraicNumber two({-8, 0, 0, 1}, 1, 3);
Node n = d_nodeManager->mkRealAlgebraicNumber(two);
void SetUp() override
{
TestSmt::SetUp();
- Debug.on("datatypes");
- Debug.on("groundterms");
+ TraceChannel.on("datatypes");
+ TraceChannel.on("groundterms");
}
};
colors.addConstructor(green);
colors.addConstructor(red);
- Debug("datatypes") << colors << std::endl;
+ Trace("datatypes") << colors << std::endl;
TypeNode colorsType = d_nodeManager->mkDatatypeType(colors);
- Debug("datatypes") << colorsType << std::endl;
+ Trace("datatypes") << colorsType << std::endl;
Node ctor = colorsType.getDType()[1].getConstructor();
Node apply = d_nodeManager->mkNode(kind::APPLY_CONSTRUCTOR, ctor);
- Debug("datatypes") << apply << std::endl;
+ Trace("datatypes") << apply << std::endl;
ASSERT_FALSE(colorsType.getDType().isParametric());
ASSERT_TRUE(colorsType.getDType().isFinite());
Cardinality::EQUAL);
ASSERT_EQ(ctor.getType().getCardinality().compare(1), Cardinality::EQUAL);
ASSERT_TRUE(colorsType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << colorsType.getDType().getName()
+ Trace("groundterms") << "ground term of " << colorsType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(colorsType)
<< std::endl;
std::make_shared<DTypeConstructor>("zero");
nat.addConstructor(zero);
- Debug("datatypes") << nat << std::endl;
+ Trace("datatypes") << nat << std::endl;
TypeNode natType = d_nodeManager->mkDatatypeType(nat);
- Debug("datatypes") << natType << std::endl;
+ Trace("datatypes") << natType << std::endl;
Node ctor = natType.getDType()[1].getConstructor();
Node apply = d_nodeManager->mkNode(kind::APPLY_CONSTRUCTOR, ctor);
- Debug("datatypes") << apply << std::endl;
+ Trace("datatypes") << apply << std::endl;
ASSERT_FALSE(natType.getDType().isParametric());
ASSERT_FALSE(natType.getDType().isFinite());
ASSERT_TRUE(natType.getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(natType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << natType.getDType().getName()
+ Trace("groundterms") << "ground term of " << natType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(natType)
<< std::endl;
leaf->addArg("leaf", integerType);
tree.addConstructor(leaf);
- Debug("datatypes") << tree << std::endl;
+ Trace("datatypes") << tree << std::endl;
TypeNode treeType = d_nodeManager->mkDatatypeType(tree);
- Debug("datatypes") << treeType << std::endl;
+ Trace("datatypes") << treeType << std::endl;
ASSERT_FALSE(treeType.getDType().isParametric());
ASSERT_FALSE(treeType.getDType().isFinite());
treeType.getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(treeType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << treeType.getDType().getName()
+ Trace("groundterms") << "ground term of " << treeType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(treeType)
<< std::endl;
std::make_shared<DTypeConstructor>("nil");
list.addConstructor(nil);
- Debug("datatypes") << list << std::endl;
+ Trace("datatypes") << list << std::endl;
TypeNode listType = d_nodeManager->mkDatatypeType(list);
- Debug("datatypes") << listType << std::endl;
+ Trace("datatypes") << listType << std::endl;
ASSERT_FALSE(listType.getDType().isParametric());
ASSERT_FALSE(listType.getDType().isFinite());
listType.getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(listType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << listType.getDType().getName()
+ Trace("groundterms") << "ground term of " << listType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(listType)
<< std::endl;
std::make_shared<DTypeConstructor>("nil");
list.addConstructor(nil);
- Debug("datatypes") << list << std::endl;
+ Trace("datatypes") << list << std::endl;
TypeNode listType = d_nodeManager->mkDatatypeType(list);
- Debug("datatypes") << listType << std::endl;
+ Trace("datatypes") << listType << std::endl;
ASSERT_FALSE(listType.getDType().isParametric());
ASSERT_FALSE(listType.getDType().isFinite());
ASSERT_TRUE(listType.getDType().getCardinality().compare(Cardinality::REALS)
== Cardinality::EQUAL);
ASSERT_TRUE(listType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << listType.getDType().getName()
+ Trace("groundterms") << "ground term of " << listType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(listType)
<< std::endl;
std::make_shared<DTypeConstructor>("nil");
list.addConstructor(nil);
- Debug("datatypes") << list << std::endl;
+ Trace("datatypes") << list << std::endl;
TypeNode listType = d_nodeManager->mkDatatypeType(list);
- Debug("datatypes") << listType << std::endl;
+ Trace("datatypes") << listType << std::endl;
ASSERT_FALSE(listType.getDType().isFinite());
ASSERT_TRUE(
listType.getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(listType.getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << listType.getDType().getName()
+ Trace("groundterms") << "ground term of " << listType.getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(listType)
<< std::endl;
leaf->addArg("leaf", unresList);
tree.addConstructor(leaf);
- Debug("datatypes") << tree << std::endl;
+ Trace("datatypes") << tree << std::endl;
DType list("list");
std::shared_ptr<DTypeConstructor> cons =
std::make_shared<DTypeConstructor>("nil");
list.addConstructor(nil);
- Debug("datatypes") << list << std::endl;
+ Trace("datatypes") << list << std::endl;
ASSERT_FALSE(tree.isResolved());
ASSERT_FALSE(list.isResolved());
ASSERT_TRUE(dtts[0].getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(dtts[0].getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << dtts[0].getDType().getName()
+ Trace("groundterms") << "ground term of " << dtts[0].getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(dtts[0])
<< std::endl;
ASSERT_TRUE(dtts[1].getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(dtts[1].getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << dtts[1].getDType().getName()
+ Trace("groundterms") << "ground term of " << dtts[1].getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(dtts[1])
<< std::endl;
dtts2[0].getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(dtts2[0].getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << dtts2[0].getDType().getName()
+ Trace("groundterms") << "ground term of " << dtts2[0].getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(dtts2[0])
<< std::endl;
dtts2[1].getDType().getCardinality().compare(Cardinality::INTEGERS)
== Cardinality::EQUAL);
ASSERT_TRUE(dtts2[1].getDType().isWellFounded());
- Debug("groundterms") << "ground term of " << dtts2[1].getDType().getName()
+ Trace("groundterms") << "ground term of " << dtts2[1].getDType().getName()
<< std::endl
<< " is " << d_nodeManager->mkGroundTerm(dtts2[1])
<< std::endl;
node->addArgSelf("right");
tree.addConstructor(node);
- Debug("datatypes") << tree << std::endl;
+ Trace("datatypes") << tree << std::endl;
TypeNode treeType = d_nodeManager->mkDatatypeType(tree);
- Debug("datatypes") << treeType << std::endl;
+ Trace("datatypes") << treeType << std::endl;
ASSERT_FALSE(treeType.getDType().isParametric());
ASSERT_FALSE(treeType.getDType().isFinite());
void SetUp() override
{
TestInternal::SetUp();
- DebugChannel.setStream(&d_debugStream);
TraceChannel.setStream(&d_traceStream);
WarningChannel.setStream(&d_warningStream);
TEST_F(TestUtilBlackOutput, output)
{
- Debug.on("foo");
- Debug("foo") << "testing1";
- Debug.off("foo");
- Debug("foo") << "testing2";
- Debug.on("foo");
- Debug("foo") << "testing3";
-
Warning() << "bad warning!";
- Trace.on("foo");
+ TraceChannel.on("foo");
Trace("foo") << "tracing1";
- Trace.off("foo");
+ TraceChannel.off("foo");
Trace("foo") << "tracing2";
- Trace.on("foo");
+ TraceChannel.on("foo");
Trace("foo") << "tracing3";
#ifdef CVC5_MUZZLE
- ASSERT_EQ(d_debugStream.str(), "");
ASSERT_EQ(d_warningStream.str(), "");
ASSERT_EQ(d_traceStream.str(), "");
#else /* CVC5_MUZZLE */
-#ifdef CVC5_DEBUG
- ASSERT_EQ(d_debugStream.str(), "testing1testing3");
-#else /* CVC5_DEBUG */
- ASSERT_EQ(d_debugStream.str(), "");
-#endif /* CVC5_DEBUG */
-
ASSERT_EQ(d_warningStream.str(), "bad warning!");
#ifdef CVC5_TRACING
TEST_F(TestUtilBlackOutput, evaluation_off_when_it_is_supposed_to_be)
{
- Debug.on("foo");
-#ifndef CVC5_DEBUG
- ASSERT_FALSE(Debug.isOn("foo"));
- Debug("foo") << failure() << std::endl;
-#else
- ASSERT_TRUE(Debug.isOn("foo"));
-#endif
- Debug.off("foo");
-
- Trace.on("foo");
+ TraceChannel.on("foo");
#ifndef CVC5_TRACING
- ASSERT_FALSE(Trace.isOn("foo"));
+ ASSERT_FALSE(TraceIsOn("foo"));
Trace("foo") << failure() << std::endl;
#else
- ASSERT_TRUE(Trace.isOn("foo"));
+ ASSERT_TRUE(TraceIsOn("foo"));
#endif
- Trace.off("foo");
+ TraceChannel.off("foo");
#ifdef CVC5_MUZZLE
- ASSERT_FALSE(Debug.isOn("foo"));
- ASSERT_FALSE(Trace.isOn("foo"));
+ ASSERT_FALSE(TraceIsOn("foo"));
+ ASSERT_FALSE(TraceIsOn("foo"));
ASSERT_FALSE(Warning.isOn());
cout << "debug" << std::endl;
- Debug("foo") << failure() << std::endl;
+ Trace("foo") << failure() << std::endl;
cout << "trace" << std::endl;
Trace("foo") << failure() << std::endl;
cout << "warning" << std::endl;
{
#ifdef CVC5_MUZZLE
- Debug.off("yo");
- Debug("yo") << "foobar";
- ASSERT_EQ(d_debugStream.str(), std::string());
- d_debugStream.str("");
- Debug.on("yo");
- Debug("yo") << "baz foo";
- ASSERT_EQ(d_debugStream.str(), std::string());
- d_debugStream.str("");
-
- Trace.off("yo");
+ TraceChannel.off("yo");
Trace("yo") << "foobar";
ASSERT_EQ(d_traceStream.str(), std::string());
d_traceStream.str("");
- Trace.on("yo");
+ TraceChannel.on("yo");
Trace("yo") << "baz foo";
ASSERT_EQ(d_traceStream.str(), std::string());
d_traceStream.str("");
#else /* CVC5_MUZZLE */
- Debug.off("yo");
- Debug("yo") << "foobar";
- ASSERT_EQ(d_debugStream.str(), std::string());
- d_debugStream.str("");
- Debug.on("yo");
- Debug("yo") << "baz foo";
-#ifdef CVC5_DEBUG
- ASSERT_EQ(d_debugStream.str(), std::string("baz foo"));
-#else /* CVC5_DEBUG */
- ASSERT_EQ(d_debugStream.str(), std::string());
-#endif /* CVC5_DEBUG */
- d_debugStream.str("");
-
- Trace.off("yo");
+ TraceChannel.off("yo");
Trace("yo") << "foobar";
ASSERT_EQ(d_traceStream.str(), std::string());
d_traceStream.str("");
- Trace.on("yo");
+ TraceChannel.on("yo");
Trace("yo") << "baz foo";
#ifdef CVC5_TRACING
ASSERT_EQ(d_traceStream.str(), std::string("baz foo"));