6 Hashtable conjunctionmap;
8 HashSet abstractrepair;
12 public Termination(State state) {
14 generateconjunctionnodes();
15 generaterepairnodes();
18 void generateconjunctionnodes() {
19 Vector constraints=state.vConstraints;
20 for(int i=0;i<constraints.size();i++) {
21 Constraint c=(Constraint)constraints.get(i);
22 DNFConstraint dnf=c.dnfconstraint;
23 for(int j=0;j<dnf.size();j++) {
24 TermNode tn=new TermNode(c,dnf.get(j));
25 GraphNode gn=new GraphNode("Conjunction"+i+","+j,tn);
27 conjunctionmap.put(c,gn);
32 void generaterepairnodes() {
33 for(Iterator conjiterator=conjunctions.iterator();conjiterator.hasNext();) {
34 GraphNode gn=(GraphNode)conjiterator.next();
35 TermNode tn=(TermNode)gn.getOwner();
36 Conjunction conj=tn.getConjunction();
37 for(int i=0;i<conj.size();i++) {
38 DNFPredicate dp=conj.get(i);
39 int[] array=dp.getPredicate().getRepairs();
40 for {int j=0;j<array.length;j++) {
41 AbstractRepair ar=new AbstractRepair(dp,array[j]);
42 TermNode tn=new TermNode(ar);
43 GraphNode gn2=new GraphNode(gn.getLabel()+"-"+i+","+j,tn);
44 Edge e=new Edge("abstract",gn2);
46 abstractrepair.add(gn2);
53 class AbstractRepair {
54 public final static int ADDTOSET=1;
55 public final static int REMOVEFROMSET=2;
56 public final static int ADDTORELATION=3;
57 public final static int REMOVEFROMRELATION=4;
58 public final static int MODIFYRELATION=5;
60 DNFPredicate torepair;
63 public AbstractRepair(DNFPredicate dp,int typ) {
70 public final static int CONJUNCTION=1;
71 public final static int ABSTRACT=2;
76 AbstractRepair repair;
78 public TermNode(Constraint constr, Conjunction conj) {
84 public TermNode(AbstractRepair ar) {
89 public Conjunction getConjunction() {