A scheme for compiling GHC to prolog using freeze

Fredrik Holmgren, Annika Wærn · KTH Publication Database DiVA (KTH Royal Institute of Technology) · 1987

By using the metapredicate freeze, object-oriented programming and process simulation can, for several problems, be done directly in Prolog; although, this is a tiresome and untidy chore. Committed choice languages, on the other hand, provide an elegant syntax for these types of programs. A scheme is given for compiling Guarded Horn Clauses into sequential Prolog, using Prolog's own scheduling principle. Synchronization is implemented using freeze, thereby avoiding busy wait. This proves that Prolog, including freeze, gives enough strength to cover a wide range of object-oriented programming problems, without redefining unification or defining a non-depth-first execution system on top of Prolog. The report presents two versions of the idea: one for flat GHC and one for full GHC. For the flat GHC version, a compiler has been developed and found to give satsfactory behavior.

Read the paper · More papers on PaperTik