5 public abstract class Expr {
7 TypeDescriptor td = null;
10 /* Remap this's variables using the remap mapping */
11 public abstract boolean equals(Map remap, Expr e);
13 public abstract Set getRequiredDescriptors();
15 public abstract void generate(CodeWriter writer, VarDescriptor dest);
17 public TypeDescriptor getType() {
18 assert td != null : toString();
22 public String toString() {
26 public String name() {
27 System.out.println(this.getClass().getName());
31 public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
33 public abstract void prettyPrint(PrettyPrinter pp);
35 public Set getInversedRelations() {
36 throw new IRException("unsupported");
39 public DNFRule constructDNF() {
40 return new DNFRule(this);
43 public Descriptor getDescriptor() {
47 public boolean isValue(TypeDescriptor td) {
51 public int[] getRepairs(boolean negated, Termination t) {
52 System.out.println(this.getClass().getName());
53 throw new Error("Unrecognized EXPR");
56 public boolean inverted() {
60 public Set useDescriptor(Descriptor d) {
64 public boolean usesDescriptor(Descriptor rd) {
65 System.out.println(this.getClass().getName());
66 throw new Error("UNIMPLEMENTED");
68 public boolean isNull() {
71 public boolean isNonNull() {
74 public Set freeVars() {
78 public void findmatch(Descriptor d, Set s) {
81 public Set getfunctions() {
85 public SetDescriptor getSet() {
86 return null; /* unknown value */
89 public Expr stripCastExpr() {
91 while (ptr instanceof CastExpr)
92 ptr=((CastExpr)ptr).getExpr();
96 public boolean isSafe() {
100 public Expr getLower() {
104 public Expr getUpper() {
107 public boolean isInvariant(Set vars) {
110 public Set findInvariants(Set vars) {
111 return new HashSet();