use of catdata.fql.decl.InstExp.Times in project fql by CategoricalData.
the class TransChecker method visit.
@Override
public Pair<String, String> visit(FQLProgram env, And e) {
InstExp v = env.insts.get(e.prop);
if (v == null) {
throw new RuntimeException("Missing instance: " + e.prop);
}
if (!(v instanceof Times)) {
throw new RuntimeException("Not a product in " + e);
}
Times v0 = (Times) v;
if (!v0.a.equals(v0.b)) {
throw new RuntimeException("Not the same prop in " + e);
}
if (!(env.insts.get(v0.a) instanceof Two)) {
throw new RuntimeException("Not a prop in " + e);
}
return new Pair<>(e.prop, v0.a);
}
Aggregations