This PR removes the few remaining usages of the CVC5Message() and gets rid of the whole thing.
DebugC DebugChannel(&std::cout);
WarningC WarningChannel(&std::cerr);
-MessageC MessageChannel(&std::cout);
TraceC TraceChannel(&std::cout);
std::ostream DumpOutC::dump_cout(std::cout.rdbuf()); // copy cout stream buffer
DumpOutC DumpOutChannel(&DumpOutC::dump_cout);
}; /* class WarningC */
-/** The message output class */
-class MessageC
-{
- std::ostream* d_os;
-
-public:
- explicit MessageC(std::ostream* os) : d_os(os) {}
-
- Cvc5ostream operator()() const { return Cvc5ostream(d_os); }
-
- std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
- std::ostream& getStream() const { return *d_os; }
- std::ostream* getStreamPointer() const { return d_os; }
-
- bool isOn() const { return d_os != &null_os; }
-}; /* class MessageC */
-
/** The trace output class */
class TraceC
{
extern DebugC DebugChannel CVC5_EXPORT;
/** The warning output singleton */
extern WarningC WarningChannel CVC5_EXPORT;
-/** The message output singleton */
-extern MessageC MessageChannel CVC5_EXPORT;
/** The trace output singleton */
extern TraceC TraceChannel CVC5_EXPORT;
/** The dump output singleton */
::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel
#define WarningOnce \
::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::WarningChannel
-#define CVC5Message \
- ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::MessageChannel
#define Trace ::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::TraceChannel
#define DumpOut \
::cvc5::__cvc5_true() ? ::cvc5::nullStream : ::cvc5::DumpOutChannel
|| !::cvc5::WarningChannel.warnOnce(__FILE__, __LINE__)) \
? ::cvc5::nullStream \
: ::cvc5::WarningChannel
-#define CVC5Message \
- (!::cvc5::MessageChannel.isOn()) ? ::cvc5::nullStream : ::cvc5::MessageChannel
#ifdef CVC5_TRACING
#define Trace ::cvc5::TraceChannel
#else /* CVC5_TRACING */
if(Configuration::isMuzzledBuild()) {
DebugChannel.setStream(&cvc5::null_os);
TraceChannel.setStream(&cvc5::null_os);
- MessageChannel.setStream(&cvc5::null_os);
WarningChannel.setStream(&cvc5::null_os);
}
dopts.in(),
dopts.out());
- CVC5Message() << Configuration::getPackageName() << " "
- << Configuration::getVersionString();
+ auto& out = solver->getDriverOptions().out();
+ out << Configuration::getPackageName() << " "
+ << Configuration::getVersionString();
if (Configuration::isGitBuild())
{
- CVC5Message() << " [" << Configuration::getGitInfo() << "]";
+ out << " [" << Configuration::getGitInfo() << "]";
}
- CVC5Message() << (Configuration::isDebugBuild() ? " DEBUG" : "")
- << " assertions:"
- << (Configuration::isAssertionBuild() ? "on" : "off")
- << endl
- << endl;
- CVC5Message() << Configuration::copyright() << endl;
+ out << (Configuration::isDebugBuild() ? " DEBUG" : "") << " assertions:"
+ << (Configuration::isAssertionBuild() ? "on" : "off") << std::endl
+ << std::endl
+ << Configuration::copyright() << std::endl;
while(true) {
try {
{
Debug.setStream(me);
Warning.setStream(me);
- CVC5Message.setStream(me);
Trace.setStream(me);
}
if(Configuration::isMuzzledBuild()) {
DebugChannel.setStream(&cvc5::null_os);
TraceChannel.setStream(&cvc5::null_os);
- MessageChannel.setStream(&cvc5::null_os);
WarningChannel.setStream(&cvc5::null_os);
} else {
if(value < 0) {
- MessageChannel.setStream(&cvc5::null_os);
WarningChannel.setStream(&cvc5::null_os);
} else {
- MessageChannel.setStream(&std::cout);
WarningChannel.setStream(&std::cerr);
}
}
{
Debug.getStream() << Command::printsuccess(value);
Trace.getStream() << Command::printsuccess(value);
- CVC5Message.getStream() << Command::printsuccess(value);
Warning.getStream() << Command::printsuccess(value);
*d_options->base.out << Command::printsuccess(value);
}
{
Debug.getStream() << expr::ExprSetDepth(depth);
Trace.getStream() << expr::ExprSetDepth(depth);
- CVC5Message.getStream() << expr::ExprSetDepth(depth);
Warning.getStream() << expr::ExprSetDepth(depth);
}
{
Debug.getStream() << expr::ExprDag(dag);
Trace.getStream() << expr::ExprDag(dag);
- CVC5Message.getStream() << expr::ExprDag(dag);
Warning.getStream() << expr::ExprDag(dag);
}
if (!d_unconstrained.empty())
{
processUnconstrained();
- // d_substitutions.print(CVC5Message.getStream());
for (size_t i = 0, asize = assertions.size(); i < asize; ++i)
{
Node a = assertions[i];
Node ev = d_quant_models[f].evaluate(fmfmc, inst);
if (ev == d_true)
{
- CVC5Message() << "WARNING: instantiation was true! " << f << " "
- << mcond[i] << std::endl;
- AlwaysAssert(false);
+ AlwaysAssert(false) << "WARNING: instantiation was true! " << f
+ << " " << mcond[i] << std::endl;
}
else
{
{
Node f = qa.d_fundef_f;
if( d_fun_defs.find( f )!=d_fun_defs.end() ){
- CVC5Message() << "Cannot define function " << f << " more than once."
- << std::endl;
- AlwaysAssert(false);
+ AlwaysAssert(false) << "Cannot define function " << f
+ << " more than once." << std::endl;
}
d_fun_defs[f] = true;
}
}
}
-void SubstitutionMap::debugPrint() const { print(CVC5Message.getStream()); }
-
} // namespace theory
std::ostream& operator<<(std::ostream& out, const theory::SubstitutionMap::iterator& i) {
* Print to the output stream
*/
void print(std::ostream& out) const;
- void debugPrint() const;
}; /* class SubstitutionMap */
}
if (ss == b_t)
{
- CVC5Message() << "Bad split " << s << std::endl;
- AlwaysAssert(false);
+ AlwaysAssert(false) << "Bad split " << s << std::endl;
}
}
if (Trace.isOn("uf-ss-split-si"))
for( std::map< TypeNode, SortModel* >::iterator it = d_rep_model.begin(); it != d_rep_model.end(); ++it ){
if( !it->second->hasCardinalityAsserted() ){
Trace("uf-ss-warn") << "WARNING: Assert " << n << " as a decision before cardinality for " << it->first << "." << std::endl;
- // CVC5Message() << "Error: constraint asserted before cardinality
- // for " << it->first << std::endl; Unimplemented();
}
}
}
TestInternal::SetUp();
DebugChannel.setStream(&d_debugStream);
TraceChannel.setStream(&d_traceStream);
- MessageChannel.setStream(&d_messageStream);
WarningChannel.setStream(&d_warningStream);
d_debugStream.str("");
d_traceStream.str("");
- d_messageStream.str("");
d_warningStream.str("");
}
}
std::stringstream d_debugStream;
std::stringstream d_traceStream;
- std::stringstream d_messageStream;
std::stringstream d_warningStream;
};
Debug.on("foo");
Debug("foo") << "testing3";
- CVC5Message() << "a message";
Warning() << "bad warning!";
Trace.on("foo");
#ifdef CVC5_MUZZLE
ASSERT_EQ(d_debugStream.str(), "");
- ASSERT_EQ(d_messageStream.str(), "");
ASSERT_EQ(d_warningStream.str(), "");
ASSERT_EQ(d_traceStream.str(), "");
ASSERT_EQ(d_debugStream.str(), "");
#endif /* CVC5_DEBUG */
- ASSERT_EQ(d_messageStream.str(), "a message");
ASSERT_EQ(d_warningStream.str(), "bad warning!");
#ifdef CVC5_TRACING
ASSERT_FALSE(Debug.isOn("foo"));
ASSERT_FALSE(Trace.isOn("foo"));
ASSERT_FALSE(Warning.isOn());
- ASSERT_FALSE(CVC5Message.isOn());
cout << "debug" << std::endl;
Debug("foo") << failure() << std::endl;
Trace("foo") << failure() << std::endl;
cout << "warning" << std::endl;
Warning() << failure() << std::endl;
- cout << "message" << std::endl;
- CVC5Message() << failure() << std::endl;
#endif
}
ASSERT_EQ(d_warningStream.str(), std::string());
d_warningStream.str("");
- CVC5Message() << "baz foo";
- ASSERT_EQ(d_messageStream.str(), std::string());
- d_messageStream.str("");
-
#else /* CVC5_MUZZLE */
Debug.off("yo");
ASSERT_EQ(d_warningStream.str(), std::string("baz foo"));
d_warningStream.str("");
- CVC5Message() << "baz foo";
- ASSERT_EQ(d_messageStream.str(), std::string("baz foo"));
- d_messageStream.str("");
-
#endif /* CVC5_MUZZLE */
}
} // namespace test