*** empty log message ***
authorsivaji <sivaji>
Mon, 23 Apr 2007 19:57:07 +0000 (19:57 +0000)
committersivaji <sivaji>
Mon, 23 Apr 2007 19:57:07 +0000 (19:57 +0000)
Robust/src/Analysis/TaskStateAnalysis/TaskAnalysis.java
Robust/src/Analysis/TaskStateAnalysis/TaskAnalysisAlgorithm [new file with mode: 0644]

index a5b346403685b23d71394735aff0f5916badb37c..fb6de75467f6f20348d269843e0f7e5d07d4f5b2 100644 (file)
@@ -83,7 +83,7 @@ public class TaskAnalysis {
        getFlagsfromClasses();
        
        int externs;
-       q_main=new LinkedList<TriggerState>();
+       q_main=new LinkedList<FlagState>();
        
        for(Iterator it_classes=(Iterator)flags.keys();it_classes.hasNext();) {
            ClassDescriptor cd=(ClassDescriptor)it_classes.next();
diff --git a/Robust/src/Analysis/TaskStateAnalysis/TaskAnalysisAlgorithm b/Robust/src/Analysis/TaskStateAnalysis/TaskAnalysisAlgorithm
new file mode 100644 (file)
index 0000000..9bd2b6e
--- /dev/null
@@ -0,0 +1,32 @@
+Task Analysis:
+
+Algorithm:
+
+1.     Obtain the flags for each class in the program(Incase, a class has a super class, the super's flags, if any, are included
+    in the list of flags for the class)
+2.     Create a new flagstate for the StartupObject class with the initialstate flag set to true.  Append this flagstate to the 
+    queue, QMAIN.  
+3.     For each class that has only externs,  add all the possible runtime transitions(flagstates) to QMAIN.
+4.     Pop the head of QMAIN and use this flagstate FS to evaluate which task triggers on this.
+5.     Add all runtime transitions from FS to QMAIN and ADJLIST(as edges from FS) ensuring that the new states don't exist in QMAIN.
+6.     Iterate through the list of tasks using FS.
+7.     If a task is triggered, 
+       a.  If FS satisfies more than one parameter of the task,  throw an error stating that this is an illegal operation.
+       b.  If 7a is not true, then add FS to the ADJLIST for that particular class.  Before adding, ensure that the flagstate 
+    doesn't already exist in the ADJLIST.  Keep track of the temp (as TEMP) whose flags form the triggering flagstate.
+8.     Search through the FFANS in this task:
+       a.      For NewObject node,  
+               i.      If the new object is of a class which has only externs, create a new flagstate with all flags set to false and 
+                   push into QMAIN ensuring that it doesn't already exist in QMAIN and ADJLIST. 
+               ii.     If the new object is of a class which has both types of flags, create the new flagstate and append to QMAIN and 
+                       ADJLIST ensuring that the state doesn't already exist.
+               iii.If new object is of a class which has no externs, then create the new flagstate and append to QMAIN and ADJLIST
+                        ensuring that the state doesn't already exist.
+       b.      For the task exit node, apply the flag changes to the tempflag pairs corresponding to TEMP and create the new flagstate.  
+           Add this state alongwith the task as an Edge to FS in the ADJLIST.
+               i.      If the class has no external flags, append the new flagstate to QMAIN ensuring that it doesn't already exist.
+               ii.     If the class has both types of flags, create the possible runtime states from the base state obtained in 6b;  
+                       Also add the Runtime edges to the base state in ADJLIST.  Append the states to QMAIN ensuring that they are not there 
+                       already.
+       c.      For the PRE node, throw an error stating that this type of node isn't supported anymore in Bristlecone.
+9.     Repeat steps 4-8 until QMAIN is empty.