From 5b2c33bf0bd968b970d5f228f291477d20b751df Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Fri, 27 Apr 2018 18:45:58 -0500 Subject: [PATCH] Print function for equality status. (#1826) --- src/theory/valuation.cpp | 20 ++++++++++++++++++++ src/theory/valuation.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/theory/valuation.cpp b/src/theory/valuation.cpp index 7151b4aaf..0056fb22f 100644 --- a/src/theory/valuation.cpp +++ b/src/theory/valuation.cpp @@ -22,6 +22,26 @@ namespace CVC4 { namespace theory { +std::ostream& operator<<(std::ostream& os, EqualityStatus s) +{ + switch (s) + { + case EQUALITY_TRUE_AND_PROPAGATED: + os << "EQUALITY_TRUE_AND_PROPAGATED"; + break; + case EQUALITY_FALSE_AND_PROPAGATED: + os << "EQUALITY_FALSE_AND_PROPAGATED"; + break; + case EQUALITY_TRUE: os << "EQUALITY_TRUE"; break; + case EQUALITY_FALSE: os << "EQUALITY_FALSE"; break; + case EQUALITY_TRUE_IN_MODEL: os << "EQUALITY_TRUE_IN_MODEL"; break; + case EQUALITY_FALSE_IN_MODEL: os << "EQUALITY_FALSE_IN_MODEL"; break; + case EQUALITY_UNKNOWN: os << "EQUALITY_UNKNOWN"; break; + default: Unhandled(); break; + } + return os; +} + bool equalityStatusCompatible(EqualityStatus s1, EqualityStatus s2) { switch (s1) { case EQUALITY_TRUE: diff --git a/src/theory/valuation.h b/src/theory/valuation.h index e78a629e1..160a7b970 100644 --- a/src/theory/valuation.h +++ b/src/theory/valuation.h @@ -54,6 +54,8 @@ enum EqualityStatus { EQUALITY_UNKNOWN };/* enum EqualityStatus */ +std::ostream& operator<<(std::ostream& os, EqualityStatus s); + /** * Returns true if the two statuses are compatible, i.e. both TRUE * or both FALSE (regardless of inmodel/propagation). -- 2.30.2