Optimized python implementation of stepfit and all-pairs boolean implication.