3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 08:35:31 +00:00

insert fresh name

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2012-11-18 20:11:48 -08:00
parent f014ab9598
commit f98e107d0e
2 changed files with 3 additions and 1 deletions

View file

@ -1697,8 +1697,9 @@ namespace datalog {
while (fresh_names.contains(nm)) {
std::ostringstream s;
s << nm << "!";
nm = symbol(s.str().c_str());
nm = symbol(s.str().c_str());
}
fresh_names.add(nm);
out << " :named " << nm << ")";
}
out << ")\n";

View file

@ -35,6 +35,7 @@ class mk_fresh_name {
public:
mk_fresh_name(): m_char('A'), m_num(0) {}
void add(ast* a);
void add(symbol const& s) { m_symbols.insert(s); }
symbol next();
bool contains(symbol const& s) const { return m_symbols.contains(s); }
};