Combining Prolog Logic