3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 13:58:45 +00:00

use different symbols for named rules

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2012-11-18 19:00:01 -08:00
parent 9c304d7642
commit f014ab9598
2 changed files with 10 additions and 3 deletions

View file

@ -1683,7 +1683,8 @@ namespace datalog {
for (unsigned i = 0; i < rules.size(); ++i) {
out << (use_fixedpoint_extensions?"(rule ":"(assert ");
expr* r = rules[i].get();
if (symbol::null != names[i]) {
symbol nm = names[i];
if (symbol::null != nm) {
out << "(! ";
}
if (use_fixedpoint_extensions) {
@ -1692,8 +1693,13 @@ namespace datalog {
else {
out << mk_smt_pp(r, m);
}
if (symbol::null != names[i]) {
out << " :named " << names[i] << ")";
if (symbol::null != nm) {
while (fresh_names.contains(nm)) {
std::ostringstream s;
s << nm << "!";
nm = symbol(s.str().c_str());
}
out << " :named " << nm << ")";
}
out << ")\n";
}

View file

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