A Prolog Program for Contraction