Prolog practice using royal family tree