A ruby implementation to simulate prolog partially