37 Program& program = translationUnit.getProgram();
41 std::set<std::string>& singletons;
43 replaceSingletons(std::set<std::string>& singletons) : singletons(singletons) {}
47 if (singletons.find(var->getName()) != singletons.end()) {
48 return mk<UnnamedVariable>();
58 std::set<std::string> nonsingletons;
59 std::set<std::string> vars;
62 const std::string& name = var.getName();
63 if (vars.find(name) != vars.end()) {
65 nonsingletons.insert(name);
71 std::set<std::string> ignoredVars;
75 std::set<std::string> recordVars;
81 std::set<std::string> constraintVars;
83 visitDepthFirst(cons, [&](
const ast::Variable& var) { ignoredVars.insert(var.getName()); });
86 std::set<std::string> singletons;
87 for (
auto& var : vars) {
88 if ((nonsingletons.find(var) == nonsingletons.end()) &&
89 (ignoredVars.find(var) == ignoredVars.end())) {
91 singletons.insert(var);
96 replaceSingletons update(singletons);
97 clause->apply(update);