Adding model assertions after SAT responses.
[cvc5.git] / src / util / uninterpreted_constant.cpp
1 /********************* */
2 /*! \file uninterpreted_constant.cpp
3 ** \verbatim
4 ** Original author: mdeters
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009-2012 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
13 **
14 ** \brief Representation of constants of uninterpreted sorts
15 **
16 ** Representation of constants of uninterpreted sorts.
17 **/
18
19 #include "util/uninterpreted_constant.h"
20 #include <iostream>
21 #include <sstream>
22 #include <string>
23
24 using namespace std;
25
26 namespace CVC4 {
27
28 std::ostream& operator<<(std::ostream& out, const UninterpretedConstant& uc) {
29 stringstream ss;
30 ss << uc.getType();
31 string t = ss.str();
32 size_t i = 0;
33 // replace everything that isn't in [a-zA-Z0-9_] with an _
34 while((i = t.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_", i)) != string::npos) {
35 t.replace(i, 1, 1, '_');
36 }
37 return out << "uc_" << t << '_' << uc.getIndex();
38 }
39
40 }/* CVC4 namespace */