Type rightrelType = right.getType();
int leftArity = leftrelType.getArity();
int rightArity = rightrelType.getArity();
if (leftArity != 0 && leftArity != 2) {
throw new Arity(2, leftArity, ctx.getCurrentAST());
}
if (rightArity != 0 && rightArity != 2) {
throw new Arity(2, rightArity, ctx.getCurrentAST());
}
Type resultType = leftrelType.compose(rightrelType);
return makeResult(resultType, left.getValue().asRelation().compose(right.getValue().asRelation()), ctx);
}