leaps 算法 rule engine algorithm