prolog final