diff --git a/bindings/python/ast.cpp b/bindings/python/ast.cpp index 902a772d3..44f4ab861 100644 --- a/bindings/python/ast.cpp +++ b/bindings/python/ast.cpp @@ -445,6 +445,10 @@ void bind_proof_trace(py::module_ &m) { return parser.parse_proof_trace(str); }, py::arg("bytes"), py::arg("header")); + + py::class_>( + proof_trace, "kore_header") + .def(py::init(&kore_header::create), py::arg("path")); } PYBIND11_MODULE(_kllvm, m) { diff --git a/include/kllvm/binary/deserializer.h b/include/kllvm/binary/deserializer.h index 834043d3e..207ec2b0c 100644 --- a/include/kllvm/binary/deserializer.h +++ b/include/kllvm/binary/deserializer.h @@ -21,6 +21,13 @@ class kore_header { public: kore_header(FILE *in); + static std::unique_ptr create(std::string path) { + FILE *f = fopen(path.c_str(), "rb"); + auto *result = new kore_header(f); + fclose(f); + return std::unique_ptr(result); + } + [[nodiscard]] uint8_t get_arity(uint32_t offset) const { return arities_[offset]; };