souffle  2.0.2-371-g6315b36
Relation.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2019, The Souffle Developers. 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 Relation.h
12  *
13  * Defines Interpreter Relations
14  *
15  ***********************************************************************/
16 
17 #pragma once
18 
19 #include "interpreter/Index.h"
20 #include "ram/analysis/Index.h"
21 #include "souffle/RamTypes.h"
23 #include <cstddef>
24 #include <cstdint>
25 #include <deque>
26 #include <iterator>
27 #include <memory>
28 #include <set>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 namespace souffle::interpreter {
34 
35 /**
36  * Wrapper for InterpreterRelation.
37  *
38  * This class unifies the InterpreterRelation template classes.
39  * It also defines virtual interfaces for ProgInterface and some virtual helper functions for interpreter
40  * execution.
41  */
42 struct RelationWrapper {
44 
45 public:
48 
49  virtual ~RelationWrapper() = default;
50 
51  // -- Define methods and interfaces for ProgInterface. --
52 public:
53  /**
54  * A virtualized iterator class that can be used by the Proginterface.
55  * Define behaviors to uniformly access the underlying tuple regardless its structure and arity.
56  */
57  class iterator_base {
58  public:
59  virtual ~iterator_base() = default;
60 
61  virtual iterator_base& operator++() = 0;
62 
63  virtual const RamDomain* operator*() = 0;
64 
65  /*
66  * A clone method is required by ProgInterface.
67  */
68  virtual iterator_base* clone() const = 0;
69 
70  virtual bool equal(const iterator_base& other) const = 0;
71  };
72 
73  /**
74  * The iterator interface.
75  *
76  * Other class should use this iterator class to traverse the relation.
77  */
78  class Iterator {
80 
81  public:
82  Iterator(const Iterator& other) : iter(other.iter->clone()) {}
84 
85  Iterator& operator++() {
86  ++(*iter);
87  return *this;
88  }
89 
90  const RamDomain* operator*() {
91  return **iter;
92  }
93 
94  bool operator==(const Iterator& other) const {
95  return iter->equal(*other.iter);
96  }
97 
98  bool operator!=(const Iterator& other) const {
99  return !(*this == other);
100  }
101  };
102 
103  virtual Iterator begin() const = 0;
104 
105  virtual Iterator end() const = 0;
106 
107  virtual void insert(const RamDomain*) = 0;
108 
109  virtual bool contains(const RamDomain*) const = 0;
110 
111  virtual size_t size() const = 0;
112 
113  virtual void purge() = 0;
114 
115  const std::string& getName() const {
116  return relName;
117  }
118 
119  arity_type getArity() const {
120  return arity;
121  }
122 
123  arity_type getAuxiliaryArity() const {
124  return auxiliaryArity;
125  }
126 
127  // -- Defines methods and interfaces for Interpreter execution. --
128 public:
130 
131  /**
132  * Return the order of an index.
133  */
134  virtual Order getIndexOrder(size_t) const = 0;
135 
136  /**
137  * Obtains a view on an index of this relation, facilitating hint-supported accesses.
138  *
139  * This function is virtual because view creation require at least one indirect dispatch.
140  */
141  virtual IndexViewPtr createView(const size_t&) const = 0;
142 
143 protected:
144  std::string relName;
145 
148 };
149 
150 /**
151  * A relation, composed of a collection of indexes.
152  */
153 template <size_t _Arity, template <size_t> typename Structure>
154 class Relation : public RelationWrapper {
155 public:
156  static constexpr size_t Arity = _Arity;
157  using Attribute = uint32_t;
158  using AttributeSet = std::set<Attribute>;
161  using View = typename Index::View;
162  using iterator = typename Index::iterator;
163 
164  /**
165  * Construct a typed tuple from a raw data.
166  */
169  std::copy_n(data, Arity, tuple.begin());
170  return tuple;
171  }
172 
173  /**
174  * Cast an abstract view into a view of Index::View type.
175  */
176  static View* castView(ViewWrapper* view) {
177  return static_cast<View*>(view);
178  }
179 
180  /**
181  * Creates a relation, build all necessary indexes.
182  */
183  Relation(size_t auxiliaryArity, std::string name, const ram::analysis::MinIndexSelection& orderSet)
184  : RelationWrapper(Arity, auxiliaryArity, std::move(name)) {
185  for (auto order : orderSet.getAllOrders()) {
186  // Expand the order to a total order
187  ram::analysis::MinIndexSelection::AttributeSet set{order.begin(), order.end()};
188 
189  // This operation is not performance critical.
190  // Not using constexpr Arity to avoid compiler warning. (When Arity == 0)
191  for (size_t i = 0; i < getArity(); ++i) {
192  if (set.find(i) == set.end()) {
193  order.push_back(i);
194  }
195  }
196 
197  indexes.push_back(mk<Index>(order));
198  }
199 
200  // Use the first index as default main index
201  main = indexes[0].get();
202  }
203 
204  Relation(Relation& other) = delete;
205 
206  // -- Implement all virtual interface from Wrapper. --
207  // -- Operations defined in this section are not performance-oriented.
208 public:
209  void purge() override {
210  __purge();
211  }
212 
213  void insert(const RamDomain* data) override {
215  }
216 
217  bool contains(const RamDomain* data) const override {
218  return contains(constructTuple(data));
219  }
220 
221  IndexViewPtr createView(const size_t& indexPos) const override {
222  return mk<View>(indexes[indexPos]->createView());
223  }
224 
225  size_t size() const override {
226  return __size();
227  }
228 
229  Order getIndexOrder(size_t idx) const override {
230  return indexes[idx]->getOrder();
231  }
232 
234  iterator iter;
237 
238  public:
240  : iter(std::move(iter)), order(std::move(order)) {}
241 
242  iterator_base& operator++() override {
243  ++iter;
244  return *this;
245  }
246 
247  const RamDomain* operator*() override {
248  const auto& tuple = *iter;
249  // Not using constexpr Arity to avoid compiler warning. (When Arity == 0)
250  for (size_t i = 0; i < order.size(); ++i) {
251  data[order[i]] = tuple[i];
252  }
253  return data;
254  }
255 
256  iterator_base* clone() const override {
257  return new iterator_base(iter, order);
258  }
259 
260  bool equal(const RelationWrapper::iterator_base& other) const override {
261  if (auto* o = dynamic_cast<const iterator_base*>(&other)) {
262  return iter == o->iter;
263  }
264  return false;
265  }
266  };
267 
268  Iterator begin() const override {
269  return Iterator(new iterator_base(main->begin(), main->getOrder()));
270  }
271 
272  Iterator end() const override {
273  return Iterator(new iterator_base(main->end(), main->getOrder()));
274  }
275 
276  // -----
277  // Following section defines and implement interfaces for interpreter execution.
278  //
279  // These functions are performance efficient but requires compile time knowledge and
280  // are not expected to be used other then the interpreter generator/engine.
281  // -----
282 public:
283  /**
284  * Add the given tuple to this relation.
285  */
286  bool insert(const Tuple& tuple) {
287  if (!(main->insert(tuple))) {
288  return false;
289  }
290  for (size_t i = 1; i < indexes.size(); ++i) {
291  indexes[i]->insert(tuple);
292  }
293  return true;
294  }
295 
296  /**
297  * Add all entries of the given relation to this relation.
298  */
299  void insert(const Relation<Arity, Structure>& other) {
300  for (const auto& tuple : other.scan()) {
301  this->insert(tuple);
302  }
303  }
304 
305  /**
306  * Tests whether this relation contains the given tuple.
307  */
308  bool contains(const Tuple& tuple) const {
309  return main->contains(tuple);
310  }
311 
312  /**
313  * Tests whether this relation contains any element between the given boundaries.
314  */
315  bool contains(const size_t& indexPos, const Tuple& low, const Tuple& high) const {
316  return indexes[indexPos]->contains(low, high);
317  }
318 
319  /**
320  * Obtains a pair of iterators to scan the entire relation.
321  *
322  * Return 'raw iterator' that returns tuples in undecoded form.
323  */
325  return main->scan();
326  }
327 
328  /**
329  * Returns a partitioned list of iterators for parallel computation
330  */
331  std::vector<souffle::range<iterator>> partitionScan(size_t partitionCount) const {
332  return main->partitionScan(partitionCount);
333  }
334 
335  /**
336  * Obtains a pair of iterators covering the interval between the two given entries.
337  */
338  souffle::range<iterator> range(const size_t& indexPos, const Tuple& low, const Tuple& high) const {
339  return indexes[indexPos]->range(low, high);
340  }
341 
342  /**
343  * Returns a partitioned list of iterators coving elements in range [low, high]
344  */
345  std::vector<souffle::range<iterator>> partitionRange(
346  const size_t& indexPos, const Tuple& low, const Tuple& high, size_t partitionCount) const {
347  return indexes[indexPos]->partitionRange(low, high, partitionCount);
348  }
349 
350  /**
351  * Swaps the content of this and the given relation, including the
352  * installed indexes.
353  */
354  void swap(Relation<Arity, Structure>& other) {
355  indexes.swap(other.indexes);
356  }
357 
358  /**
359  * Return number of tuples in relation (full-order)
360  */
361  size_t __size() const {
362  return main->size();
363  }
364 
365  /**
366  * Check if the relation is empty
367  */
368  bool empty() const {
369  return main->empty();
370  }
371 
372  /**
373  * Clear all indexes
374  */
375  void __purge() {
376  for (auto& idx : indexes) {
377  idx->clear();
378  }
379  }
380 
381  /**
382  * Check if a tuple exists in relation
383  */
384  bool exists(const Tuple& tuple) const {
385  return main->contains(tuple);
386  }
387 
388  Index* getIndex(size_t idx) {
389  return indexes[idx];
390  }
391 
392 protected:
393  // Number of height parameters of relation
395 
396  // a map of managed indexes
398 
399  // a pointer to the main index within the managed index
401 };
402 
403 class EqrelRelation : public Relation<2, Eqrel> {
404 public:
406 
407  void extend(const EqrelRelation& rel) {
408  auto src = static_cast<EqrelIndex*>(this->main);
409  auto trg = static_cast<EqrelIndex*>(rel.main);
410  src->extend(trg);
411  }
412 };
413 
414 // The type of relation factory functions.
416  const ram::Relation& id, const ram::analysis::MinIndexSelection& orderSet);
417 
418 // A factory for BTree based relation.
420  const ram::Relation& id, const ram::analysis::MinIndexSelection& orderSet);
421 
422 // A factory for BTree provenance index.
424  const ram::Relation& id, const ram::analysis::MinIndexSelection& orderSet);
425 
426 // A factory for Brie based index.
428  const ram::Relation& id, const ram::analysis::MinIndexSelection& orderSet);
429 
430 // A factory for Eqrel index.
432  const ram::Relation& id, const ram::analysis::MinIndexSelection& orderSet);
433 
434 } // namespace souffle::interpreter
souffle::interpreter::RelationWrapper::contains
virtual bool contains(const RamDomain *) const =0
souffle::interpreter::Relation::begin
Iterator begin() const override
Definition: Relation.h:274
souffle::interpreter::Relation::iterator_base::iter
iterator iter
Definition: Relation.h:240
souffle::interpreter::Relation::iterator_base::order
Order order
Definition: Relation.h:241
souffle::interpreter::Relation::getIndex
Index * getIndex(size_t idx)
Definition: Relation.h:394
souffle::interpreter::RelationWrapper::end
virtual Iterator end() const =0
souffle::interpreter::Relation::iterator_base::equal
bool equal(const RelationWrapper::iterator_base &other) const override
Definition: Relation.h:266
Index.h
souffle::range
A utility class enabling representation of ranges by pairing two iterator instances marking lower and...
Definition: ContainerUtil.h:313
souffle::interpreter::EqrelIndex
For EqrelIndex we do inheritence since EqrelIndex only diff with one extra function.
Definition: Index.h:444
souffle::interpreter::RelationWrapper::Iterator
The iterator interface.
Definition: Relation.h:90
souffle::RamDomain
int32_t RamDomain
Definition: RamTypes.h:56
souffle::interpreter::RelationWrapper::iterator_base::operator++
virtual iterator_base & operator++()=0
souffle::interpreter::Relation::castView
static View * castView(ViewWrapper *view)
Cast an abstract view into a view of Index::View type.
Definition: Relation.h:182
souffle::interpreter::Relation::__purge
void __purge()
Clear all indexes.
Definition: Relation.h:381
souffle::interpreter::Relation::Relation
Relation(size_t auxiliaryArity, std::string name, const ram::analysis::MinIndexSelection &orderSet)
Creates a relation, build all necessary indexes.
Definition: Relation.h:189
souffle::interpreter::Relation::range
souffle::range< iterator > range(const size_t &indexPos, const Tuple &low, const Tuple &high) const
Obtains a pair of iterators covering the interval between the two given entries.
Definition: Relation.h:344
souffle::interpreter::Index::empty
bool empty() const
Tests whether this index is empty or not.
Definition: Index.h:221
souffle::interpreter::createEqrelRelation
Own< RelationWrapper > createEqrelRelation(const ram::Relation &id, const ram::analysis::MinIndexSelection &orderSet)
Definition: EqrelIndex.cpp:29
souffle::interpreter::Relation::iterator_base::operator++
iterator_base & operator++() override
Definition: Relation.h:248
souffle::interpreter::Relation::constructTuple
static Tuple constructTuple(const RamDomain *data)
Construct a typed tuple from a raw data.
Definition: Relation.h:173
souffle::interpreter::createBTreeRelation
Own< RelationWrapper > createBTreeRelation(const ram::Relation &id, const ram::analysis::MinIndexSelection &orderSet)
Definition: BTreeIndex.cpp:35
souffle::interpreter::Relation::swap
void swap(Relation< Arity, Structure > &other)
Swaps the content of this and the given relation, including the installed indexes.
Definition: Relation.h:360
souffle::interpreter::RelationWrapper::Iterator::iter
Own< iterator_base > iter
Definition: Relation.h:91
souffle::interpreter::RelationWrapper::arity
arity_type arity
Definition: Relation.h:158
low
d d low
Definition: htmlJsChartistMin.h:15
high
d high
Definition: htmlJsChartistMin.h:15
souffle::interpreter::Relation::purge
void purge() override
Definition: Relation.h:215
souffle::interpreter::Relation::size
size_t size() const override
Definition: Relation.h:231
souffle::interpreter::Index::contains
bool contains(const Tuple &tuple) const
Tests whether the given tuple is present in this index or not.
Definition: Index.h:251
souffle::interpreter::Relation::scan
souffle::range< iterator > scan() const
Obtains a pair of iterators to scan the entire relation.
Definition: Relation.h:330
souffle::interpreter::EqrelRelation::extend
void extend(const EqrelRelation &rel)
Definition: Relation.h:413
souffle::Own
std::unique_ptr< A > Own
Definition: ContainerUtil.h:42
souffle::interpreter::Relation::partitionRange
std::vector< souffle::range< iterator > > partitionRange(const size_t &indexPos, const Tuple &low, const Tuple &high, size_t partitionCount) const
Returns a partitioned list of iterators coving elements in range [low, high].
Definition: Relation.h:351
souffle::interpreter::Relation::iterator_base
Definition: Relation.h:239
souffle::interpreter::RelationWrapper::Iterator::operator==
bool operator==(const Iterator &other) const
Definition: Relation.h:106
Index.h
souffle::interpreter::RelationWrapper::getName
const std::string & getName() const
Definition: Relation.h:127
souffle::interpreter::Relation::end
Iterator end() const override
Definition: Relation.h:278
souffle::interpreter::EqrelRelation
Definition: Relation.h:409
souffle::interpreter::RelationWrapper::Iterator::Iterator
Iterator(const Iterator &other)
Definition: Relation.h:94
souffle::interpreter::Relation< 2, Eqrel >::iterator
typename Index::iterator iterator
Definition: Relation.h:168
souffle::interpreter::createProvenanceRelation
Own< RelationWrapper > createProvenanceRelation(const ram::Relation &id, const ram::analysis::MinIndexSelection &orderSet)
Definition: ProvenanceIndex.cpp:32
souffle::interpreter::RelationWrapper::iterator_base
A virtualized iterator class that can be used by the Proginterface.
Definition: Relation.h:69
souffle::interpreter::Relation::__size
size_t __size() const
Return number of tuples in relation (full-order)
Definition: Relation.h:367
souffle::interpreter::RelationWrapper::Iterator::operator!=
bool operator!=(const Iterator &other) const
Definition: Relation.h:110
souffle::ram::analysis::MinIndexSelection::AttributeSet
std::unordered_set< AttributeIndex > AttributeSet
Definition: Index.h:211
souffle::interpreter::Relation::iterator_base::operator*
const RamDomain * operator*() override
Definition: Relation.h:253
souffle::interpreter::RelationWrapper::~RelationWrapper
virtual ~RelationWrapper()=default
souffle::interpreter::Order
An order to be enforced for storing tuples within indexes.
Definition: Index.h:48
souffle::interpreter::ViewWrapper
A dummy wrapper for indexViews.
Definition: Index.h:144
souffle::interpreter::RelationWrapper::iterator_base::operator*
virtual const RamDomain * operator*()=0
souffle::interpreter::Index::scan
souffle::range< iterator > scan() const
Returns a pair of iterators covering the entire index content.
Definition: Index.h:265
souffle::interpreter
Definition: BrieIndex.cpp:22
souffle::interpreter::Index
An index is an abstraction of a data structure.
Definition: Index.h:152
souffle::interpreter::Relation::Attribute
uint32_t Attribute
Definition: Relation.h:163
souffle::Relation
Object-oriented wrapper class for Souffle's templatized relations.
Definition: SouffleInterface.h:49
souffle::interpreter::Index::end
iterator end() const
Definition: Index.h:207
souffle::interpreter::Relation::AttributeSet
std::set< Attribute > AttributeSet
Definition: Relation.h:164
souffle::interpreter::Relation::createView
IndexViewPtr createView(const size_t &indexPos) const override
Obtains a view on an index of this relation, facilitating hint-supported accesses.
Definition: Relation.h:227
souffle::interpreter::Relation::getIndexOrder
Order getIndexOrder(size_t idx) const override
Return the order of an index.
Definition: Relation.h:235
i
size_t i
Definition: json11.h:663
souffle::interpreter::Relation::insert
void insert(const RamDomain *data) override
Definition: Relation.h:219
souffle::interpreter::Relation::partitionScan
std::vector< souffle::range< iterator > > partitionScan(size_t partitionCount) const
Returns a partitioned list of iterators for parallel computation.
Definition: Relation.h:337
souffle::interpreter::Relation::View
typename Index::View View
Definition: Relation.h:167
souffle::interpreter::Relation::main
Index * main
Definition: Relation.h:406
souffle::ram::Relation
An abstract class for performing indexed operations.
Definition: Relation.h:40
souffle::interpreter::Relation::iterator_base::iterator_base
iterator_base(typename Index::iterator iter, Order order)
Definition: Relation.h:245
souffle::interpreter::RelationWrapper::iterator_base::equal
virtual bool equal(const iterator_base &other) const =0
souffle::ram::analysis::MinIndexSelection
Definition: Index.h:208
souffle::interpreter::RelationWrapper::begin
virtual Iterator begin() const =0
o
var o
Definition: htmlJsChartistMin.h:15
souffle::interpreter::RelationFactory
Own< RelationWrapper >(*)(const ram::Relation &id, const ram::analysis::MinIndexSelection &orderSet) RelationFactory
Definition: Relation.h:422
iterator_base
souffle::interpreter::Relation::auxiliaryArity
size_t auxiliaryArity
Definition: Relation.h:400
souffle::interpreter::RelationWrapper::iterator_base::clone
virtual iterator_base * clone() const =0
souffle::Tuple
std::array< A, N > Tuple
Definition: RamTypes.h:36
souffle::interpreter::RelationWrapper::getAuxiliaryArity
arity_type getAuxiliaryArity() const
Definition: Relation.h:135
souffle::interpreter::Index::insert
bool insert(const Tuple &tuple)
Inserts a tuple into this index.
Definition: Index.h:235
souffle::interpreter::Index::iterator
typename Data::iterator iterator
Definition: Index.h:157
souffle::interpreter::RelationWrapper::getArity
arity_type getArity() const
Definition: Relation.h:131
souffle::interpreter::EqrelIndex::extend
void extend(EqrelIndex *otherIndex)
Extend another index.
Definition: Index.h:456
souffle::interpreter::Index::size
size_t size() const
Obtains the number of elements stored in this index.
Definition: Index.h:228
souffle::interpreter::Relation::Tuple
souffle::Tuple< RamDomain, Arity > Tuple
Definition: Relation.h:166
souffle::interpreter::RelationWrapper::iterator_base::~iterator_base
virtual ~iterator_base()=default
souffle::interpreter::Order::size
size_t size() const
Definition: Index.h:75
souffle::interpreter::Index::getOrder
Order getOrder() const
Obtains the lex order of this index.
Definition: Index.h:214
souffle::interpreter::RelationWrapper::getIndexOrder
virtual Order getIndexOrder(size_t) const =0
Return the order of an index.
souffle::interpreter::RelationWrapper::createView
virtual IndexViewPtr createView(const size_t &) const =0
Obtains a view on an index of this relation, facilitating hint-supported accesses.
souffle::interpreter::Relation::iterator_base::clone
iterator_base * clone() const override
Definition: Relation.h:262
souffle::interpreter::Relation::iterator_base::data
RamDomain data[Arity]
Definition: Relation.h:242
souffle::interpreter::Index::View
A view on a relation caching local access patterns (not thread safe!).
Definition: Index.h:172
souffle::interpreter::Index::partitionScan
std::vector< souffle::range< iterator > > partitionScan(int partitionCount) const
Retruns a partitioned list of iterators for parallel computation.
Definition: Index.h:279
std
Definition: Brie.h:3053
souffle::interpreter::RelationWrapper::RelationWrapper
RelationWrapper(arity_type arity, arity_type auxiliaryArity, std::string relName)
Definition: Relation.h:58
RamTypes.h
souffle::interpreter::Relation::indexes
VecOwn< Index > indexes
Definition: Relation.h:403
souffle::interpreter::Relation
A relation, composed of a collection of indexes.
Definition: Relation.h:160
souffle::interpreter::createBrieRelation
Own< RelationWrapper > createBrieRelation(const ram::Relation &id, const ram::analysis::MinIndexSelection &)
Definition: BrieIndex.cpp:35
souffle::interpreter::RelationWrapper::IndexViewPtr
Own< ViewWrapper > IndexViewPtr
Definition: Relation.h:141
souffle::interpreter::RelationWrapper::arity_type
souffle::Relation::arity_type arity_type
Definition: Relation.h:55
TCB_SPAN_NAMESPACE_NAME::detail::data
constexpr auto data(C &c) -> decltype(c.data())
Definition: span.h:210
souffle::interpreter::Index::begin
iterator begin() const
Definition: Index.h:203
souffle::ram::analysis::MinIndexSelection::getAllOrders
const OrderCollection getAllOrders() const
@Brief Get all indexes
Definition: Index.h:263
souffle::interpreter::RelationWrapper
Wrapper for InterpreterRelation.
Definition: Relation.h:48
souffle::interpreter::Relation::empty
bool empty() const
Check if the relation is empty.
Definition: Relation.h:374
souffle::Relation::arity_type
uint32_t arity_type
Definition: SouffleInterface.h:51
souffle::interpreter::RelationWrapper::relName
std::string relName
Definition: Relation.h:156
souffle::interpreter::RelationWrapper::Iterator::operator++
Iterator & operator++()
Definition: Relation.h:97
rel
void rel(size_t limit, bool showLimit=true)
Definition: Tui.h:1086
souffle::interpreter::Relation::contains
bool contains(const RamDomain *data) const override
Definition: Relation.h:223
souffle::interpreter::RelationWrapper::auxiliaryArity
arity_type auxiliaryArity
Definition: Relation.h:159
souffle::interpreter::RelationWrapper::size
virtual size_t size() const =0
souffle::tuple
Defines a tuple for the OO interface such that relations with varying columns can be accessed.
Definition: SouffleInterface.h:443
souffle::interpreter::RelationWrapper::Iterator::operator*
const RamDomain * operator*()
Definition: Relation.h:102
souffle::VecOwn
std::vector< Own< A > > VecOwn
Definition: ContainerUtil.h:45
SouffleInterface.h
souffle::interpreter::Relation::Arity
static constexpr size_t Arity
Definition: Relation.h:162
souffle::tuple::begin
decltype(array) ::iterator begin()
Iterator for direct access to tuple's data.
Definition: SouffleInterface.h:677
id
void id(std::string col)
Definition: Tui.h:1124
souffle::interpreter::RelationWrapper::insert
virtual void insert(const RamDomain *)=0
souffle::interpreter::RelationWrapper::purge
virtual void purge()=0
souffle::interpreter::Relation::exists
bool exists(const Tuple &tuple) const
Check if a tuple exists in relation.
Definition: Relation.h:390