Prolog language is difficult to be compiled on the traditional computer architectures. WAM (Warren Abstract Machine) [War93] is the standard method of Prolog compilation on the traditional computer architectures. Most implementations of WAM compiler either emulate WAM code or translate WAM code to machine code directly. To compromise efficiency and portability of these two methods, a WAM to C compiler is proposed.[Cod95] But this compiler uses little Prolog optimization technique. One of the Prolog optimizing technique is shallow backtracking optimization. [War77] Two different implementaion methods of shallow backtracking optimization on WAM are proposed. [Mei87, Car89]
In this paper, each of two methods is implemented on the WAM to C compiler. Impact of shallow backtracking optimization on WAM to C compiler is analysed, and the performance of two methods are compared.