Skip to content

Commit bf43a91

Browse files
committed
Basic working version bound to Python
1 parent 48ced28 commit bf43a91

File tree

5 files changed

+2220
-1
lines changed

5 files changed

+2220
-1
lines changed

bindings/core/src/core.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ simplify(std::shared_ptr<KOREPattern> pattern, std::shared_ptr<KORESort> sort) {
6767
std::shared_ptr<KOREPattern> evaluate_function(
6868
std::string const &label,
6969
std::vector<std::shared_ptr<KOREPattern>> const &args) {
70-
abort();
70+
auto term_args = std::vector<void *>{};
71+
for (auto const &arg : args) {
72+
term_args.push_back(static_cast<void *>(construct_term(arg)));
73+
}
74+
75+
auto tag = getTagForSymbolName(label.c_str());
76+
auto result = evaluateFunctionSymbol(tag, term_args.data());
77+
78+
return term_to_pattern(static_cast<block *>(result));
7179
}
7280

7381
bool is_sort_kitem(std::shared_ptr<KORESort> const &sort) {

bindings/python/runtime.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <kllvm/bindings/core/core.h>
33

44
#include <pybind11/pybind11.h>
5+
#include <pybind11/stl.h>
56

67
// This header needs to be included last because it pollutes a number of macro
78
// definitions into the global namespace.

0 commit comments

Comments
 (0)