Open
Description
Create a new function that is part of Set.
It should return a Relation * R.
when we do R->Apply(originalSet);
We should get a valid ordering of the tuple variables for codegen.
So, what is a valid ordering?
Say we have a set {[i,j,k,l]}
If we start from l and projectOut the tuple variables one at a time, there should be no errors.
If, at any point, there is an error, we need to move the tuple variables around. Specifically, the one that caused an error should be shifted closer to the front.