On Compiling PROLOG Programs on Demand-driven Architectures