Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Implementation of inference information utility. 11 : : */ 12 : : 13 : : #include "theory/arith/rewrites.h" 14 : : 15 : : #include <iostream> 16 : : 17 : : #include "base/check.h" 18 : : 19 : : namespace cvc5::internal { 20 : : namespace theory { 21 : : namespace arith { 22 : : 23 : 16 : const char* toString(Rewrite r) 24 : : { 25 [ + + ][ + + ]: 16 : switch (r) [ + + ][ + + ] [ + + ][ + + ] [ + + ][ + + ] [ - - ] 26 : : { 27 : 1 : case Rewrite::NONE: return "NONE"; 28 : 1 : case Rewrite::CONST_EVAL: return "CONST_EVAL"; 29 : 1 : case Rewrite::MOD_TOTAL_BY_CONST: return "MOD_TOTAL_BY_CONST"; 30 : 1 : case Rewrite::DIV_TOTAL_BY_CONST: return "DIV_TOTAL_BY_CONST"; 31 : 1 : case Rewrite::DIV_MOD_BY_ZERO: return "DIV_MOD_BY_ZERO"; 32 : 1 : case Rewrite::MOD_BY_ONE: return "MOD_BY_ONE"; 33 : 1 : case Rewrite::DIV_BY_ONE: return "DIV_BY_ONE"; 34 : 1 : case Rewrite::DIV_MOD_PULL_NEG_DEN: return "DIV_MOD_PULL_NEG_DEN"; 35 : 1 : case Rewrite::MOD_OVER_MOD: return "MOD_OVER_MOD"; 36 : 1 : case Rewrite::MOD_CHILD_MOD: return "MOD_CHILD_MOD"; 37 : 1 : case Rewrite::DIV_OVER_MOD: return "DIV_OVER_MOD"; 38 : 1 : case Rewrite::INT_EXT_CONST: return "INT_EXT_CONST"; 39 : 1 : case Rewrite::INT_EXT_INT: return "INT_EXT_INT"; 40 : 1 : case Rewrite::INT_EXT_PI: return "INT_EXT_PI"; 41 : 1 : case Rewrite::INT_EXT_TO_REAL: return "INT_EXT_TO_REAL"; 42 : 1 : case Rewrite::INEQ_BV_TO_NAT_ELIM: return "INEQ_BV_TO_NAT_ELIM"; 43 : 0 : case Rewrite::UNKNOWN: return "?"; 44 : 0 : default: 45 : 0 : DebugUnhandled() << "No print for rewrite " << static_cast<size_t>(r); 46 : : return "?unhandled"; 47 : : } 48 : : } 49 : : 50 : 16 : std::ostream& operator<<(std::ostream& out, Rewrite r) 51 : : { 52 : 16 : out << toString(r); 53 : 16 : return out; 54 : : } 55 : : 56 : : } // namespace arith 57 : : } // namespace theory 58 : : } // namespace cvc5::internal