Generators for terms with sharing