Computer generation of Feynman diagrams for perturbation theory. II. Program description