Skip to content

Commit

Permalink
remove unneeded existence check with provenance and interpreter
Browse files Browse the repository at this point in the history
this is now handled by the data structure, and also allows us to
re-enable multi-threading with the interpreter and provenance
  • Loading branch information
davidwzhao authored and XiaowenHu96 committed Jul 31, 2020
1 parent 76749c0 commit 218cca3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
29 changes: 0 additions & 29 deletions src/AstTranslator.cpp
Expand Up @@ -491,35 +491,6 @@ std::unique_ptr<RamOperation> AstTranslator::ClauseTranslator::createOperation(c
std::make_unique<RamEmptinessCheck>(translator.translateRelation(head)), std::move(project));
}

// check existence for original tuple if we have provenance
// only if we don't compile
if (Global::config().has("provenance") &&
((!Global::config().has("compile") && !Global::config().has("dl-program") &&
!Global::config().has("generate")))) {
size_t auxiliaryArity = translator.getEvaluationArity(head);
auto arity = head->getArity() - auxiliaryArity;
std::vector<std::unique_ptr<RamExpression>> values;
bool isVolatile = true;
auto args = head->getArguments();

// add args for original tuple
for (size_t i = 0; i < arity; i++) {
auto arg = args[i];
// don't add counters
visitDepthFirst(*arg, [&](const AstCounter&) { isVolatile = false; });
values.push_back(translator.translateValue(arg, valueIndex));
}
for (size_t i = 0; i < auxiliaryArity; i++) {
values.push_back(std::make_unique<RamUndefValue>());
}
if (isVolatile) {
return std::make_unique<RamFilter>(
std::make_unique<RamNegation>(std::make_unique<RamExistenceCheck>(
translator.translateRelation(head), std::move(values))),
std::move(project));
}
}

// build up insertion call
return project; // start with innermost
}
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Expand Up @@ -581,10 +581,12 @@ int main(int argc, char** argv) {
profiler.join();
}
if (Global::config().has("provenance")) {
/*
// Test for bugged combination of provenance, interpreted souffle, and concurrency
if (Global::config().get("jobs") != "1") {
throw std::runtime_error("Provenance is not supported with parallel interpreted mode");
}
*/

// only run explain interface if interpreted
InterpreterProgInterface interface(*interpreter);
Expand Down
2 changes: 1 addition & 1 deletion tests/provenance.at
Expand Up @@ -21,7 +21,7 @@ dnl $1 -- test name
dnl $2 -- category
m4_define([POSITIVE_PROVENANCE_TEST],[
m4_ifblank(m4_join([],ENV_CONFS), [
m4_define([PROV_FLAGS], [[], [-c], [-c -j8]])
m4_define([PROV_FLAGS], [[], [-j8], [-c], [-c -j8]])
], [
m4_define([PROV_FLAGS], [ENV_CONFS])
])
Expand Down

0 comments on commit 218cca3

Please sign in to comment.