Skip to content

Commit 3f64f44

Browse files
committed
1. YAUCL update
2. IFTE update
1 parent cc7c890 commit 3f64f44

8 files changed

Lines changed: 433 additions & 12 deletions

File tree

CMakeCache.txt

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.

include/queries/closure.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,19 +1303,22 @@ struct closure {
13031303
}
13041304
}
13051305

1306+
// if ((vertex == 0) && (graph_id == 0))
1307+
// std::cout << "HERE" << std::endl;
1308+
13061309
Interpret I(graph_id, pattern_id, pattern_result.first, it->second, table_offset, *this, pr.morphisms,
13071310
forloading);
13081311
if (pattern.has_where) {
13091312
// std::cout << "TGraph #" << graph_id << ": applying pattern " << pattern.pattern_name << " for node " << vertex << std::endl;
1313+
13101314
if ((I.interpret(pattern.where, 1).empty())) {
13111315
table_offset++;
13121316
continue; //next entry
13131317
}
13141318
}
1319+
// std::cout << "FGraph #" << graph_id << ": applying pattern " << pattern.pattern_name << " for node " << vertex << std::endl;
13151320

13161321

1317-
if ((vertex == 3) && (graph_id == 2))
1318-
std::cout << "HERE" << std::endl;
13191322
for (const auto& operation : pattern.rwr_to) {
13201323
switch (operation.t) {
13211324

include/queries/delta_updates.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ struct delta_updates {
7777
*/
7878
inline void set_removed(size_t default_val){
7979
size_t toRemove = getOrDefault(replacement_map, default_val, default_val);
80-
if ((toRemove == 6) || (default_val == 6))
81-
std::cerr << "EHRE" << std::endl;
80+
// if ((toRemove == 6) || (default_val == 6))
81+
// std::cerr << "EHRE" << std::endl;
8282
if (!newIterationInsertedObjects.contains(toRemove))
8383
removed_objects.insert(toRemove);
8484
else

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <vector>
2-
#include "database/GSMIso.h"
2+
#include <database/GSMIso.h>
33

44
#include <args.hxx>
55
#include <string>

src/queries/closure.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ void closure::generate_materialised_view() {
308308
size_t new_id = legacy_object_old_data.id;
309309
auto& obj = updates.delta_plus_db.O[new_id];
310310
obj.id = new_id;
311-
if ((graphid== 2) && (legacy_object_old_data.id == 3))
312-
std::cout << "DREBUG" << std::endl;
311+
// if ((graphid== 2) && (legacy_object_old_data.id == 3))
312+
// std::cout << "DREBUG" << std::endl;
313313
obj.updateWith(legacy_object_old_data);
314314
for (auto& [k, v] :obj.phi) {
315315
i = 0;

src/scriptv2/ScriptAST.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,20 @@ DPtr<script::structures::ScriptAST> script::structures::ScriptAST::run(bool impl
647647
return lx->javaComparator(rx) == 0 ? true_() : false_();
648648
}
649649

650-
case IfteE:
651-
return arrayList[0]->toBoolean() ? arrayList[0]->run(implode) : arrayList[1]->run(implode);
650+
case IfteE: {
651+
auto cond = arrayList[0]->toBoolean();
652+
if (cond) {
653+
auto tmp = arrayList[1]->run(implode);
654+
return tmp;
655+
} else {
656+
auto tmp = arrayList[2]->run(implode);
657+
return tmp;
658+
}
659+
}
660+
return arrayList[0]->toBoolean() ? arrayList[1]->run(implode) : arrayList[2]->run(implode);
652661

653662
case ImplyE:
654-
return arrayList[0]->toBoolean() ? arrayList[0]->run(implode) : arrayList[1]->run(implode);
663+
return arrayList[0]->toBoolean() ? arrayList[1]->run(implode) : arrayList[0]->run(implode);
655664

656665
case InvokeE:
657666
case ApplyE:

src/scriptv2/ScriptVisitor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,11 @@ namespace script {
371371
}
372372

373373
std::any ScriptVisitor::visitIfte(scriptParser::IfteContext *context) {
374-
return std::any();
374+
auto lx = std::any_cast<DPtr<script::structures::ScriptAST>>(visit(context->cp()->term(0)));
375+
auto M = visit(context->cp()->term(1));
376+
auto mx = std::any_cast<DPtr<script::structures::ScriptAST>>(M);
377+
auto rx = std::any_cast<DPtr<script::structures::ScriptAST>>(visit(context->expr()));
378+
return script::structures::ScriptAST::terop_(this->context, script::structures::t::IfteE, std::move(lx), std::move(mx), std::move(rx));
375379
}
376380

377381

submodules/yaucl

Submodule yaucl updated from 5a0db1b to 836a1d5

0 commit comments

Comments
 (0)