places = new HashSet<Integer>();
places.add(new Integer(pathLength));
amplPathForPost.put(oTran, places);
}
//state invariant
TCGNode oNode = oPair.getSecond();
if(oNode instanceof TCGRealNode){
TCGRealNode oRealNode = (TCGRealNode) oNode;
if(oRealNode.getCondition() != null && !oRealNode.getCondition().getConjunctions().isEmpty()){
if(oRealNode.getCondition().getOriginalExpression() != null){
Set<Integer> places = null;
if (amplPathForStateInv.containsKey(oRealNode))
places = amplPathForStateInv.get(oRealNode);
if (places == null)
places = new HashSet<Integer>();
places.add(new Integer(pathLength));
amplPathForStateInv.put(oRealNode, places);
}
}
}
}
StringBuilder sb = new StringBuilder();
sb.append("param Pathlength := " + pathLength + ";\n");
//set initial value for which model variables that have initial value
//sb.append(setInitialValueOfVariables(allModelVariables));
//for pre conditions
for (Entry<TCGTransition, Set<Integer>> entry : amplPathForPre
.entrySet()) {
TCGTransition oTransition = entry.getKey();
String s = oTransition.getPreSetName();
String substitute = s.replaceAll("\\s", "_");
sb.append("set " + substitute
+ ":=");
for (Integer j : entry.getValue()) {
sb.append(" " + j);
}
sb.append(";\n");
}
//for post conditions
for (Entry<TCGTransition, Set<Integer>> entry : amplPathForPost
.entrySet()) {
TCGTransition oTransition = entry.getKey();
String s = oTransition.getPostSetName();
String substitute = s.replaceAll("\\s", "_");
sb.append("set " + substitute
+ ":=");
for (Integer j : entry.getValue()) {
sb.append(" " + j);
}
sb.append(";\n");
}
//for state invariant
for (Entry<TCGNode, Set<Integer>> entry : amplPathForStateInv
.entrySet()) {
TCGNode oNode = entry.getKey();
String s = oNode.getName();
String substitute = s.replaceAll("::", "_");
substitute = substitute.replaceAll("\\s", "_");
sb.append("set " + substitute
+ ":=");
for (Integer j : entry.getValue()) {