use of catdata.fql.decl.TransExp.Relationalize in project fql by CategoricalData.
the class TransChecker method visit.
@Override
public Pair<String, String> visit(FQLProgram env, Squash e) {
InstExp s = env.insts.get(e.src);
if (!(s instanceof InstExp.Relationalize)) {
throw new RuntimeException("Not a relationalize: " + e);
}
InstExp.Relationalize xxx = (InstExp.Relationalize) s;
return new Pair<>(xxx.I, e.src);
}
use of catdata.fql.decl.TransExp.Relationalize in project fql by CategoricalData.
the class TransChecker method visit.
@Override
public Pair<String, String> visit(FQLProgram env, Relationalize e) {
Pair<String, String> ht = e.h.type(env);
InstExp i1 = env.insts.get(e.src);
if (!(i1 instanceof InstExp.Relationalize)) {
throw new RuntimeException(i1 + " is not a relationalize in " + e);
}
String i1x = ((InstExp.Relationalize) i1).I;
if (!i1x.equals(ht.first)) {
throw new RuntimeException("Source mismatch on " + e + ": " + i1x + " and " + ht.first);
}
InstExp i2 = env.insts.get(e.dst);
if (!(i2 instanceof InstExp.Relationalize)) {
throw new RuntimeException(i2 + " is not a relationalize in " + e);
}
String i2x = ((InstExp.Relationalize) i2).I;
if (!i2x.equals(ht.second)) {
throw new RuntimeException("Target mismatch on " + e + ": " + i2x + " and " + ht.second);
}
return new Pair<>(e.src, e.dst);
}
Aggregations