LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/theory/arith - rewrites.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 21 24 87.5 %
Date: 2025-02-22 13:05:26 Functions: 2 2 100.0 %
Branches: 16 18 88.9 %

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

Generated by: LCOV version 1.14