souffle  2.0.2-371-g6315b36
Namespaces | Macros
Synthesiser.cpp File Reference
#include "synthesiser/Synthesiser.h"
#include "AggregateOp.h"
#include "FunctorOps.h"
#include "Global.h"
#include "RelationTag.h"
#include "ram/AbstractParallel.h"
#include "ram/Aggregate.h"
#include "ram/AutoIncrement.h"
#include "ram/Break.h"
#include "ram/Call.h"
#include "ram/Choice.h"
#include "ram/Clear.h"
#include "ram/Condition.h"
#include "ram/Conjunction.h"
#include "ram/Constraint.h"
#include "ram/DebugInfo.h"
#include "ram/EmptinessCheck.h"
#include "ram/ExistenceCheck.h"
#include "ram/Exit.h"
#include "ram/Expression.h"
#include "ram/Extend.h"
#include "ram/False.h"
#include "ram/Filter.h"
#include "ram/FloatConstant.h"
#include "ram/IO.h"
#include "ram/IndexAggregate.h"
#include "ram/IndexChoice.h"
#include "ram/IndexScan.h"
#include "ram/IntrinsicOperator.h"
#include "ram/LogRelationTimer.h"
#include "ram/LogSize.h"
#include "ram/LogTimer.h"
#include "ram/Loop.h"
#include "ram/Negation.h"
#include "ram/NestedIntrinsicOperator.h"
#include "ram/NestedOperation.h"
#include "ram/Node.h"
#include "ram/Operation.h"
#include "ram/PackRecord.h"
#include "ram/Parallel.h"
#include "ram/ParallelAggregate.h"
#include "ram/ParallelChoice.h"
#include "ram/ParallelIndexAggregate.h"
#include "ram/ParallelIndexChoice.h"
#include "ram/ParallelIndexScan.h"
#include "ram/ParallelScan.h"
#include "ram/Program.h"
#include "ram/Project.h"
#include "ram/ProvenanceExistenceCheck.h"
#include "ram/Query.h"
#include "ram/Relation.h"
#include "ram/RelationOperation.h"
#include "ram/RelationSize.h"
#include "ram/Scan.h"
#include "ram/Sequence.h"
#include "ram/SignedConstant.h"
#include "ram/Statement.h"
#include "ram/SubroutineArgument.h"
#include "ram/SubroutineReturn.h"
#include "ram/Swap.h"
#include "ram/TranslationUnit.h"
#include "ram/True.h"
#include "ram/TupleElement.h"
#include "ram/TupleOperation.h"
#include "ram/UndefValue.h"
#include "ram/UnpackRecord.h"
#include "ram/UnsignedConstant.h"
#include "ram/UserDefinedOperator.h"
#include "ram/analysis/Index.h"
#include "ram/utility/Utils.h"
#include "ram/utility/Visitor.h"
#include "souffle/BinaryConstraintOps.h"
#include "souffle/RamTypes.h"
#include "souffle/SymbolTable.h"
#include "souffle/TypeAttribute.h"
#include "souffle/utility/ContainerUtil.h"
#include "souffle/utility/FileUtil.h"
#include "souffle/utility/MiscUtil.h"
#include "souffle/utility/StreamUtil.h"
#include "souffle/utility/StringUtil.h"
#include "souffle/utility/json11.h"
#include "souffle/utility/tinyformat.h"
#include "synthesiser/Relation.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <functional>
#include <iomanip>
#include <iterator>
#include <limits>
#include <map>
#include <sstream>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

 souffle
 
 souffle::synthesiser
 Souffle - A Datalog Compiler Copyright (c) 2013, 2015, Oracle and/or its affiliates.
 

Macros

#define BINARY_OP_BITWISE(opcode, op)
 
#define BINARY_OP_EXP(opcode, ty, tyTemp)
 
#define BINARY_OP_EXPR(ty, op)   BINARY_OP_EXPR_EX(ty, op, "")
 
#define BINARY_OP_EXPR_EX(ty, op, rhs_post)
 
#define BINARY_OP_EXPR_LOGICAL(ty, op)   out << "RamDomain"; BINARY_OP_EXPR(ty, op)
 
#define BINARY_OP_EXPR_SHIFT(ty, op)   BINARY_OP_EXPR_EX(ty, op, " & RAM_BIT_SHIFT_MASK")
 
#define BINARY_OP_INTEGRAL(opcode, op)
 
#define BINARY_OP_INTEGRAL_SHIFT(opcode, op, tySigned, tyUnsigned)
 
#define BINARY_OP_LOGICAL(opcode, op)
 
#define BINARY_OP_NUMERIC(opcode, op)
 
#define COMPARE(opCode, op)
 
#define COMPARE_EQ_NE(opCode, op)
 
#define COMPARE_NUMERIC(ty, op)
 
#define COMPARE_STRING(op)
 
#define CONV_FROM_STRING(opcode, ty)
 
#define CONV_TO_STRING(opcode, ty)
 
#define EVAL_CHILD(ty, idx)
 
#define MINMAX_SYMBOL(op)
 
#define NARY_OP(opcode, ty, op)
 
#define NARY_OP_ORDERED(opcode, op)
 
#define PRINT_BEGIN_COMMENT(os)
 
#define PRINT_END_COMMENT(os)
 
#define UNARY_OP(opcode, ty, op)
 
#define UNARY_OP_F(opcode, op)   UNARY_OP(F##opcode, RamFloat , op)
 
#define UNARY_OP_I(opcode, op)   UNARY_OP( opcode, RamSigned , op)
 
#define UNARY_OP_INTEGRAL(opcode, op)
 
#define UNARY_OP_U(opcode, op)   UNARY_OP(U##opcode, RamUnsigned, op)
 

Macro Definition Documentation

◆ BINARY_OP_BITWISE

#define BINARY_OP_BITWISE (   opcode,
  op 
)
Value:
case FunctorOp:: opcode: /* fall through */ \
case FunctorOp::U##opcode: BINARY_OP_EXPR(RamDomain, op)

◆ BINARY_OP_EXP

#define BINARY_OP_EXP (   opcode,
  ty,
  tyTemp 
)
Value:
case FunctorOp::opcode: { \
out << "static_cast<" #ty ">(static_cast<" #tyTemp ">(std::pow(ramBitCast<" #ty ">("; \
visit(args[0], out); \
out << "), ramBitCast<" #ty ">("; \
visit(args[1], out); \
out << "))))"; \
break; \
}

◆ BINARY_OP_EXPR

#define BINARY_OP_EXPR (   ty,
  op 
)    BINARY_OP_EXPR_EX(ty, op, "")

◆ BINARY_OP_EXPR_EX

#define BINARY_OP_EXPR_EX (   ty,
  op,
  rhs_post 
)
Value:
{ \
out << "(ramBitCast<" #ty ">("; \
visit(args[0], out); \
out << ") " #op " ramBitCast<" #ty ">("; \
visit(args[1], out); \
out << rhs_post "))"; \
break; \
}

◆ BINARY_OP_EXPR_LOGICAL

#define BINARY_OP_EXPR_LOGICAL (   ty,
  op 
)    out << "RamDomain"; BINARY_OP_EXPR(ty, op)

◆ BINARY_OP_EXPR_SHIFT

#define BINARY_OP_EXPR_SHIFT (   ty,
  op 
)    BINARY_OP_EXPR_EX(ty, op, " & RAM_BIT_SHIFT_MASK")

◆ BINARY_OP_INTEGRAL

#define BINARY_OP_INTEGRAL (   opcode,
  op 
)
Value:
case FunctorOp:: opcode: BINARY_OP_EXPR(RamSigned , op) \
case FunctorOp::U##opcode: BINARY_OP_EXPR(RamUnsigned, op)

◆ BINARY_OP_INTEGRAL_SHIFT

#define BINARY_OP_INTEGRAL_SHIFT (   opcode,
  op,
  tySigned,
  tyUnsigned 
)
Value:
case FunctorOp:: opcode: BINARY_OP_EXPR_SHIFT(tySigned , op) \
case FunctorOp::U##opcode: BINARY_OP_EXPR_SHIFT(tyUnsigned, op)

◆ BINARY_OP_LOGICAL

#define BINARY_OP_LOGICAL (   opcode,
  op 
)
Value:
case FunctorOp:: opcode: BINARY_OP_EXPR_LOGICAL(RamSigned , op) \
case FunctorOp::U##opcode: BINARY_OP_EXPR_LOGICAL(RamUnsigned, op)

◆ BINARY_OP_NUMERIC

#define BINARY_OP_NUMERIC (   opcode,
  op 
)
Value:
BINARY_OP_INTEGRAL(opcode, op) \
case FunctorOp::F##opcode: BINARY_OP_EXPR(RamFloat , op)

◆ COMPARE

#define COMPARE (   opCode,
  op 
)
Value:
case BinaryConstraintOp:: opCode: COMPARE_NUMERIC(RamSigned , op); \
case BinaryConstraintOp::U##opCode: COMPARE_NUMERIC(RamUnsigned, op); \
case BinaryConstraintOp::F##opCode: COMPARE_NUMERIC(RamFloat , op); \

◆ COMPARE_EQ_NE

#define COMPARE_EQ_NE (   opCode,
  op 
)
Value:
case BinaryConstraintOp:: opCode: COMPARE_NUMERIC(RamDomain , op); \
case BinaryConstraintOp::F##opCode: COMPARE_NUMERIC(RamFloat , op);

◆ COMPARE_NUMERIC

#define COMPARE_NUMERIC (   ty,
  op 
)
Value:
out << "("; \
EVAL_CHILD(ty, getLHS); \
out << " " #op " "; \
EVAL_CHILD(ty, getRHS); \
out << ")"; \
break

◆ COMPARE_STRING

#define COMPARE_STRING (   op)
Value:
out << "(symTable.resolve("; \
EVAL_CHILD(RamDomain, getLHS); \
out << ") " #op " symTable.resolve("; \
EVAL_CHILD(RamDomain, getRHS); \
out << "))"; \
break

◆ CONV_FROM_STRING

#define CONV_FROM_STRING (   opcode,
  ty 
)
Value:
case FunctorOp::opcode: { \
out << "souffle::evaluator::symbol2numeric<" #ty ">(symTable.resolve("; \
visit(args[0], out); \
out << "))"; \
} break;

◆ CONV_TO_STRING

#define CONV_TO_STRING (   opcode,
  ty 
)
Value:
case FunctorOp::opcode: { \
out << "symTable.lookup(std::to_string("; \
visit(args[0], out); \
out << "))"; \
} break;

◆ EVAL_CHILD

#define EVAL_CHILD (   ty,
  idx 
)
Value:
out << "ramBitCast<" #ty ">("; \
visit(rel.idx(), out); \
out << ")"

◆ MINMAX_SYMBOL

#define MINMAX_SYMBOL (   op)
Value:
{ \
out << "symTable.lookup(" #op "({"; \
for (auto& cur : args) { \
out << "symTable.resolve("; \
visit(cur, out); \
out << "), "; \
} \
out << "}))"; \
break; \
}

◆ NARY_OP

#define NARY_OP (   opcode,
  ty,
  op 
)
Value:
case FunctorOp::opcode: { \
out << #op "({"; \
for (auto& cur : args) { \
out << "ramBitCast<" #ty ">("; \
visit(cur, out); \
out << "), "; \
} \
out << "})"; \
break; \
}

◆ NARY_OP_ORDERED

#define NARY_OP_ORDERED (   opcode,
  op 
)
Value:
NARY_OP( opcode, RamSigned , op) \
NARY_OP(U##opcode, RamUnsigned, op) \
NARY_OP(F##opcode, RamFloat , op)

◆ PRINT_BEGIN_COMMENT

#define PRINT_BEGIN_COMMENT (   os)
Value:
if (Global::config().has("debug-report") || Global::config().has("verbose")) \
os << "/* BEGIN " << __FUNCTION__ << " @" << __FILE__ << ":" << __LINE__ << " */\n"

◆ PRINT_END_COMMENT

#define PRINT_END_COMMENT (   os)
Value:
if (Global::config().has("debug-report") || Global::config().has("verbose")) \
os << "/* END " << __FUNCTION__ << " @" << __FILE__ << ":" << __LINE__ << " */\n"

◆ UNARY_OP

#define UNARY_OP (   opcode,
  ty,
  op 
)
Value:
case FunctorOp::opcode: { \
out << "(" #op "(ramBitCast<" #ty ">("; \
visit(args[0], out); \
out << ")))"; \
break; \
}

◆ UNARY_OP_F

#define UNARY_OP_F (   opcode,
  op 
)    UNARY_OP(F##opcode, RamFloat , op)

◆ UNARY_OP_I

#define UNARY_OP_I (   opcode,
  op 
)    UNARY_OP( opcode, RamSigned , op)

◆ UNARY_OP_INTEGRAL

#define UNARY_OP_INTEGRAL (   opcode,
  op 
)
Value:
UNARY_OP_I(opcode, op) \
UNARY_OP_U(opcode, op)

◆ UNARY_OP_U

#define UNARY_OP_U (   opcode,
  op 
)    UNARY_OP(U##opcode, RamUnsigned, op)
COMPARE_NUMERIC
#define COMPARE_NUMERIC(ty, op)
souffle::RamUnsigned
uint32_t RamUnsigned
Definition: RamTypes.h:58
BINARY_OP_EXPR_SHIFT
#define BINARY_OP_EXPR_SHIFT(ty, op)
souffle::RamDomain
int32_t RamDomain
Definition: RamTypes.h:56
S
#define S(x)
Definition: test.h:179
souffle::RamFloat
float RamFloat
Definition: RamTypes.h:60
COMPARE_STRING
#define COMPARE_STRING(op)
BINARY_OP_INTEGRAL
#define BINARY_OP_INTEGRAL(opcode, op)
NARY_OP
#define NARY_OP(opcode, ty, op)
BINARY_OP_EXPR_LOGICAL
#define BINARY_OP_EXPR_LOGICAL(ty, op)
UNARY_OP_I
#define UNARY_OP_I(opcode, op)
souffle::RamSigned
RamDomain RamSigned
Definition: RamTypes.h:57
rel
void rel(size_t limit, bool showLimit=true)
Definition: Tui.h:1086
BINARY_OP_EXPR
#define BINARY_OP_EXPR(ty, op)