30#ifndef INCLUDE_CFL_CFLSolver_H_
31#define INCLUDE_CFL_CFLSolver_H_
119 typedef std::map<const Label, NodeBS>
TypeMap;
120 typedef std::unordered_map<NodeID, TypeMap>
DataMap;
258 return iter2->second.test(dst);
339 u->children.insert(
v);
bool isInWorklist(const CFLEdge *item)
FIFOWorkList< const CFLEdge * > WorkList
Define worklist.
WorkList worklist
Worklist for resolution.
virtual void solve()
Start solving.
const CFLGraph * getGraph() const
Return CFL Graph.
static double numOfChecks
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
virtual void initialize()
Initialize worklist.
CFGrammar::Production Production
const CFGrammar * getGrammar() const
Return CFL Grammar.
virtual bool pushIntoWorklist(const CFLEdge *item)
virtual bool isWorklistEmpty()
const CFLEdge * popFromWorklist()
Worklist operations.
CFLSolver(CFLGraph *_graph, CFGrammar *_grammar)
bool push(const Data &data)
bool find(const Data &data) const
std::vector< Symbol > Production
Solver Utilize Hybrid Representation of Graph.
TreeNode * getNode_h(NodeID src, NodeID dst)
Get the node dst in tree(src)
void insertEdge_h(TreeNode *u, TreeNode *v)
add v into desc(x) as a child of u
virtual void initialize()
Initialize worklist.
POCRHybridSolver(CFLGraph *_graph, CFGrammar *_grammar)
void meld(NodeID x, TreeNode *uNode, TreeNode *vNode)
void meld_h(NodeID x, TreeNode *uNode, TreeNode *vNode)
bool hasInd_h(NodeID src, NodeID dst)
void addArc_h(NodeID src, NodeID dst)
void addArc(NodeID src, NodeID dst)
TreeNode * addInd_h(NodeID src, NodeID dst)
Add a node dst to tree(src)
Map< NodeID, std::unordered_map< NodeID, TreeNode * > > indMap
virtual ~POCRHybridSolver()
Destructor.
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
DataMap::const_iterator const_iterator
void clearEdges(const NodeID key)
TypeMap & getPredMap(const NodeID key)
bool addPred(const NodeID key, const NodeID src, const Label ty)
bool hasEdge(const NodeID src, const NodeID dst, const Label ty)
find src -> find src[ty] -> find dst in set
virtual ~POCRSolver()
Destructor.
DataMap::iterator iterator
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
TypeMap & getSuccMap(const NodeID key)
NodeBS & getSuccs(const NodeID key, const Label ty)
NodeBS addEdges(const NodeID src, const NodeBS &dstData, const Label ty)
add edges and return the set of added edges (dst) for src
const_iterator begin() const
bool addSucc(const NodeID key, const NodeID dst, const Label ty)
NodeBS addEdges(const NodeBS &srcData, const NodeID dst, const Label ty)
add edges and return the set of added edges (src) for dst
std::map< const Label, NodeBS > TypeMap
POCRSolver(CFLGraph *_graph, CFGrammar *_grammar)
NodeBS & getPreds(const NodeID key, const Label ty)
bool addEdge(const NodeID src, const NodeID dst, const Label ty)
std::unordered_map< NodeID, TypeMap > DataMap
bool addPreds(const NodeID key, const NodeBS &data, const Label ty)
const_iterator end() const
bool addSuccs(const NodeID key, const NodeBS &data, const Label ty)
virtual void initialize()
Initialize worklist.
virtual void buildCFLData()
Init CFLData.
GrammarBase::Symbol Label
llvm::IRBuilder IRBuilder
bool operator==(const TreeNode &rhs) const
bool operator<(const TreeNode &rhs) const
std::unordered_set< TreeNode * > children