souffle  2.0.2-371-g6315b36
Namespaces | Macros | Enumerations | Functions
BinaryConstraintOps.h File Reference
#include "souffle/TypeAttribute.h"
#include "souffle/utility/MiscUtil.h"
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for BinaryConstraintOps.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 souffle
 

Macros

#define COMPARE_CONSTRAINT(op)
 
#define COMPARE_CONSTRAINT_FLOAT_OR_RAW(op)
 
#define COMPARE_EQUALS(op)
 
#define COMPARE_OP(op)
 

Enumerations

enum  souffle::BinaryConstraintOp {
  souffle::BinaryConstraintOp::EQ, souffle::BinaryConstraintOp::FEQ, souffle::BinaryConstraintOp::NE, souffle::BinaryConstraintOp::FNE,
  souffle::BinaryConstraintOp::LT, souffle::BinaryConstraintOp::ULT, souffle::BinaryConstraintOp::FLT, souffle::BinaryConstraintOp::SLT,
  souffle::BinaryConstraintOp::LE, souffle::BinaryConstraintOp::ULE, souffle::BinaryConstraintOp::FLE, souffle::BinaryConstraintOp::SLE,
  souffle::BinaryConstraintOp::GT, souffle::BinaryConstraintOp::UGT, souffle::BinaryConstraintOp::FGT, souffle::BinaryConstraintOp::SGT,
  souffle::BinaryConstraintOp::GE, souffle::BinaryConstraintOp::UGE, souffle::BinaryConstraintOp::FGE, souffle::BinaryConstraintOp::SGE,
  souffle::BinaryConstraintOp::MATCH, souffle::BinaryConstraintOp::CONTAINS, souffle::BinaryConstraintOp::NOT_MATCH, souffle::BinaryConstraintOp::NOT_CONTAINS
}
 Binary Constraint Operators. More...
 

Functions

BinaryConstraintOp souffle::convertOverloadedConstraint (const BinaryConstraintOp constraintOp, const TypeAttribute toType)
 Convert Constraint to work with requested type. More...
 
BinaryConstraintOp souffle::convertStrictToNotEqualConstraint (const BinaryConstraintOp constraintOp)
 
BinaryConstraintOp souffle::convertStrictToWeakIneqConstraint (const BinaryConstraintOp constraintOp)
 
std::vector< TypeAttributesouffle::getBinaryConstraintTypes (const BinaryConstraintOp op)
 Get type binary constraint operates on. More...
 
BinaryConstraintOp souffle::getEqConstraint (const std::string &type)
 
BinaryConstraintOp souffle::getGreaterEqualConstraint (const std::string &type)
 
BinaryConstraintOp souffle::getGreaterThanConstraint (const std::string &type)
 
BinaryConstraintOp souffle::getLessEqualConstraint (const std::string &type)
 
BinaryConstraintOp souffle::getLessThanConstraint (const std::string &type)
 
bool souffle::isEqConstraint (const BinaryConstraintOp constraintOp)
 
bool souffle::isGreaterEqual (const BinaryConstraintOp constraintOp)
 
bool souffle::isGreaterThan (const BinaryConstraintOp constraintOp)
 
bool souffle::isInfixFunctorOp (const BinaryConstraintOp op)
 Determines whether a functor should be written using infix notation (e.g. More...
 
bool souffle::isLessEqual (const BinaryConstraintOp constraintOp)
 
bool souffle::isLessThan (const BinaryConstraintOp constraintOp)
 
bool souffle::isOrderedBinaryConstraintOp (const BinaryConstraintOp op)
 Determines whether arguments of constraint are orderable. More...
 
bool souffle::isOverloaded (const BinaryConstraintOp constraintOp)
 Utility function, informing whether constraint is overloaded. More...
 
bool souffle::isStrictIneqConstraint (const BinaryConstraintOp constraintOp)
 
bool souffle::isWeakIneqConstraint (const BinaryConstraintOp constraintOp)
 
BinaryConstraintOp souffle::negatedConstraintOp (const BinaryConstraintOp op)
 Negated Constraint Operator Each operator requires a negated operator which is necessary for the expansion of complex rule bodies with disjunction and negation. More...
 
std::ostream & souffle::operator<< (std::ostream &os, BinaryConstraintOp x)
 
BinaryConstraintOp souffle::toBinaryConstraintOp (const std::string &symbol)
 Converts symbolic representation of an operator to the operator. More...
 
char const * souffle::toBinaryConstraintSymbol (const BinaryConstraintOp op)
 Converts operator to its symbolic representation. More...
 

Macro Definition Documentation

◆ COMPARE_CONSTRAINT

#define COMPARE_CONSTRAINT (   op)
Value:
case BinaryConstraintOp::op: \
switch (toType) { \
case TypeAttribute::Signed : return BinaryConstraintOp:: op; \
case TypeAttribute::Unsigned: return BinaryConstraintOp::U##op; \
case TypeAttribute::Float : return BinaryConstraintOp::F##op; \
case TypeAttribute::Symbol : return BinaryConstraintOp::S##op; \
case TypeAttribute::ADT : \
case TypeAttribute::Record : return FAIL(); \
} \
break; /* HACK: GCC-9 is incorrectly reporting a case fallthru */

◆ COMPARE_CONSTRAINT_FLOAT_OR_RAW

#define COMPARE_CONSTRAINT_FLOAT_OR_RAW (   op)
Value:
case BinaryConstraintOp::op: \
switch (toType) { \
default : return BinaryConstraintOp:: op; \
case TypeAttribute::Float : return BinaryConstraintOp::F##op; \
}

◆ COMPARE_EQUALS

#define COMPARE_EQUALS (   op)
Value:
case BinaryConstraintOp::F##op: return { TypeAttribute::Float }; \
case BinaryConstraintOp:: op: \
return { TypeAttribute::Signed, TypeAttribute::Unsigned, TypeAttribute::Float, \
TypeAttribute::Symbol, TypeAttribute::Record, TypeAttribute::ADT};

◆ COMPARE_OP

#define COMPARE_OP (   op)
Value:
case BinaryConstraintOp:: op: return { TypeAttribute::Signed }; \
case BinaryConstraintOp::U##op: return { TypeAttribute::Unsigned }; \
case BinaryConstraintOp::F##op: return { TypeAttribute::Float }; \
case BinaryConstraintOp::S##op: return { TypeAttribute::Symbol };
S
#define S(x)
Definition: test.h:179