Added an utility function to print the term ast