Approximate model counting, sparse XOR constraints and minimum distance