Skip to content

Commit 1e8cd05

Browse files
committed
Added getting term names out of NamedUnsatCore-s
1 parent 7cef5bc commit 1e8cd05

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/unsatcores/UnsatCore.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ void NamedUnsatCore::printTerm(std::ostream & os, PTRef term) const {
3737
os << termNames.nameForTerm(term);
3838
}
3939

40+
std::vector<std::string> NamedUnsatCore::makeTermNamesTp(vec<PTRef> const & terms) const {
41+
std::vector<std::string> names;
42+
for (PTRef term : terms) {
43+
names.push_back(termNames.nameForTerm(term));
44+
}
45+
return names;
46+
}
47+
48+
std::vector<std::string> NamedUnsatCore::makeTermNames() const {
49+
return makeTermNamesTp(getTerms());
50+
}
51+
52+
std::vector<std::string> NamedUnsatCore::makeHiddenTermNames() const {
53+
return makeTermNamesTp(getHiddenTerms());
54+
}
55+
4056
void FullUnsatCore::printTerm(std::ostream & os, PTRef term) const {
4157
os << logic.printTerm(term);
4258
}

src/unsatcores/UnsatCore.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class NamedUnsatCore : public UnsatCore {
3636

3737
vec<PTRef> const & getHiddenTerms() const { return hiddenTerms; }
3838

39+
std::vector<std::string> makeTermNames() const;
40+
std::vector<std::string> makeHiddenTermNames() const;
41+
3942
protected:
4043
friend class UnsatCoreBuilder;
4144

@@ -47,6 +50,9 @@ class NamedUnsatCore : public UnsatCore {
4750

4851
vec<PTRef> namedTerms;
4952
vec<PTRef> hiddenTerms;
53+
54+
private:
55+
std::vector<std::string> makeTermNamesTp(vec<PTRef> const &) const;
5056
};
5157

5258
class FullUnsatCore : public UnsatCore {

0 commit comments

Comments
 (0)