Minimal Boolean sum-of-product forms in prolog