#!/usr/bin/perl -i while (<>) { /:extrafuns.*DIST_ZERO/ and next; s/\(and (\(= \S+ \(\+ DIST_ZERO_\d+ \d+\)\))/(distinct $1/g; s/\(= (\S+) \(\+ DIST_ZERO_\d+ \d+\)\)/$1/g; print; }