try invariant pretty printing; flatten syntactic; fix stmt
minor tweaks to printer and defn.procedure