Skip to content

Commit 2b68394

Browse files
fix #7103
1 parent f8a3b6f commit 2b68394

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/smt/theory_special_relations.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -893,11 +893,17 @@ namespace smt {
893893

894894
func_decl* memf, *nextf, *connectedf;
895895

896-
std::string member, next, connected_sym;
897-
unsigned index = r.decl()->get_parameter(0).get_int();
898-
member = "member" + std::to_string(index);
899-
next = "next" + std::to_string(index);
900-
connected_sym = "connected" + std::to_string(index);
896+
std::string member, next, connected_sym, id;
897+
auto const& pa = r.decl()->get_parameter(0);
898+
if (pa.is_int())
899+
id = std::to_string(pa.get_int());
900+
else if (pa.is_ast() && is_func_decl(pa.get_ast()))
901+
id = to_func_decl(pa.get_ast())->get_name().str();
902+
else
903+
throw default_exception("expected an integer or function declaration");
904+
member = "member" + id;
905+
next = "next" + id;
906+
connected_sym = "connected" + id;
901907
{
902908
sort* dom[2] = { s, listS };
903909
recfun::promise_def mem = p.ensure_def(symbol(member), 2, dom, m.mk_bool_sort(), true);

0 commit comments

Comments
 (0)