bug fixes
[IRC.git] / Robust / src / Analysis / TaskStateAnalysis / Predicate.java
index b00b8984672d033b9992926408f49931df9ebee2..7fefe6ec6951da34fdf8030e7b71d7e0b7a57079 100644 (file)
@@ -5,30 +5,29 @@ import IR.Tree.*;
 import IR.Flat.*;
 import Util.Edge;
 
-public class Predicate{
-    public Hashtable<String, VarDescriptor> vardescriptors;
-    public Hashtable<String, HashSet<FlagExpressionNode>> flags;
-    public Hashtable<String, TagExpressionList> tags; //if there is a tag change, we stop the analysis
+public class Predicate {
+    public HashSet<VarDescriptor> vardescriptors;
+    public Hashtable<VarDescriptor, HashSet<FlagExpressionNode>> flags;
+    public Hashtable<VarDescriptor, TagExpressionList> tags; 
+    //if there is a tag change, we stop the analysis
     
     public Predicate(){
-       this.vardescriptors = new Hashtable();
-       this.flags = new Hashtable();
-       this.tags = new Hashtable();
+       this.vardescriptors = new HashSet<VarDescriptor>();
+       this.flags = new Hashtable<VarDescriptor, HashSet<FlagExpressionNode>>();
+       this.tags = new Hashtable<VarDescriptor, TagExpressionList>();
     } 
 
-    public boolean equals(Object o){
-       if(o instanceof Predicate){
-           Predicate p = (Predicate) o;
-           if(this.vardescriptors.equals(p.vardescriptors))
+    public boolean equals(Object o) {
+       if (o instanceof Predicate) {
+           Predicate p=(Predicate)o;
+           if (vardescriptors.equals(p.vardescriptors)&&
+               flags.equals(p.flags)&&
+               tags.equals(p.tags))
                return true;
-           return false;
        }
-       else return false;
+       return false;
     }
-
-    public int hashCode(){
+    public int hashCode() {
        return vardescriptors.hashCode();
     }
-
-
 }