finish draft of term_to_cert

it needs to do more to simplify the generated assumptions