// otherwise look for state too
// TODO: contains OR containsSuperSet OR containsWithZeroes??
- if( hrn.getAlpha().contains( ne_state ) ) {
+ if( hrn.getAlpha().containsIgnorePreds( ne_state )
+ == null ) {
return hrn.getPreds();
}
hrnSrc = rg.id2hrn.get( e_hrnSrcID );
}
assert (vnSrc == null) || (hrnSrc == null);
+
+
+ System.out.println( " checking if src in graph" );
+
// the source is not present in graph
if( vnSrc == null && hrnSrc == null ) {
if( vnSrc != null ) {
rsn = vnSrc;
} else {
- if( !calleeReachableNodes.contains( e_hrnSrcID ) && !e_srcOutContext ) {
- return null;
- }
- if( calleeReachableNodes.contains( e_hrnSrcID ) && e_srcOutContext ) {
- return null;
+
+
+ System.out.println( " doing this thing, reachable nodes: "+calleeReachableNodes );
+
+ if( e_srcOutContext ) {
+ if( !hrnSrc.isOutOfContext() ) {
+ return null;
+ }
+ } else {
+ if( hrnSrc.isOutOfContext() ) {
+ return null;
+ }
}
+
rsn = hrnSrc;
}
+
+
+ System.out.println( " checking if dst in graph" );
+
+
// is the destination present?
HeapRegionNode hrnDst = rg.id2hrn.get( e_hrnDstID );
if( hrnDst == null ) {
return null;
}
+
+
+ System.out.println( " checking if edge/type/field matches" );
+
+
// is there an edge between them with the given
// type and field?
// TODO: type OR a subtype?
return edge.getPreds();
}
+
+ System.out.println( " state not null, checking for existence" );
+
+
// otherwise look for state too
// TODO: contains OR containsSuperSet OR containsWithZeroes??
- if( hrnDst.getAlpha().contains( ne_state ) ) {
+ if( hrnDst.getAlpha().containsIgnorePreds( ne_state )
+ == null ) {
return edge.getPreds();
}
calleeStatesSatisfied.get( stateCallee )
);
out = Canonical.add( out,
- stateCaller
- );
+ stateCaller
+ );
}
- }
+ }
}
assert out.isCanonical();
ReachSet oocReach;
TempDescriptor oocPredSrcTemp = null;
Integer oocPredSrcID = null;
+ boolean oocooc;
if( rsnCaller instanceof VariableNode ) {
VariableNode vnCaller = (VariableNode) rsnCaller;
oocNodeType = null;
oocReach = rsetEmpty;
oocPredSrcTemp = vnCaller.getTempDescriptor();
+ oocooc = false;
} else {
HeapRegionNode hrnSrcCaller = (HeapRegionNode) rsnCaller;
assert !callerNodeIDsCopiedToCallee.contains( hrnSrcCaller.getID() );
oocNodeType = hrnSrcCaller.getType();
oocReach = hrnSrcCaller.getAlpha();
- oocPredSrcID = hrnSrcCaller.getID();
+ oocPredSrcID = hrnSrcCaller.getID();
+ oocooc = hrnSrcCaller.isOutOfContext();
}
ExistPred pred =
reCaller.getType(),
reCaller.getField(),
null,
- true ); // out-of-context
+ oocooc ); // out-of-context
ExistPredSet preds =
ExistPredSet.factory( pred );
continue;
}
+
+
+ System.out.println( " preds satisfied? for "+reCallee+" "+reCallee.getPreds() );
+
+
+
// first see if the source is out-of-context, and only
// proceed with this edge if we find some caller-context
// matches
}
}
+ System.out.println( " YES" );
}
+
+ else {
+ System.out.println( " NO" );
+ }
+
}
}
}
}
+
// look to see if an edge with same field exists
// and merge with it, otherwise just add the edge
RefEdge edgeExisting = rsnCaller.getReferenceTo( hrnDstCaller,
if( B != null ) {
ReachSet boldB_rtOld_incident = B.get( incidentEdge );
if( boldB_rtOld_incident != null &&
- boldB_rtOld_incident.contains( stateOld ) ) {
+ boldB_rtOld_incident.containsIgnorePreds( stateOld ) != null
+ ) {
foundState = true;
}
}
return reachStates.isEmpty();
}
- public boolean contains( ReachState state ) {
- assert state != null;
- return reachStates.contains( state );
- }
-
// this should be a hash table so we can do this by key
public ReachState containsIgnorePreds( ReachState state ) {
assert state != null;
"->"+dst+")"
);
}
+
+ public String toStringAndBeta() {
+ return toString()+beta.toString();
+ }
}