In this thesis, an optimizing Prolog compiler is designed and implemented for high-speed execution of Prolog programs. Using the information of mode inference an determinacy check, the compiler generates efficient code based on WAM.
After the parse tree is constructed, the mode inference is performed by traversing the parse tree. Based on the infered modes, the determinacy of each clause in he procedure is checked. The choice-points which cause unnecessary backtracking in deterministc clauses are removed by inserting cut code. In addition, an optimal argument selection is employed to improve the indexing mechanism of WAM.
The performance of the generated code is compared with the PLM-I's, which is a slight modified version of PLM. In case deterministic program, only memory reference is reduced. In case nondeterministic program, the generated code is prominently reduced in fail occurence.