Added Prolog implemenation.