souffle  2.0.2-371-g6315b36
ProvenanceExistenceCheck.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file ProvenanceExistenceCheck.h
12  *
13  * Defines a class for evaluating conditions in the Relational Algebra
14  * Machine.
15  *
16  ***********************************************************************/
17 
18 #pragma once
19 
21 #include "ram/Expression.h"
22 #include "ram/Relation.h"
24 #include <memory>
25 #include <sstream>
26 #include <utility>
27 #include <vector>
28 
29 namespace souffle::ram {
30 
31 /**
32  * @class ProvenanceExistenceCheck
33  * @brief Provenance Existence check for a relation
34  */
35 class ProvenanceExistenceCheck : public AbstractExistenceCheck {
36 public:
37  ProvenanceExistenceCheck(std::string rel, VecOwn<Expression> vals)
38  : AbstractExistenceCheck(rel, std::move(vals)) {}
39 
40  ProvenanceExistenceCheck* clone() const override {
41  VecOwn<Expression> newValues;
42  for (auto& cur : values) {
43  newValues.emplace_back(cur->clone());
44  }
45  return new ProvenanceExistenceCheck(relation, std::move(newValues));
46  }
47 
48 protected:
49  void print(std::ostream& os) const override {
50  os << "prov";
52  }
53 };
54 
55 } // namespace souffle::ram
AbstractExistenceCheck.h
souffle::ram::AbstractExistenceCheck::print
void print(std::ostream &os) const override
Print RAM node.
Definition: AbstractExistenceCheck.h:85
MiscUtil.h
souffle::ram
Definition: AstToRamTranslator.h:54
souffle::ram::ProvenanceExistenceCheck::print
void print(std::ostream &os) const override
Print RAM node.
Definition: ProvenanceExistenceCheck.h:56
Relation.h
souffle::ram::AbstractExistenceCheck::relation
const std::string relation
Relation.
Definition: AbstractExistenceCheck.h:95
std
Definition: Brie.h:3053
souffle::ram::AbstractExistenceCheck::values
VecOwn< Expression > values
Search tuple.
Definition: AbstractExistenceCheck.h:98
Expression.h
souffle::ram::AbstractExistenceCheck::AbstractExistenceCheck
AbstractExistenceCheck(std::string rel, VecOwn< Expression > vals)
Definition: AbstractExistenceCheck.h:49
souffle::ram::ProvenanceExistenceCheck::clone
ProvenanceExistenceCheck * clone() const override
Create a clone (i.e.
Definition: ProvenanceExistenceCheck.h:47
rel
void rel(size_t limit, bool showLimit=true)
Definition: Tui.h:1086
souffle::ram::ProvenanceExistenceCheck::ProvenanceExistenceCheck
ProvenanceExistenceCheck(std::string rel, VecOwn< Expression > vals)
Definition: ProvenanceExistenceCheck.h:44