@@ -2944,6 +2944,12 @@ else if (op != null)
2944
2944
clones.put(val,used);
2945
2945
left.findClones(clones,rule,op);
2946
2946
right.findClones(clones,rule,op);
2947
+
2948
+ if ("->iterate".equals(operator) && accumulator != null)
2949
+ { Expression expr = accumulator.getInitialExpression();
2950
+ if (expr != null)
2951
+ { expr.findClones(clones,rule,op); }
2952
+ }
2947
2953
}
2948
2954
2949
2955
public void findClones(java.util.Map clones,
@@ -2968,11 +2974,24 @@ else if (op != null)
2968
2974
cloneDefs.put(val, this);
2969
2975
left.findClones(clones,cloneDefs,rule,op);
2970
2976
right.findClones(clones,cloneDefs,rule,op);
2977
+
2978
+ if ("->iterate".equals(operator) && accumulator != null)
2979
+ { Expression expr = accumulator.getInitialExpression();
2980
+ if (expr != null)
2981
+ { expr.findClones(clones,cloneDefs,rule,op); }
2982
+ }
2983
+
2971
2984
}
2972
2985
2973
2986
public void findMagicNumbers(java.util.Map mgns, String rule, String op)
2974
2987
{ left.findMagicNumbers(mgns,rule,op);
2975
2988
right.findMagicNumbers(mgns,rule,op);
2989
+
2990
+ if ("->iterate".equals(operator) && accumulator != null)
2991
+ { Expression expr = accumulator.getInitialExpression();
2992
+ if (expr != null)
2993
+ { expr.findMagicNumbers(mgns,rule,op); }
2994
+ }
2976
2995
}
2977
2996
2978
2997
@@ -7504,7 +7523,7 @@ public String exists1QueryForm(java.util.Map env, boolean local)
7504
7523
existsleft = left;
7505
7524
// localentity = left.getEntity(); // or entity of the elementType
7506
7525
if (left.elementType == null)
7507
- { System.err.println("Warning: no element type for: " + left);
7526
+ { System.err.println("!! Warning: no element type for: " + left);
7508
7527
// JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
7509
7528
// "Design error", JOptionPane.ERROR_MESSAGE);
7510
7529
}
@@ -7518,7 +7537,7 @@ else if (operator.equals("#1"))
7518
7537
existsvar = beleft.left + "";
7519
7538
// localentity = beleft.right.getEntity(); // or entity of the elementType
7520
7539
if (beleft.right == null || beleft.right.elementType == null)
7521
- { System.err.println("Warning: no element type of: " + beleft);
7540
+ { System.err.println("!! Warning: no element type of: " + beleft);
7522
7541
// JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
7523
7542
// "Design error", JOptionPane.ERROR_MESSAGE);
7524
7543
}
@@ -7601,7 +7620,7 @@ public String exists1QueryFormJava6(java.util.Map env, boolean local)
7601
7620
existsleft = left;
7602
7621
// localentity = left.getEntity(); // or entity of the elementType
7603
7622
if (left.elementType == null)
7604
- { System.err.println("DESIGN ERROR: no element type for: " + left);
7623
+ { System.err.println("!! DESIGN ERROR: no element type for: " + left);
7605
7624
JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
7606
7625
"Design error", JOptionPane.ERROR_MESSAGE);
7607
7626
}
@@ -7615,7 +7634,7 @@ else if (operator.equals("#1"))
7615
7634
existsvar = beleft.left + "";
7616
7635
// localentity = beleft.right.getEntity(); // or entity of the elementType
7617
7636
if (beleft.right == null || beleft.right.elementType == null)
7618
- { System.out.println("DESIGN ERROR: no element type of: " + beleft);
7637
+ { System.out.println("!! DESIGN ERROR: no element type of: " + beleft);
7619
7638
JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
7620
7639
"Design error", JOptionPane.ERROR_MESSAGE);
7621
7640
}
@@ -7699,7 +7718,7 @@ public String quantifierQueryFormJava7(java.util.Map env, boolean local)
7699
7718
existsleft = left;
7700
7719
// localentity = left.getEntity(); // or entity of the elementType
7701
7720
if (left.elementType == null)
7702
- { System.err.println("DESIGN ERROR: no element type for: " + left);
7721
+ { System.err.println("!! DESIGN ERROR: no element type for: " + left);
7703
7722
JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
7704
7723
"Design error", JOptionPane.ERROR_MESSAGE);
7705
7724
}
@@ -7714,7 +7733,7 @@ else if (operator.equals("#1") || operator.equals("#LC") ||
7714
7733
existsvar = beleft.left + "";
7715
7734
// localentity = beleft.right.getEntity(); // or entity of the elementType
7716
7735
if (beleft.right == null || beleft.right.elementType == null)
7717
- { System.out.println("DESIGN ERROR: no element type of: " + beleft);
7736
+ { System.out.println("!! DESIGN ERROR: no element type of: " + beleft);
7718
7737
JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
7719
7738
"Design error", JOptionPane.ERROR_MESSAGE);
7720
7739
}
@@ -16060,7 +16079,8 @@ public Scope resultScope()
16060
16079
else
16061
16080
{ return res2; }
16062
16081
}
16063
- if (operator.equals("=>") || operator.equals("#") || operator.equals("#1") ||
16082
+ if (operator.equals("=>") ||
16083
+ operator.equals("#") || operator.equals("#1") ||
16064
16084
operator.equals("#LC") || operator.equals("!"))
16065
16085
{ return right.resultScope(); } // this ?
16066
16086
return null;
@@ -16144,6 +16164,9 @@ public Expression substituteEq(final String oldVar,
16144
16164
16145
16165
// System.out.println("SUBSTITUTING " + oldVar + " BY " + newVal + " IN " + this);
16146
16166
16167
+ if (oldVar.equals(this + ""))
16168
+ { return newVal; }
16169
+
16147
16170
Expression newLeft = null;
16148
16171
if (left != null)
16149
16172
{ newLeft = left.substituteEq(oldVar,newVal); }
@@ -16327,7 +16350,7 @@ public Vector splitAnd(Vector sms)
16327
16350
else if (operator.equals("="))
16328
16351
{ return expandEqSucc(sms); }
16329
16352
else
16330
- { System.out.println("Expression in succedent without = or &! ");
16353
+ { System.out.println("!! Expression in succedent without = or &");
16331
16354
return res;
16332
16355
}
16333
16356
}
0 commit comments