GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bags/rewrites.cpp Lines: 1 49 2.0 %
Date: 2021-03-23 Branches: 2 44 4.5 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file rewrites.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Mudathir Mohamed
6
 ** This file is part of the CVC4 project.
7
 ** Copyright (c) 2009-2021 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.\endverbatim
11
 **
12
 ** \brief Implementation of inference information utility.
13
 **/
14
15
#include "theory/bags/rewrites.h"
16
17
#include <iostream>
18
19
namespace CVC4 {
20
namespace theory {
21
namespace bags {
22
23
const char* toString(Rewrite r)
24
{
25
  switch (r)
26
  {
27
    case Rewrite::NONE: return "NONE";
28
    case Rewrite::CARD_DISJOINT: return "CARD_DISJOINT";
29
    case Rewrite::CARD_MK_BAG: return "CARD_MK_BAG";
30
    case Rewrite::CHOOSE_MK_BAG: return "CHOOSE_MK_BAG";
31
    case Rewrite::CONSTANT_EVALUATION: return "CONSTANT_EVALUATION";
32
    case Rewrite::COUNT_EMPTY: return "COUNT_EMPTY";
33
    case Rewrite::COUNT_MK_BAG: return "COUNT_MK_BAG";
34
    case Rewrite::DUPLICATE_REMOVAL_MK_BAG: return "DUPLICATE_REMOVAL_MK_BAG";
35
    case Rewrite::EQ_CONST_FALSE: return "EQ_CONST_FALSE";
36
    case Rewrite::EQ_REFL: return "EQ_REFL";
37
    case Rewrite::EQ_SYM: return "EQ_SYM";
38
    case Rewrite::FROM_SINGLETON: return "FROM_SINGLETON";
39
    case Rewrite::IDENTICAL_NODES: return "IDENTICAL_NODES";
40
    case Rewrite::INTERSECTION_EMPTY_LEFT: return "INTERSECTION_EMPTY_LEFT";
41
    case Rewrite::INTERSECTION_EMPTY_RIGHT: return "INTERSECTION_EMPTY_RIGHT";
42
    case Rewrite::INTERSECTION_SAME: return "INTERSECTION_SAME";
43
    case Rewrite::INTERSECTION_SHARED_LEFT: return "INTERSECTION_SHARED_LEFT";
44
    case Rewrite::INTERSECTION_SHARED_RIGHT: return "INTERSECTION_SHARED_RIGHT";
45
    case Rewrite::IS_SINGLETON_MK_BAG: return "IS_SINGLETON_MK_BAG";
46
    case Rewrite::MK_BAG_COUNT_NEGATIVE: return "MK_BAG_COUNT_NEGATIVE";
47
    case Rewrite::REMOVE_FROM_UNION: return "REMOVE_FROM_UNION";
48
    case Rewrite::REMOVE_MIN: return "REMOVE_MIN";
49
    case Rewrite::REMOVE_RETURN_LEFT: return "REMOVE_RETURN_LEFT";
50
    case Rewrite::REMOVE_SAME: return "REMOVE_SAME";
51
    case Rewrite::SUB_BAG: return "SUB_BAG";
52
    case Rewrite::SUBTRACT_DISJOINT_SHARED_LEFT:
53
      return "SUBTRACT_DISJOINT_SHARED_LEFT";
54
    case Rewrite::SUBTRACT_DISJOINT_SHARED_RIGHT:
55
      return "SUBTRACT_DISJOINT_SHARED_RIGHT";
56
    case Rewrite::SUBTRACT_FROM_UNION: return "SUBTRACT_FROM_UNION";
57
    case Rewrite::SUBTRACT_MIN: return "SUBTRACT_MIN";
58
    case Rewrite::SUBTRACT_RETURN_LEFT: return "SUBTRACT_RETURN_LEFT";
59
    case Rewrite::SUBTRACT_SAME: return "SUBTRACT_SAME";
60
    case Rewrite::UNION_DISJOINT_EMPTY_LEFT: return "UNION_DISJOINT_EMPTY_LEFT";
61
    case Rewrite::TO_SINGLETON: return "TO_SINGLETON";
62
    case Rewrite::UNION_DISJOINT_EMPTY_RIGHT:
63
      return "UNION_DISJOINT_EMPTY_RIGHT";
64
    case Rewrite::UNION_DISJOINT_MAX_MIN: return "UNION_DISJOINT_MAX_MIN";
65
    case Rewrite::UNION_MAX_EMPTY: return "UNION_MAX_EMPTY";
66
    case Rewrite::UNION_MAX_SAME_OR_EMPTY: return "UNION_MAX_SAME_OR_EMPTY";
67
    case Rewrite::UNION_MAX_UNION_LEFT: return "UNION_MAX_UNION_LEFT";
68
    case Rewrite::UNION_MAX_UNION_RIGHT: return "UNION_MAX_UNION_RIGHT";
69
70
    default: return "?";
71
  }
72
}
73
74
std::ostream& operator<<(std::ostream& out, Rewrite r)
75
{
76
  out << toString(r);
77
  return out;
78
}
79
80
}  // namespace bags
81
}  // namespace theory
82
26685
}  // namespace CVC4