|
8 | 8 | #include <util/mathematical_expr.h> |
9 | 9 | #include <util/std_expr.h> |
10 | 10 | #include <util/find_symbols.h> |
11 | | -#include <language_util.h> |
12 | 11 |
|
13 | 12 | #include <vector> |
14 | 13 | #include <map> |
@@ -101,10 +100,8 @@ class horn_clauset |
101 | 100 | return m_chc < other.m_chc; |
102 | 101 | } |
103 | 102 |
|
104 | | - template <typename OutputIterator> |
105 | | - void used_relations(chc_dbt &db, OutputIterator out) const; |
106 | | - template <typename OutputIterator> |
107 | | - void used_func_app(chc_dbt &db, OutputIterator out) const; |
| 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; |
108 | 105 | }; |
109 | 106 |
|
110 | 107 | /* |
@@ -192,44 +189,6 @@ class chc_dbt |
192 | 189 | chcst::const_iterator end() const { return m_clauses.end(); } |
193 | 190 | }; |
194 | 191 |
|
195 | | -template <typename OutputIterator> |
196 | | -void horn_clauset::used_relations(chc_dbt &db, OutputIterator out) const |
197 | | -{ |
198 | | - const exprt *body = this->body(); |
199 | | - if (body == nullptr) return; |
200 | | - std::set<symbol_exprt> symbols = find_symbols(*body); |
201 | | - |
202 | | - chc_dbt::is_state_pred filter(db); |
203 | | - for (auto & symb : symbols) { |
204 | | - if (filter(symb)) { |
205 | | - *out = symb; |
206 | | - } |
207 | | - } |
208 | | -} |
209 | | - |
210 | | -template <typename OutputIterator> |
211 | | -void horn_clauset::used_func_app(chc_dbt &db, OutputIterator out) const |
212 | | -{ |
213 | | - const exprt *body = this->body(); |
214 | | - if (body == nullptr) return; |
215 | | - |
216 | | - std::unordered_set<function_application_exprt, irep_hash> funcs; |
217 | | - body->visit_pre([&funcs](const exprt &expr) { |
218 | | - if (can_cast_expr<function_application_exprt>(expr)) |
219 | | - { |
220 | | - const function_application_exprt & f = to_function_application_expr(expr); |
221 | | - funcs.insert(f); |
222 | | - } |
223 | | - }); |
224 | | - |
225 | | - chc_dbt::is_state_pred filter(db); |
226 | | - for (auto & f : funcs) { |
227 | | - if (filter(to_symbol_expr(f.function()))) { |
228 | | - *out = f; |
229 | | - } |
230 | | - } |
231 | | -} |
232 | | - |
233 | 192 | /* |
234 | 193 | * The CHC dependency graph. |
235 | 194 | * Uninterpreted relations are vertices, dependency is based on clauses: |
|
0 commit comments