Add basic graph analysis to compute mutually recursive definitions