Improved precision of computation of maximum set sizes. Removed generation of
[repair.git] / Repair / RepairCompiler / MCC / IR / Expr.java
1 package MCC.IR;
2
3 import java.util.*;
4
5 public abstract class Expr {
6     
7     TypeDescriptor td = null;
8
9     public Expr() {}
10     /* Remap this's variables using the remap mapping */
11     public abstract boolean equals(Map remap, Expr e);
12
13     public abstract Set getRequiredDescriptors();
14
15     public abstract void generate(CodeWriter writer, VarDescriptor dest);
16
17     public TypeDescriptor getType() {
18         assert td != null : toString();
19         return td;
20     }
21
22     public String name() {
23         System.out.println(this.getClass().getName());
24         return "?";
25     }
26
27     public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
28
29     public abstract void prettyPrint(PrettyPrinter pp);
30
31     public Set getInversedRelations() {
32         throw new IRException("unsupported");
33     }
34
35     public DNFRule constructDNF() {
36         return new DNFRule(this);
37     }
38
39     public Descriptor getDescriptor() {
40         return null;
41     }
42
43     public boolean isValue(TypeDescriptor td) {
44         return false;
45     }
46
47     public int[] getRepairs(boolean negated, Termination t) {
48         System.out.println(this.getClass().getName());
49         throw new Error("Unrecognized EXPR");
50     }
51
52     public boolean inverted() {
53         return false;
54     }
55
56     public Set useDescriptor(Descriptor d) {
57         return new HashSet();
58     }
59
60     public boolean usesDescriptor(Descriptor rd) {
61         System.out.println(this.getClass().getName());
62         throw new Error("UNIMPLEMENTED");
63     }
64     public boolean isNull() {
65         return false;
66     }
67     public boolean isNonNull() {
68         return false;
69     }
70     public Set freeVars() {
71         return null;
72     }
73
74     public void findmatch(Descriptor d, Set s) {
75     }
76
77     public Set getfunctions() {
78         return null;
79     }
80
81     public SetDescriptor getSet() {
82         return null; /* unknown value */
83     }
84
85     public Expr stripCastExpr() {
86         Expr ptr=this;
87         while (ptr instanceof CastExpr)
88             ptr=((CastExpr)ptr).getExpr();
89         return ptr;
90     }
91
92     public boolean isSafe() {
93         return true;
94     }
95
96     public Expr getLower() {
97         return null;
98     }
99
100     public Expr getUpper() {
101         return null;
102     }
103     public boolean isInvariant(Set vars) {
104         return false;
105     }
106     public Set findInvariants(Set vars) {
107         return new HashSet();
108     }
109 }