Skip to content

Commit 0f6a42a

Browse files
committed
Changing user_relations function declaration
1 parent aa6df74 commit 0f6a42a

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/cprover/chc_db.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
chc_dbt::chc_sett chc_dbt::m_empty_set;
88
std::unordered_set<exprt, irep_hash> chc_grapht::m_expr_empty_set;
99

10-
void horn_clauset::used_relations(chc_dbt &db, std::vector<symbol_exprt> & out) const
10+
std::vector<symbol_exprt> horn_clauset::used_relations(chc_dbt &db) const
1111
{
12+
std::vector<symbol_exprt> out;
1213
const exprt *body = this->body();
13-
if (body == nullptr) return;
14+
if (body == nullptr) return out;
1415
std::set<symbol_exprt> symbols = find_symbols(*body);
1516

1617
chc_dbt::is_state_pred filter(db);
@@ -19,6 +20,7 @@ void horn_clauset::used_relations(chc_dbt &db, std::vector<symbol_exprt> & out)
1920
out.push_back(symb);
2021
}
2122
}
23+
return out;
2224
}
2325

2426
void horn_clauset::used_func_app(chc_dbt &db, std::vector<function_application_exprt> & out) const
@@ -63,8 +65,7 @@ void chc_dbt::build_indices()
6365
exprt func = to_function_application_expr(*r.head()).function();
6466
m_head_idx[func].insert(i);
6567

66-
std::vector<symbol_exprt> use;
67-
r.used_relations(*this, use);
68+
std::vector<symbol_exprt> use = r.used_relations(*this);
6869
for (auto & symb : use)
6970
{
7071
m_body_idx[symb].insert(i);

src/cprover/chc_db.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ class horn_clauset
100100
return m_chc < other.m_chc;
101101
}
102102

103-
void used_relations(chc_dbt &db, std::vector<symbol_exprt> & out) const;
104-
void used_func_app(chc_dbt &db, std::vector<function_application_exprt> & out) const;
103+
std::vector<symbol_exprt> used_relations(chc_dbt &db) const;
104+
void used_func_app(chc_dbt &db, std::vector<function_application_exprt> &out)
105+
const;
105106
};
106107

107108
/*

src/cprover/chc_large_step.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class resolution_visitort : public wto_element_visitort
5858
{
5959
if(clause.is_query())
6060
{
61-
clause.used_relations(m_db, rels);
61+
std::vector<symbol_exprt> r = clause.used_relations(m_db);
62+
rels.insert(rels.end(), r.begin(), r.end());
6263
}
6364
}
6465

@@ -90,8 +91,7 @@ class resolution_visitort : public wto_element_visitort
9091
for (auto idx : m_db.def(*symb))
9192
{
9293
auto & clause = m_db.get_clause(idx);
93-
std::vector<symbol_exprt> use;
94-
clause.used_relations(m_db, use);
94+
std::vector<symbol_exprt> use = clause.used_relations(m_db);
9595
if (use.size() > 1) {
9696
throw incorrect_goto_program_exceptiont("Non-linear CHCs not supported yet");
9797
}

0 commit comments

Comments
 (0)