souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
119 switch (constraintOp) {
128 switch (constraintOp) {
141 switch (constraintOp) {
155 switch (constraintOp) {
169 switch (constraintOp) {
182 switch (constraintOp) {
192 switch (constraintOp) {
202 switch (constraintOp) {
212 switch (constraintOp) {
226 switch (constraintOp) {
245 fatal(
"invalid binary constraint overload: op = %s; type = %s", constraintOp, toType);
249 #define COMPARE_CONSTRAINT_FLOAT_OR_RAW(op) \
250 case BinaryConstraintOp::op: \
252 default : return BinaryConstraintOp:: op; \
253 case TypeAttribute::Float : return BinaryConstraintOp::F##op; \
255 #define COMPARE_CONSTRAINT(op) \
256 case BinaryConstraintOp::op: \
258 case TypeAttribute::Signed : return BinaryConstraintOp:: op; \
259 case TypeAttribute::Unsigned: return BinaryConstraintOp::U##op; \
260 case TypeAttribute::Float : return BinaryConstraintOp::F##op; \
261 case TypeAttribute::Symbol : return BinaryConstraintOp::S##op; \
262 case TypeAttribute::ADT : \
263 case TypeAttribute::Record : return FAIL(); \
268 switch (constraintOp) {
277 default:
fatal(
"invalid constraint conversion: constraint = %s", constraintOp);
282 #undef COMPARE_CONSTRAINT_FLOAT_OR_RAW
283 #undef COMPARE_CONSTRAINT
377 fatal(
"unrecognised binary operator: symbol = `%s`", symbol);
426 default:
return true;
435 #define COMPARE_EQUALS(op) \
436 case BinaryConstraintOp::F##op: return { TypeAttribute::Float }; \
437 case BinaryConstraintOp:: op: \
438 return { TypeAttribute::Signed, TypeAttribute::Unsigned, TypeAttribute::Float, \
439 TypeAttribute::Symbol, TypeAttribute::Record, TypeAttribute::ADT};
440 #define COMPARE_OP(op) \
441 case BinaryConstraintOp:: op: return { TypeAttribute::Signed }; \
442 case BinaryConstraintOp::U##op: return { TypeAttribute::Unsigned }; \
443 case BinaryConstraintOp::F##op: return { TypeAttribute::Float }; \
444 case BinaryConstraintOp::S##op: return { TypeAttribute::Symbol };
463 #undef COMPARE_EQUALS
#define UNREACHABLE_BAD_CASE_ANALYSIS
bool isGreaterEqual(const BinaryConstraintOp constraintOp)
bool isGreaterThan(const BinaryConstraintOp constraintOp)
BinaryConstraintOp getLessThanConstraint(const std::string &type)
BinaryConstraintOp getGreaterEqualConstraint(const std::string &type)
char const * toBinaryConstraintSymbol(const BinaryConstraintOp op)
Converts operator to its symbolic representation.
bool isWeakIneqConstraint(const BinaryConstraintOp constraintOp)
BinaryConstraintOp getLessEqualConstraint(const std::string &type)
bool isOverloaded(const BinaryConstraintOp constraintOp)
Utility function, informing whether constraint is overloaded.
BinaryConstraintOp negatedConstraintOp(const BinaryConstraintOp op)
Negated Constraint Operator Each operator requires a negated operator which is necessary for the expa...
BinaryConstraintOp convertStrictToNotEqualConstraint(const BinaryConstraintOp constraintOp)
bool isLessEqual(const BinaryConstraintOp constraintOp)
BinaryConstraintOp convertOverloadedConstraint(const BinaryConstraintOp constraintOp, const TypeAttribute toType)
Convert Constraint to work with requested type.
BinaryConstraintOp toBinaryConstraintOp(const std::string &symbol)
Converts symbolic representation of an operator to the operator.
BinaryConstraintOp
Binary Constraint Operators.
std::vector< TypeAttribute > getBinaryConstraintTypes(const BinaryConstraintOp op)
Get type binary constraint operates on.
bool isEqConstraint(const BinaryConstraintOp constraintOp)
std::ostream & operator<<(std::ostream &os, AggregateOp op)
bool isStrictIneqConstraint(const BinaryConstraintOp constraintOp)
void fatal(const char *format, const Args &... args)
BinaryConstraintOp getEqConstraint(const std::string &type)
#define COMPARE_EQUALS(op)
bool isInfixFunctorOp(std::string_view symbol)
Determines whether a functor should be written using infix notation (e.g.
#define COMPARE_CONSTRAINT_FLOAT_OR_RAW(op)
BinaryConstraintOp getGreaterThanConstraint(const std::string &type)
bool isLessThan(const BinaryConstraintOp constraintOp)
bool isOrderedBinaryConstraintOp(const BinaryConstraintOp op)
Determines whether arguments of constraint are orderable.
#define COMPARE_CONSTRAINT(op)
BinaryConstraintOp convertStrictToWeakIneqConstraint(const BinaryConstraintOp constraintOp)