@@ -95,6 +95,13 @@ auto t_lt(const T1&, const T2&) {
9595 throw std::domain_error (ss.str ());
9696 return nullptr ; // Must return something
9797}
98+ template <typename T1, typename T2>
99+ auto t_implies (const T1&, const T2&) {
100+ std::ostringstream ss{};
101+ ss << " Unable to imply (=>) types " << typeid (T1).name () << " and " << typeid (T2).name ();
102+ throw std::domain_error (ss.str ());
103+ return nullptr ; // Must return something
104+ }
98105
99106template <>
100107auto t_and (const bool & a, const bool & b) {
@@ -112,6 +119,11 @@ template<>
112119auto t_not (const bool & a) {
113120 return !a;
114121}
122+ template <>
123+ auto t_implies (const bool & a, const bool & b) {
124+ if (a) return b;
125+ return true ;
126+ }
115127
116128auto t_gt (const int & a, const int & b) {return a > b;}
117129auto t_gt (const int & a, const float & b) {return a > b;}
@@ -206,3 +218,8 @@ symbol_value_t lt_(const symbol_value_t& a, const symbol_value_t& b) {
206218 FUNC_IMPL (a, t_lt, b, res);
207219 return res;
208220}
221+ symbol_value_t implies_ (const symbol_value_t & a, const symbol_value_t & b) {
222+ symbol_value_t res{};
223+ FUNC_IMPL (a, t_implies, b, res);
224+ return res;
225+ }
0 commit comments