Determining phase sequence in software
Here is a circuit design that displays correct 3 phase order. It uses the SCR to store the memory of state B-C sequence and the polarity of A for each cycle.  No neutral is required here.



If you wanted to detect a missing phase, one would need a neutral reference and trigger a one-shot for each phase.