Algorithms for Compiler Design: EQUIVALENCE OF TWO AUTOMATAS
2.12 EQUIVALENCE OF TWO AUTOMATAS
Automatas M1 and M2 are said to be equivalent if they accept the same language; that is, L(M1) = L(M2). It is possible to test whether the automatas M1 and M2 accept the same language—and hence, whether they are equivalent or not. One method of doing this is to minimize both M1 and M2, and if the minimal state automatas obtained from M1 and M2 are identical, then M1 is equivalent to M2.
Another method to test whether or not M1 is equivalent to M2 is to find out if:
For this, complement M2, and construct an automata that accepts both the intersection of language accepted by M1 and the complement of M2. If this automata accepts an empty set, then it means that there is no string acceptable to M1 that is not acceptable to M2. Similarly, construct an automata that accepts the intersection of language accepted by M2 and the complement of M1. If this automata accepts an empty set, then it means that there is no string acceptable to M2 that is not acceptable to M1. Hence, the language accepted by M1 is same as the language accepted by M2.