From: <fra...@us...> - 2009-09-09 17:52:41
|
Revision: 1899 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1899&view=rev Author: frankrimlinger Date: 2009-09-09 17:52:35 +0000 (Wed, 09 Sep 2009) Log Message: ----------- Throughout this discussion, "method" always means "co-recursive system of methods", which most of the time is just an ordinary method component. In order to implement the logic of 1898, introduced ComponentChoiceGenerator, analogous to TargetChoiceGenerator for the SCANNER. The InvokeRewrite instruction now loads the ComponentChoiceGenerator, which initializes by creating the ComponentSurvey, analogous to the SCANNER CodeSurvey. Also, three different extensions of RewriteChoiceGenerator are introduced: MethodChoiceGenerator, BlowupChoiceGenerator, and LoopChoiceGenerator. A RewriteChoiceGenerator is subordinate to the ComponentChoiceGenerator, just as the BranchChoiceGenerator is subordinate to the TargetChoiceGenerator in the SCANNER. A crucial design point is that the Vertex and Edge instructions are unaware of the context in which they are executing, be it method, blowup, or loop. So any logic specific to an individual context must be in the corresponding choice generator, NOT the instruction. But this begs the question, how is an instruction to know what kind of ChoiceGenerator to load? Well, since branching logic is quite different depending on the context, this question now has to be reflected back to the current choice generator. Now the game plays itself. The ComponentSurvey will create a list of components, which are all extensions of Graphic, in order of increasing dependence. To execute a component is simply to install the correct choice generator extension. The LoopChoiceGenerator is for innermost loops modelled by the SimpleLoopPath class. The rest of the components are all LoopGraphs, which may be distinguished by whether or not the alphaSym field is defined. The BlowUpChoiceGenerator is for all LoopGraphs with defined alphaSym, and the balance are for MethodChoiceGenerator. The set of most dependent components corresponds exactly to this balance, and consist of a single LoopGraph except possible in the case of mutually co-recursive methods. With the seed ChoiceGenerator in place, execution of instructions commences, and subsequent choice generators will be of the same type. The branching logic for the choice generators is like so: PathChoiceGenerator: trivial, just execute the path and specify the loop when you get to the end. BlowUpChoiceGenerator: Execute starting at the alpha vertex. Do not go down any edge which only leads to a component sink other than omega. Each time you get to omega, specify a case of the loop. When all paths to the loop are specified, complete the loop specification. MethodChoiceGenerator: Execute starting at each entrance. Do not go down any path that leads only to an alpha vertex. (Its ok to cross an omega vertex, you just pick up the loop transformer as part of your predicate transformation.) When you get to a component sink, follow all connectors. If you get to a sink with no connectors, specify the case. When you specify the last case, complete the method specification. NB: the "unravelling predicate transformers" document is still in force, as it deals mostly with events that take place during instruction execution. This note deals what takes place before and after execution. Some of the responsibilities in this note may actually be performed by listeners, this is mostly a matter of convenience. TODO: finish the target selection algorithm, and then implement this note and unravelling pred transformers. Then lots of testing. Modified Paths: -------------- branches/mango/Mango/javapathfinder-mango-bridge/mango/rewriter/synthetic/InvokeRewriter.java Added Paths: ----------- branches/mango/Mango/javapathfinder-mango-bridge/mango/rewriter/BlowupChoiceGenerator.java branches/mango/Mango/javapathfinder-mango-bridge/mango/rewriter/ComponentChoiceGenerator.java branches/mango/Mango/javapathfinder-mango-bridge/mango/rewriter/LoopChoiceGenerator.java branches/mango/Mango/javapathfinder-mango-bridge/mango/rewriter/MethodChoiceGenerator.java This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |