The DirectTo benchmark executes a list of messages from
an input file to solve a safe aircraft routing problem.
+
The D2 (direct-to) singleton object has a singleton
reference to:
-ReadWrite, reads input file, creates messages
*** all memory in the program should be reachable from
at most one of any singleton (D2, Static, etc) ***
+
MessageList has a Vector of Message objects, where each
one specifys an effect for other structures such as
setting a constant in the Static singleton, or adding
objects themselves only have references that are freshly
allocated, so:
*** Message objects should be disjoint ***
+ANALYSIS FALSELY REPORTS SHARING
+
The ReadWrite singleton appends new Message objects
to the MessageList and has no references of its own,
*** Nothing is reachable from a ReadWrite ***
+
The Static singleton has primitive members, so
*** Nothing is reachable from a Static ***
+
AircraftList has a Vector of Aircraft objects, where
each one has a String for type and some primitive
attributes, where the type is generated from a
StringTokenizer (getting a token gets a new String),
and in practice is disjoint for every Aircraft, so:
-*** Aircraft objects should be disjoint ***
+*** Aircraft objects should be disjoint ***
+VERIFIED BY ANALYSIS
+
FixList has a Vector of Fix objects, where each one
has a String name and a Point2d (an alternate point
in a flight plan?). I believe they are not modified
after being built from freshly allocated tokenizing,
*** Fix objects should be disjoint ***
+ANALYSIS FALSELY REPORTS SHARING
+
FlightList has a Vector of Flight objects which have
several fresh, set-once references (flightID String,
a Track, etc).
-Flight objects may share Aircraft (types),
+*** Flight objects may share Aircraft (types) ***
+VERIFIED BY ANALYSIS
+...and other objects also.
In Message.executeMessage(), if you comment out every
// sets the parameters of the aircraft number "pos": its name, its lift and its thrust
public void setAircraft(String name,double lift,double thrust) {
- aircrafts.addElement(new Aircraft(name,lift,thrust));
+ aircrafts.addElement(/*disjoint aircraft*/ new Aircraft(name,lift,thrust));
}
public Aircraft getAircraft(String name) {
return false;
}
- public /*static*/ Point4d findConflict(D2 d2, Flight a, Flight b) {
+ public /*static*/ Point4d findConflict(D2 d2, Flight a, Flight b) {
Point4d conflictPoint=new Point4d(Point4d.outOfRangeTime(),0,0,0);
if (a.flightID!=b.flightID) {
Vector p1=a.traject.p;
public TrajectorySynthesizer singletonTrajectorySynthesizer; public TrajectorySynthesizer getTrajectorySynthesizer() { return singletonTrajectorySynthesizer; }
public D2() {
- singletonReadWrite = new ReadWrite ();
- singletonMessageList = new MessageList ();
- singletonStatic = new Static ();
- singletonAircraftList = new AircraftList ();
- singletonFlightList = new FlightList ();
- singletonFixList = new FixList ();
- singletonAlgorithm = new Algorithm ();
- singletonTrajectorySynthesizer = new TrajectorySynthesizer();
+ singletonReadWrite = disjoint rw new ReadWrite ();
+ singletonMessageList = disjoint ml new MessageList ();
+ singletonStatic = disjoint st new Static ();
+ singletonAircraftList = disjoint al new AircraftList ();
+ singletonFlightList = disjoint fl new FlightList ();
+ singletonFixList = disjoint xl new FixList ();
+ singletonAlgorithm = disjoint ag new Algorithm ();
+ singletonTrajectorySynthesizer = disjoint ts new TrajectorySynthesizer();
}
public static void main(String arg[]) {
// and its coordinates
public /*static*/ void setFix(String name,float x,float y)
{
- _fixes.addElement(new Fix(name,(Point2d) new Point2d(x,y)));
+ _fixes.addElement(/* disjoint fix */ new Fix(name,(Point2d) new Point2d(x,y)));
}
public /*static*/ String getFix(int index)
}
public static Flight copyOf(Flight f) {
- Flight fNew = disjoint flightCopy new Flight(f.flightID);
+ Flight fNew = /*disjoint flightCopy*/ new Flight(f.flightID);
fNew.trialStatus = f.trialStatus;
fNew.aircraftType = f.aircraftType;
fNew.track = f.track;
}
public void addFlightPlan(D2 d2, int time, StringTokenizer st) {
- Flight newFlight=disjoint flightAdd new Flight(st.nextToken());
+ Flight newFlight=/*disjoint flightAdd*/ new Flight(st.nextToken());
noFlights++;
f.addElement(newFlight);
StringTokenizer st=new StringTokenizer(line);
int time=Integer.parseInt(st.nextToken());
String type=st.nextToken();
- Message newMessage=disjoint msgs new Message(time,type,st);
+ Message newMessage=/*disjoint msgs*/ new Message(time,type,st);
messages.addElement(newMessage);
if (type.equals("DO_WORK"))
return true;
// do this once
//for (int i=0;i<rAux.noFixes;i++)
// rAux.addFix(d2,i,st.nextToken());
- //////////////////////////////
- rAux.addFix(d2,0,st.nextToken());
-
+ //////////////////////////////
+ rAux.addFix(d2,0,st.nextToken());
fAux.fPlan.setRoute(rAux);
- fAux.fPlan.setCruiseParam(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
+ //fAux.fPlan.setCruiseParam(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
}
public void amendFlightInfo(D2 d2, int time, StringTokenizer st) {
BUILDSCRIPT=~/research/Robust/src/buildscript
BSFLAGS= -debug -mainclass $(MAIN_CLASS) -joptimize -flatirusermethods #-flatirlibmethods
-#DBCALLFLAGS= -owndebugcaller main -owndebugcallee executeAll
+##########################################################
+## For inspecting a particularly problematic call chain
+##########################################################
+DBCALLFLAGS= -owndebugcaller main -owndebugcallee executeAll
#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee executeMessage -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee next -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee hasNext -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee size -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee getFlightList -owndebugcallcount 0
#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee amendFlightPlan -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee getFlight -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee setRoute -owndebugcallcount 0
+
+
#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee addFix -owndebugcallcount 0
#DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee addFix -owndebugcallcount 0
#DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee insertElementAt -owndebugcallcount 0
#DBCALLFLAGS= -owndebugcaller insertElementAt -owndebugcallee ensureCapacity -owndebugcallcount 0
+
+#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee getFlightList -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee getFlight -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee next -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee hasNext -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee size -owndebugcallcount 0
+
+
ANALYZEFLAGS= -justanalyze $(DBCALLFLAGS) -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions
all: $(PROGRAM)