Skip to content

Commit

Permalink
Basic working version bound to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli committed Nov 24, 2023
1 parent 4db5e79 commit e2b3946
Show file tree
Hide file tree
Showing 5 changed files with 2,220 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bindings/core/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ simplify(std::shared_ptr<KOREPattern> pattern, std::shared_ptr<KORESort> sort) {
std::shared_ptr<KOREPattern> evaluate_function(
std::string const &label,
std::vector<std::shared_ptr<KOREPattern>> const &args) {
abort();
auto term_args = std::vector<void *>{};
for (auto const &arg : args) {
term_args.push_back(static_cast<void *>(construct_term(arg)));
}

auto tag = getTagForSymbolName(label.c_str());
auto result = evaluateFunctionSymbol(tag, term_args.data());

return term_to_pattern(static_cast<block *>(result));
}

bool is_sort_kitem(std::shared_ptr<KORESort> const &sort) {
Expand Down
1 change: 1 addition & 0 deletions bindings/python/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <kllvm/bindings/core/core.h>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

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

0 comments on commit e2b3946

Please sign in to comment.