00001 #ifndef wali_nwa_query_TRANSITIONS_HPP 00002 #define wali_nwa_query_TRANSITIONS_HPP 00003 00004 #include "opennwa/NwaFwd.hpp" 00005 00006 namespace opennwa 00007 { 00008 namespace query 00009 { 00010 00011 //Transition Accessors 00012 00013 /** 00014 * 00015 * @brief finds a symbol which occurs in a transition with the given endpoints 00016 * 00017 * This method checks for a transition (of any kind) with the given endpoints. If 00018 * such a transition exists true is returned and the symbol labeling that edge is 00019 * placed in the reference parameter 'sym'. 00020 * 00021 * @param - from: the source of the desired transition 00022 * @param - to: the target of the desired transition 00023 * @param - sym: the location in which to place any symbol labeling such a transition 00024 * @return true if some such transition is found, false otherwise 00025 * 00026 */ 00027 extern bool getSymbol(Nwa const &, State from, State to, Symbol & sym ); 00028 00029 /** 00030 * 00031 * @brief tests whether there exists a transition whose source is 'from', 00032 * whose symbol is 'sym', and whose target is 'to' 00033 * 00034 * This method determines whether there exists a transition (internal, call, or 00035 * return) whose source is 'from', whose symbol is 'sym', and whose target is 'to'. 00036 * 00037 * @param - from: the source of the transition 00038 * @param - sym: the symbol that labels the transition 00039 * @param - to: the target of the transition 00040 * @return true if such a transition exists, false otherwise 00041 * 00042 */ 00043 extern bool findTrans(Nwa const &, State from, Symbol sym, State to ); 00044 00045 /** 00046 * 00047 * @brief obtains all the symbols that label transitions from 'source' to 'target' 00048 * 00049 * This method returns all the symbols that label transitions from 00050 * 'source' to 'target' 00051 * 00052 * @param - source: the source of the desired transitions 00053 * @param - target: the target of the desired transitions 00054 * @return the set of symbols that label transitions from 'source' to 'target' 00055 * 00056 */ 00057 extern const SymbolSet getSymbols(Nwa const &, State source, State target ); 00058 00059 /** 00060 * 00061 * @brief obtains all the symbols that label transitions from 'source' 00062 * 00063 * This method returns all the symbols that label transitions from 'source' 00064 * 00065 * @param - source: the source of the desired transitions 00066 * @return the set of symbols that label transitions from 'source' 00067 * 00068 */ 00069 extern const SymbolSet getSymbolsFrom(Nwa const &, State source ); 00070 00071 /** 00072 * 00073 * @brief obtains all the symbols that label transitions to 'target' 00074 * 00075 * This method returns all the symbols that label transitions to 'target' 00076 * 00077 * @param - target: the target of the desired transitions 00078 * @return the set of symbols that label transitions to 'target' 00079 * 00080 */ 00081 extern const SymbolSet getSymbolsTo(Nwa const &, State target ); 00082 00083 /** 00084 * 00085 * @brief obtains all the states that are predecessors of the given state 00086 * 00087 * This method returns all the states that are predecessors of the given 00088 * state. 00089 * 00090 * @param - state: the state whose predecessors to look up 00091 * @param - preds: the set of all states that are predecessors of the given state 00092 * 00093 */ 00094 extern void getPredecessors(Nwa const &, State state, StateSet & preds ); 00095 /** 00096 * 00097 * @brief obtains all the states that are predecessors of the given state 00098 * 00099 * This method returns all the states that are predecessors of the given state. 00100 * 00101 * @param - state: the state whose predecessors to look up 00102 * @return the set of all states that are predecessors of the given state 00103 * 00104 */ 00105 extern const StateSet getPredecessors(Nwa const &, State state ); 00106 00107 /** 00108 * 00109 * @brief obtains all the states that are predecessors of the given state with 00110 * respect to the given symbol 00111 * 00112 * This method returns all the states that are predecessors of the given state 00113 * such that the symbol that labels a transition from each predecessor to the 00114 * given state is the given symbol. 00115 * 00116 * @param - symbol: the symbol that should label a transition from each predecessor 00117 * to the given state 00118 * @param - state: the state whose predecessors to look up 00119 * @param - preds: the set of all states that are predecessors of the given state 00120 * with respect to the given symbol 00121 * 00122 */ 00123 extern void getPredecessors(Nwa const &, Symbol symbol, State state, StateSet & preds ); 00124 /** 00125 * 00126 * @brief obtains all the states that are predecessors of the given state with 00127 * respect to the given symbol 00128 * 00129 * This method returns all the states that are predecessors of the given state 00130 * such that the symbol that labels a transition from each predecessor to the 00131 * given state is the given symbol. 00132 * 00133 * @param - symbol: the symbol that should label a transition from each predecessor 00134 * to the given state 00135 * @param - state: the state whose predecessors to look up 00136 * @return the set of all states that are predecessors of the given state with 00137 * respect to the given symbol 00138 * 00139 */ 00140 extern const StateSet getPredecessors(Nwa const &, Symbol symbol, State state ); 00141 00142 /** 00143 * 00144 * @brief obtains all the states that are successors of the given state 00145 * 00146 * This method returns all the states that are successors of the given state. 00147 * 00148 * @param - state: the state whose successors to lookup 00149 * @param - succs: the set of all states that are successors of the given state 00150 * 00151 */ 00152 extern void getSuccessors(Nwa const &, State state, StateSet & succs ); 00153 /** 00154 * 00155 * @brief obtains all the states that are successors of the given state 00156 * 00157 * This method returns all the states that are successors of the given state. 00158 * 00159 * @param - state: the state whose successors to look up 00160 * @return the set of all states that are successors of the given state 00161 * 00162 */ 00163 extern const StateSet getSuccessors(Nwa const &, State state ); 00164 00165 /** 00166 * 00167 * @brief obtains all the states that are successors of the given state with 00168 * respect to the given symbol 00169 * 00170 * This method returns all the states that are successors of the given state 00171 * such that the symbol that labels a transition from the given state to each 00172 * successor is the given symbol. 00173 * 00174 * @param - symbol: the symbol that should label a transition from the given 00175 * state to each successor 00176 * @param - state: the state whose successors to look up 00177 * @param - succs: the set of all states that are successors of the given state 00178 * with respect to the given symbol 00179 * 00180 */ 00181 extern void getSuccessors(Nwa const &, State state, Symbol symbol, StateSet & succs ); 00182 /** 00183 * 00184 * @brief obtains all the states that are successors of the given state with 00185 * respect to the given symbol 00186 * 00187 * This method returns all the states that are successors of the given state 00188 * such that the symbol that labels a transition from the given state to each 00189 * successor is the given symbol. 00190 * 00191 * @param - symbol: the symbol that should label a transition from the given 00192 * state to each successor 00193 * @param - state: the state whose successors to look up 00194 * @return the set of all states that are successors of the given state 00195 * with respect to the given symbol 00196 * 00197 */ 00198 extern const StateSet getSuccessors(Nwa const &, State state, Symbol symbol ); 00199 00200 /** 00201 * 00202 * @brief obtains all the symbols that label return transitions whose 00203 * call-predecessor is 'call' and whose return site is 'ret' 00204 * 00205 * This method returns all the symbols that label return transitions 00206 * whose call-predecessor is 'call' and whose return site is 'ret' 00207 * 00208 * @param - call: the call-predecessor of the desired return transitions 00209 * @param - ret: the return site of the desired return transitions 00210 * @return the set of symbols that label return transitions whose 00211 * call-predecessor is 'call' and whose return site is 'ret' 00212 * 00213 */ 00214 extern const SymbolSet getCallRetSymbols(Nwa const &, State call, State ret ); 00215 00216 /** 00217 * 00218 * @brief obtains all the symbols that label return transitions whose 00219 * call-predecessor is 'call' 00220 * 00221 * This method returns all the symbols that label return transitions 00222 * whose call-predecessor is 'call' 00223 * 00224 * @param - call: the call-predecessor of the desired return transitions 00225 * @return the set of symbols that label return transitions whose 00226 * call-predecessor is 'call' 00227 * 00228 */ 00229 extern const SymbolSet getCallRetSymbolsFrom(Nwa const &, State call ); 00230 00231 /** 00232 * 00233 * @brief obtains all the symbols that label return transitions whose 00234 * return site is 'ret' 00235 * 00236 * This method returns all the symbols that label return transitions 00237 * whose return site is 'ret' 00238 * 00239 * @param - ret: the return site of the desired return transitions 00240 * @return the set of symbols that label return transitions whose 00241 * return site is 'ret' 00242 * 00243 */ 00244 extern const SymbolSet getCallRetSymbolsTo(Nwa const &, State ret ); 00245 00246 /** 00247 * 00248 * @brief obtains all the states that are call-predecessors of the given state 00249 * 00250 * This method returns all the states that are call-predecessors of the given 00251 * state. 00252 * 00253 * @param - state: the state whose call-predecessors to look up 00254 * @param - preds: the set of all states that are call-predecessors of the given state 00255 * 00256 */ 00257 extern void getCallPredecessors(Nwa const &, State state, StateSet & c_preds ); 00258 /** 00259 * 00260 * @brief obtains all the states that are call-predecessors of the given state 00261 * 00262 * This method returns all the states that are call-predecessors of the given state. 00263 * 00264 * @param - state: the state whose call-predecessors to look up 00265 * @return the set of all states that are call-predecessors of the given state 00266 * 00267 */ 00268 extern const StateSet getCallPredecessors(Nwa const &, State state ); 00269 00270 /** 00271 * 00272 * @brief obtains all the states that are call-predecessors of the given state with 00273 * respect to the given symbol 00274 * 00275 * This method returns all the states that are call-predecessors of the given state 00276 * such that the symbol that labels a return transition with each call-predecessor 00277 * and the given state is the given symbol. 00278 * 00279 * @param - symbol: the symbol that should label a transition with each call-predecessor 00280 * and the given state 00281 * @param - state: the state whose call-predecessors to look up 00282 * @param - preds: the set of all states that are call-predecessors of the given state 00283 * with respect to the given symbol 00284 * 00285 */ 00286 extern void getCallPredecessors(Nwa const &, Symbol symbol, State state, StateSet & c_preds ); 00287 /** 00288 * 00289 * @brief obtains all the states that are call-predecessors of the given state with 00290 * respect to the given symbol 00291 * 00292 * This method returns all the states that are call-predecessors of the given state 00293 * such that the symbol that labels a return transition with each call-predecessor 00294 * and the given state is the given symbol. 00295 * 00296 * @param - symbol: the symbol that should label a transition with each call-predecessor 00297 * and the given state 00298 * @param - state: the state whose call-predecessors to look up 00299 * @return the set of all states that are call-predecessors of the given state 00300 * with respect to the given symbol 00301 * 00302 */ 00303 extern const StateSet getCallPredecessors(Nwa const &, Symbol symbol, State state ); 00304 00305 /** 00306 * 00307 * @brief obtains all the states that are call-successors of the given state 00308 * 00309 * This method returns all the states that are call-successors of the given state. 00310 * 00311 * @param - state: the state whose call-successors to lookup 00312 * @param - succs: the set of all states that are call-successors of the given state 00313 * 00314 */ 00315 extern void getCallSuccessors(Nwa const &, State state, StateSet & c_succs ); 00316 /** 00317 * 00318 * @brief obtains all the states that are call-successors of the given state 00319 * 00320 * This method returns all the states that are call-successors of the given state. 00321 * 00322 * @param - state: the state whose call-successors to look up 00323 * @return the set of all states that are call-successors of the given state 00324 * 00325 */ 00326 extern const StateSet getCallSuccessors(Nwa const &, State state ); 00327 00328 /** 00329 * 00330 * @brief obtains all the states that are call-successors of the given state with 00331 * respect to the given symbol 00332 * 00333 * This method returns all the states that are call-successors of the given state 00334 * such that the symbol that labels a return transition with each call-successor 00335 * and the given state is the given symbol. 00336 * 00337 * @param - symbol: the symbol that should label a return transition with each call- 00338 * successor and the given state 00339 * @param - state: the state whose call-successors to look up 00340 * @param - succs: the set of all states that are call-successors of the given state 00341 * with respect to the given symbol 00342 * 00343 */ 00344 extern void getCallSuccessors(Nwa const &, State state, Symbol symbol, StateSet & c_succs ); 00345 /** 00346 * 00347 * @brief obtains all the states that are call-successors of the given state with 00348 * respect to the given symbol 00349 * 00350 * This method returns all the states that are call-successors of the given state 00351 * such that the symbol that labels a return transition with each call-successor 00352 * and the given state is the given symbol. 00353 * 00354 * @param - symbol: the symbol that should label a return transition with each call- 00355 * successor and the given state 00356 * @param - state: the state whose call-successors to look up 00357 * @return the set of all states that are call-successors of the given state with 00358 * respect to the given symbol 00359 * 00360 */ 00361 extern const StateSet getCallSuccessors(Nwa const &, State state, Symbol symbol ); 00362 00363 } 00364 } 00365 00366 00367 // Yo, Emacs! 00368 // Local Variables: 00369 // c-file-style: "ellemtel" 00370 // c-basic-offset: 2 00371 // End: 00372 00373 #endif 00374