Skip to content

Commit

Permalink
Test rawTerm support
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli committed Dec 4, 2023
1 parent 063b1f0 commit 54b1534
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 193 deletions.
2 changes: 1 addition & 1 deletion include/runtime/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ extern const uint32_t first_inj_tag, last_inj_tag;
bool is_injection(block *);
block *strip_injection(block *);
block *constructKItemInj(void *subject, const char *sort, bool raw_value);
block *constructRawTerm(void *subject, const char *sort);
block *constructRawTerm(void *subject, const char *sort, bool raw_value);
}

std::string floatToString(const floating *);
Expand Down
4 changes: 2 additions & 2 deletions runtime/util/ConfigurationSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void serializeTermToFile(

void serializeRawTermToFile(
const char *filename, void *subject, const char *sort) {
block *term = constructRawTerm(subject, sort);
block *term = constructRawTerm(subject, sort, true);

char *data;
size_t size;
Expand All @@ -455,7 +455,7 @@ void serializeRawTermToFile(
std::shared_ptr<kllvm::KOREPattern>
sortedTermToKorePattern(block *subject, const char *sort) {
auto is_kitem = (std::string(sort) == "SortKItem{}");
block *term = is_kitem ? subject : constructRawTerm(subject, sort);
block *term = is_kitem ? subject : constructRawTerm(subject, sort, false);

char *data_out;
size_t size_out;
Expand Down
4 changes: 2 additions & 2 deletions runtime/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ block *constructKItemInj(void *subject, const char *sort, bool raw_value) {
return static_cast<block *>(constructCompositePattern(tag, args));
}

block *constructRawTerm(void *subject, const char *sort) {
block *constructRawTerm(void *subject, const char *sort, bool raw_value) {
auto tag = getTagForSymbolName("rawTerm{}");
auto args = std::vector{
static_cast<void *>(constructKItemInj(subject, sort, true))};
static_cast<void *>(constructKItemInj(subject, sort, raw_value))};
return static_cast<block *>(constructCompositePattern(tag, args));
}

Expand Down
Loading

0 comments on commit 54b1534

Please sign in to comment.