prolog program that calculate uniform cost search