Logic and Functional Programmin on Distributed Memory Architectures