@@ -2944,6 +2944,12 @@ else if (op != null)
29442944 clones.put(val,used);
29452945 left.findClones(clones,rule,op);
29462946 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+ }
29472953}
29482954
29492955public void findClones(java.util.Map clones,
@@ -2968,11 +2974,24 @@ else if (op != null)
29682974 cloneDefs.put(val, this);
29692975 left.findClones(clones,cloneDefs,rule,op);
29702976 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+
29712984}
29722985
29732986 public void findMagicNumbers(java.util.Map mgns, String rule, String op)
29742987 { left.findMagicNumbers(mgns,rule,op);
29752988 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+ }
29762995 }
29772996
29782997
@@ -7504,7 +7523,7 @@ public String exists1QueryForm(java.util.Map env, boolean local)
75047523 existsleft = left;
75057524 // localentity = left.getEntity(); // or entity of the elementType
75067525 if (left.elementType == null)
7507- { System.err.println("Warning: no element type for: " + left);
7526+ { System.err.println("!! Warning: no element type for: " + left);
75087527 // JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
75097528 // "Design error", JOptionPane.ERROR_MESSAGE);
75107529 }
@@ -7518,7 +7537,7 @@ else if (operator.equals("#1"))
75187537 existsvar = beleft.left + "";
75197538 // localentity = beleft.right.getEntity(); // or entity of the elementType
75207539 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);
75227541 // JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
75237542 // "Design error", JOptionPane.ERROR_MESSAGE);
75247543 }
@@ -7601,7 +7620,7 @@ public String exists1QueryFormJava6(java.util.Map env, boolean local)
76017620 existsleft = left;
76027621 // localentity = left.getEntity(); // or entity of the elementType
76037622 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);
76057624 JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
76067625 "Design error", JOptionPane.ERROR_MESSAGE);
76077626 }
@@ -7615,7 +7634,7 @@ else if (operator.equals("#1"))
76157634 existsvar = beleft.left + "";
76167635 // localentity = beleft.right.getEntity(); // or entity of the elementType
76177636 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);
76197638 JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
76207639 "Design error", JOptionPane.ERROR_MESSAGE);
76217640 }
@@ -7699,7 +7718,7 @@ public String quantifierQueryFormJava7(java.util.Map env, boolean local)
76997718 existsleft = left;
77007719 // localentity = left.getEntity(); // or entity of the elementType
77017720 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);
77037722 JOptionPane.showMessageDialog(null, "no element type for " + left + " in " + this,
77047723 "Design error", JOptionPane.ERROR_MESSAGE);
77057724 }
@@ -7714,7 +7733,7 @@ else if (operator.equals("#1") || operator.equals("#LC") ||
77147733 existsvar = beleft.left + "";
77157734 // localentity = beleft.right.getEntity(); // or entity of the elementType
77167735 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);
77187737 JOptionPane.showMessageDialog(null, "no element type for " + beleft + " in " + this,
77197738 "Design error", JOptionPane.ERROR_MESSAGE);
77207739 }
@@ -16060,7 +16079,8 @@ public Scope resultScope()
1606016079 else
1606116080 { return res2; }
1606216081 }
16063- if (operator.equals("=>") || operator.equals("#") || operator.equals("#1") ||
16082+ if (operator.equals("=>") ||
16083+ operator.equals("#") || operator.equals("#1") ||
1606416084 operator.equals("#LC") || operator.equals("!"))
1606516085 { return right.resultScope(); } // this ?
1606616086 return null;
@@ -16144,6 +16164,9 @@ public Expression substituteEq(final String oldVar,
1614416164
1614516165 // System.out.println("SUBSTITUTING " + oldVar + " BY " + newVal + " IN " + this);
1614616166
16167+ if (oldVar.equals(this + ""))
16168+ { return newVal; }
16169+
1614716170 Expression newLeft = null;
1614816171 if (left != null)
1614916172 { newLeft = left.substituteEq(oldVar,newVal); }
@@ -16327,7 +16350,7 @@ public Vector splitAnd(Vector sms)
1632716350 else if (operator.equals("="))
1632816351 { return expandEqSucc(sms); }
1632916352 else
16330- { System.out.println("Expression in succedent without = or &! ");
16353+ { System.out.println("!! Expression in succedent without = or &");
1633116354 return res;
1633216355 }
1633316356 }
0 commit comments