Solver Utilize CFLData.
More...
#include <CFLSolver.h>
|
| virtual void | clear () |
| const_iterator | begin () const |
| const_iterator | end () const |
| iterator | begin () |
| iterator | end () |
| DataMap & | getSuccMap () |
| DataMap & | getPredMap () |
| TypeMap & | getSuccMap (const NodeID key) |
| TypeMap & | getPredMap (const NodeID key) |
| NodeBS & | getSuccs (const NodeID key, const Label ty) |
| NodeBS & | getPreds (const NodeID key, const Label ty) |
| bool | addEdge (const NodeID src, const NodeID dst, 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
|
| NodeBS | addEdges (const NodeBS &srcData, const NodeID dst, const Label ty) |
| | add edges and return the set of added edges (src) for dst
|
| bool | hasEdge (const NodeID src, const NodeID dst, const Label ty) |
| | find src -> find src[ty] -> find dst in set
|
| void | clearEdges (const NodeID key) |
| | POCRSolver (CFLGraph *_graph, CFGrammar *_grammar) |
| virtual | ~POCRSolver () |
| | Destructor.
|
| virtual void | processCFLEdge (const CFLEdge *Y_edge) |
| | Process CFLEdge.
|
| virtual void | buildCFLData () |
| | Init CFLData.
|
| virtual void | initialize () |
| | Initialize worklist.
|
| | CFLSolver (CFLGraph *_graph, CFGrammar *_grammar) |
| virtual | ~CFLSolver () |
| virtual void | solve () |
| | Start solving.
|
| const CFLGraph * | getGraph () const |
| | Return CFL Graph.
|
| const CFGrammar * | getGrammar () const |
| | Return CFL Grammar.
|
| virtual bool | pushIntoWorklist (const CFLEdge *item) |
| virtual bool | isWorklistEmpty () |
Solver Utilize CFLData.
Definition at line 117 of file CFLSolver.h.
◆ const_iterator
◆ DataMap
◆ iterator
◆ TypeMap
◆ POCRSolver()
Definition at line 270 of file CFLSolver.h.
271 {
273 }
CFLSolver(CFLGraph *_graph, CFGrammar *_grammar)
virtual void buildCFLData()
Init CFLData.
◆ ~POCRSolver()
| virtual SVF::POCRSolver::~POCRSolver |
( |
| ) |
|
|
inlinevirtual |
◆ addEdge()
Definition at line 216 of file CFLSolver.h.
217 {
220 }
bool addPred(const NodeID key, const NodeID src, const Label ty)
bool addSucc(const NodeID key, const NodeID dst, const Label ty)
◆ addEdges() [1/2]
add edges and return the set of added edges (src) for dst
Definition at line 236 of file CFLSolver.h.
237 {
240 {
241 for (
const NodeID datum: srcData)
243 newSrcs.set(datum);
244 }
245 return newSrcs;
246 }
bool addPreds(const NodeID key, const NodeBS &data, const Label ty)
◆ addEdges() [2/2]
add edges and return the set of added edges (dst) for src
Definition at line 223 of file CFLSolver.h.
224 {
227 {
228 for (
const NodeID datum: dstData)
230 newDsts.set(datum);
231 }
232 return newDsts;
233 }
bool addSuccs(const NodeID key, const NodeBS &data, const Label ty)
◆ addPred()
◆ addPreds()
| bool SVF::POCRSolver::addPreds |
( |
const NodeID | key, |
|
|
const NodeBS & | data, |
|
|
const Label | ty ) |
|
inlineprotected |
Definition at line 142 of file CFLSolver.h.
143 {
144 if (data.empty())
145 return false;
146 return predMap[key][ty] |= data;
147 }
◆ addSucc()
◆ addSuccs()
| bool SVF::POCRSolver::addSuccs |
( |
const NodeID | key, |
|
|
const NodeBS & | data, |
|
|
const Label | ty ) |
|
inlineprotected |
Definition at line 149 of file CFLSolver.h.
150 {
151 if (data.empty())
152 return false;
153 return succMap[key][ty] |= data;
154 }
◆ begin() [1/2]
◆ begin() [2/2]
◆ buildCFLData()
| void POCRSolver::buildCFLData |
( |
| ) |
|
|
virtual |
Init CFLData.
Definition at line 132 of file CFLSolver.cpp.
133{
134 for (CFLEdge* edge:
graph->getCFLEdges())
135 addEdge(edge->getSrcID(), edge->getDstID(), edge->getEdgeKind());
136}
bool addEdge(const NodeID src, const NodeID dst, const Label ty)
◆ clear()
| virtual void SVF::POCRSolver::clear |
( |
| ) |
|
|
inlinevirtual |
◆ clearEdges()
| void SVF::POCRSolver::clearEdges |
( |
const NodeID | key | ) |
|
|
inline |
◆ end() [1/2]
◆ end() [2/2]
◆ getPredMap() [1/2]
| DataMap & SVF::POCRSolver::getPredMap |
( |
| ) |
|
|
inline |
◆ getPredMap() [2/2]
◆ getPreds()
◆ getSuccMap() [1/2]
| DataMap & SVF::POCRSolver::getSuccMap |
( |
| ) |
|
|
inline |
◆ getSuccMap() [2/2]
◆ getSuccs()
◆ hasEdge()
find src -> find src[ty] -> find dst in set
Definition at line 249 of file CFLSolver.h.
250 {
253 return false;
254
255 auto iter2 = iter1->second.find(ty);
256 if (iter2 == iter1->second.end())
257 return false;
258
259 return iter2->second.test(dst);
260 }
DataMap::const_iterator const_iterator
◆ initialize()
| void POCRSolver::initialize |
( |
| ) |
|
|
virtual |
Initialize worklist.
Foreach production X -> epsilon add X(i,i) if not exist to E and to worklist
Reimplemented from SVF::CFLSolver.
Reimplemented in SVF::POCRHybridSolver.
Definition at line 192 of file CFLSolver.cpp.
193{
194 for(
auto edge :
graph->getCFLEdges())
195 {
197 }
198
202 {
204 {
206 if (
addEdge(IDMap.first, IDMap.first, X))
207 {
208 CFLNode* i =
graph->getGNode(IDMap.first);
209 const CFLEdge* newEdge =
graph->addCFLEdge(i, i, X);
211 }
212 }
213 }
214}
CFGrammar::Production Production
virtual bool pushIntoWorklist(const CFLEdge *item)
◆ processCFLEdge()
| void POCRSolver::processCFLEdge |
( |
const CFLEdge * | Y_edge | ) |
|
|
virtual |
Process CFLEdge.
For each production X -> Y add X(i,j) if not exist to E and to worklist
For each production X -> Y Z Foreach outgoing edge Z(j,k) from node j do add X(i,k) if not exist to E and to worklist
For each production X -> Z Y Foreach incoming edge Z(k,i) to node i do add X(k,j) if not exist to E and to worklist
Reimplemented from SVF::CFLSolver.
Reimplemented in SVF::POCRHybridSolver.
Definition at line 138 of file CFLSolver.cpp.
139{
142
146 if (
grammar->hasProdsFromSingleRHS(Y))
148 {
152 {
155 }
156
157 }
158
162 if (
grammar->hasProdsFromFirstRHS(Y))
164 {
168 for (
NodeID diffDst: diffDsts)
169 {
170 const CFLEdge* newEdge =
graph->addCFLEdge(i,
graph->getGNode(diffDst), X);
172 }
173 }
174
178 if(
grammar->hasProdsFromSecondRHS(Y))
180 {
184 for (
NodeID diffSrc: diffSrcs)
185 {
186 const CFLEdge* newEdge =
graph->addCFLEdge(
graph->getGNode(diffSrc), j, X);
188 }
189 }
190}
GEdgeKind getEdgeKind() const
static double numOfChecks
NodeType * getSrcNode() const
NodeType * getDstNode() const
NodeBS addEdges(const NodeID src, const NodeBS &dstData, const Label ty)
add edges and return the set of added edges (dst) for src
NodeID getId() const
Get ID.
◆ diff
◆ emptyData
| const NodeBS SVF::POCRSolver::emptyData |
|
protected |
◆ predMap
◆ succMap
The documentation for this class was generated from the following files: