rewrite stlc by context