This is specifically for the Mathematica package. Primary variables could be deduced by reconstructing the linear graph from the constraint equations. The main issue I don't know how to solve is the reliable auto-detection of across- and through-variables.