Thom's Logoi in Metagrammatical Representations