GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/arrays/union_find.cpp Lines: 1 13 7.7 %
Date: 2021-03-23 Branches: 2 142 1.4 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file union_find.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Morgan Deters
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 Path-compressing, backtrackable union-find using an undo
13
 ** stack. Refactored from the UF union-find.
14
 **
15
 ** Path-compressing, backtrackable union-find using an undo stack
16
 ** rather than storing items in a CDMap<>.
17
 **/
18
19
#include <iostream>
20
21
#include "expr/node.h"
22
#include "theory/arrays/union_find.h"
23
24
using namespace std;
25
26
namespace CVC4 {
27
namespace theory {
28
namespace arrays {
29
30
template <class NodeType, class NodeHash>
31
void UnionFind<NodeType, NodeHash>::notify() {
32
  Trace("arraysuf") << "arraysUF cancelling : " << d_offset << " < " << d_trace.size() << " ?" << endl;
33
  while(d_offset < d_trace.size()) {
34
    pair<TNode, TNode> p = d_trace.back();
35
    if(p.second.isNull()) {
36
      d_map.erase(p.first);
37
      Trace("arraysuf") << "arraysUF   " << d_trace.size() << " erasing " << p.first << endl;
38
    } else {
39
      d_map[p.first] = p.second;
40
      Trace("arraysuf") << "arraysUF   " << d_trace.size() << " replacing " << p << endl;
41
    }
42
    d_trace.pop_back();
43
  }
44
  Trace("arraysuf") << "arraysUF cancelling finished." << endl;
45
}
46
47
// The following declarations allow us to put functions in the .cpp file
48
// instead of the header, since we know which instantiations are needed.
49
50
template void UnionFind<Node, NodeHashFunction>::notify();
51
52
template void UnionFind<TNode, TNodeHashFunction>::notify();
53
54
}/* CVC4::theory::arrays namespace */
55
}/* CVC4::theory namespace */
56
26685
}/* CVC4 namespace */