Ejemplo n.º 1
0
 @Override
 public Category visit(FQLProgram env, Exp e) {
   Category<?, ?> a = e.a.accept(env, this);
   Category<?, ?> b = e.b.accept(env, this);
   if (!a.isInfinite() && !b.isInfinite()) {
     return FinCat.FinCat.exp(a, b);
   } else if (!b.isInfinite() && a.equals(FinSet.FinSet)) {
     return Inst.get(b);
   } else if (!b.isInfinite() && a.equals(FinCat.FinCat)) {
     return FunCat.get(b);
   } else {
     throw new RuntimeException("Cannot compute category " + a + "^" + b);
   }
 }