9419563054aa9b2595e0c8a48fdfb9f0ad83551e
[repair.git] / Repair / RepairCompiler / MCC / IR / ConcreteInterferes.java
1 package MCC.IR;
2
3 class ConcreteInterferes {
4     static public boolean interferes(MultUpdateNode mun, Rule r, boolean satisfy) {
5         for(int i=0;i<mun.numUpdates();i++) {
6             UpdateNode un=mun.getUpdate(i);
7             for (int j=0;j<un.numUpdates();j++) {
8                 Updates update=un.getUpdate(j);
9                 
10                 DNFRule drule=r.getDNFGuardExpr();
11                 if (satisfy)
12                     drule=r.getDNFNegGuardExpr();
13
14                 if (!update.isAbstract()) {
15                     Descriptor updated_des=update.getDescriptor();
16                     assert updated_des!=null;
17                     if (r.getInclusion().usesDescriptor(updated_des))
18                         return true; /* Interferes with inclusion condition */
19                     
20                     for(int k=0;k<drule.size();k++) {
21                         RuleConjunction rconj=drule.get(k);
22                         for(int l=0;l<rconj.size();l++) {
23                             DNFExpr dexpr=rconj.get(l);
24                             /* See if update interferes w/ dexpr */
25                             
26                             if (!dexpr.getExpr().usesDescriptor(updated_des))
27                                 continue; /* No use of the descriptor */
28                             
29                             return true;
30                         }
31                     }
32                 }
33             }
34         }
35         return false;
36     }
37 }