From latin grammar to Prolog programming: a comparison of two worlds