A Rigorous Solution to the Problem of Phase Behavior in Unconventional Formations with High Capillary Pressure