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:
parent
9c304d7642
commit
f014ab9598
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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); }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue