Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of quoted symbol names #369

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions core/unroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
**
**/

#include <assert.h>
#include "unroller.h"

#include <algorithm>
#include <cassert>

#include "smt-switch/utils.h"

#include "unroller.h"
#include "utils/syntax_analysis_common.h"

using namespace smt;
using namespace std;
Expand Down Expand Up @@ -95,9 +96,10 @@ Term Unroller::var_at_time(const Term & v, unsigned int k)
return it->second;
}

std::string name = v->to_string();
std::string name = syntax_analysis::name_desanitize(v->to_string());
name += time_id_ + std::to_string(k);
Term timed_v = solver_->make_symbol(name, v->get_sort());
Term timed_v =
solver_->make_symbol(syntax_analysis::name_sanitize(name), v->get_sort());
cache[v] = timed_v;
untime_cache_[timed_v] = v;
var_times_[timed_v] = k;
Expand Down
10 changes: 5 additions & 5 deletions modifiers/implicit_predicate_abstractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include "modifiers/implicit_predicate_abstractor.h"

#include "assert.h"
#include "utils/logger.h"
#include "smt/available_solvers.h"
#include "utils/logger.h"
#include "utils/syntax_analysis_common.h"

using namespace smt;
using namespace std;


namespace pono {

bool contains_var(const Term & p, const UnorderedTermSet & vars)
Expand Down Expand Up @@ -64,7 +64,6 @@ ImplicitPredicateAbstractor::ImplicitPredicateAbstractor(
throw PonoException(
"Implicit predicate abstraction needs a relational abstract system");
}

}

Term ImplicitPredicateAbstractor::abstract(Term & t)
Expand Down Expand Up @@ -217,8 +216,9 @@ UnorderedTermSet ImplicitPredicateAbstractor::do_abstraction()
// for incrementality
// only create new variables if not present in cache
if (abstraction_cache_.find(nv) == abstraction_cache_.end()) {
Term abs_nv = abs_rts_.make_inputvar(nv->to_string() + "^",
nv->get_sort());
auto abs_var_name = syntax_analysis::name_sanitize(
syntax_analysis::name_desanitize(nv->to_string()) + "^");
Term abs_nv = abs_rts_.make_inputvar(abs_var_name, nv->get_sort());
// map next var to this abstracted next var
update_term_cache(nv, abs_nv);
}
Expand Down
Loading