1 #ifndef AFFINE_INEQUALITY_H
2 #define AFFINE_INEQUALITY_H
4 #include "genericDataflowCommon.h"
5 #include "VirtualCFGIterator.h"
7 #include "CallGraphTraverse.h"
9 #include "divAnalysis.h"
10 #include "printAnalysisStates.h"
11 #include "LogicalCond.h"
60 static const short top=3;
62 static const short constrKnown=2;
67 static const short bottom=0;
79 affineInequality(
int a,
int b,
int c,
bool xZero,
bool yZero, signs xSign, signs ySign);
99 bool semLessThan(
const affineInequality& that,
bool xEqZero,
bool yEqZero)
const;
113 bool semLessThanNeg(
const affineInequality& that,
bool xEqZero,
bool yEqZero)
const;
117 bool set(
int a,
int b,
int c);
118 bool set(
int a,
int b,
int c,
bool xZero,
bool yZero, signs xSign, signs ySign);
143 short getLevel()
const;
145 bool isXZero()
const;
146 bool isYZero()
const;
148 signs getXSign()
const;
149 signs getYSign()
const;
187 static std::string signToString(signs sign);
189 std::string str(std::string indent=
"");
190 std::string str(std::string indent=
"")
const;
192 std::string str(
varID x,
varID y, std::string indent=
"")
const;
194 std::string strNeg(
varID x,
varID y, std::string indent)
const;
226 const varID& getX()
const;
228 const varID& getY()
const;
240 const bool setX(
const varID& x);
242 const bool setY(
const varID& y);
244 const bool setA(
int a);
246 const bool setB(
int b);
248 const bool setC(
int c);
257 std::string str(std::string indent=
"");
259 std::string str(std::string indent=
"")
const;
283 std::set<varAffineInequality> ineqs;
290 this->ineqs = that.ineqs;
295 std::string str(std::string indent=
"");
296 std::string str(std::string indent=
"")
const;
339 void runAffineIneqPlacer(
bool printStates=
false);
342 const std::set<varAffineInequality>& getAffineIneq(
const DataflowNode& n);
345 std::list<std::set<varAffineInequality> > getAffineIneqDesc(
const DataflowNode& n);
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes, since similar to statement, expressions have a concrete location within the user's source code.