hw4 prolog finished