The equivalence algorithm of Korenjak and Hopcroft (KH) for s-grammars is investigated. Two alternative versions, the KHC and KHS algorithms are presented, the first answers a question posed by I-Iopcroft and the second is formally and practically a faster algorithm.
Introduction.Korenjak and Hopcroft [4], referred to as KH throughout this paper, introduced s-grammars and proved that the equivalence problem is solvable for these grammars. The method they give is a simple one to use and elegantly expresses the proof of the equivalence of two s-grammars. The method is called the KH algorithm. The basic terminology necessary to introduce the KH algorithm is given in Section 1. In Section 2 the KHC algorithm is introduced which enables a counter-example to a conjecture of Hopcroft [3] to be demonstrated. This shows that the B-transformation is necessary in the KH algorithm even if left and right cancellations are allowed. Finally, in Section 3 the KHS algorithm is given which includes both B z-and Br-transformations and is, thel~fore, a symmetric algorithm. The KHS algorithm applies the B z-and Br-transformations as early as possible, thus giving a faster algorithm, both practically and formally. The algorithms are illustrated by applying them to a single example grammar from KH.Recently, Butzbach [1] has reported a completely different method of solving the equivalence problem.
Section 1. Notation and Basic results.We use O to denote the empty set. A grammar G is a 4-tuple G =