we should end up with this: "<,>" "," cm "<and>" "and" conj "<X>" "X" num pl "X" noun prop "<was>" "be" verb past p3 sg "<like>" "like" subj "<“>" "“" lquot If we used --trace, we would see the removed readings with an initial ;, and the name and line number of the rule wherever it applied to a reading. The rule syntax for adding syntactic function labels follows a similar scheme of "do this if x, y and z": LIST nominal = noun prn ; ADD (@SUBJ) IF (NEGATE *-1 nominal) (0C (prop)) (1C finiteverb) ; This is called a "mapping rule", and we may end up with multiple such mapping tags per cohort, in which case we can disambiguate using the same SELECT/REMOVE rules. Implementations CG-1 The first CG implementation was CGP by Fred Karlsson in the early 1990s. It was purely LISP-based, and the syntax was based on LISP s-expressions (Karlsson 1990). CG-2 Pasi Tapanainen's CG-2 implementation mdis removed some of the parentheses in the grammar format and was implemented in C++, interpreting the grammar as a Finite State Transducer for speed. CG-2 was later reimplemented (with a non-FST method) by the VISL group at Syddansk Universitet as the open source VISL CG , keeping the same format as Tapanainen's closed-source mdis. CG-3 The VISL project later turned into VISL CG-3, which brought further changes and additions to the grammar format, e.g.: full Unicode support through International Components for Unicode different interpretation of negation (NOT) named relations in addition to plain dependency relations variable-setting full regex matching tag/set unification – LIST gen = m f; SELECT (det) + $$gen IF (1 noun) (1 $$gen); will select the determiner that has the same gender as the following noun wrappers for reading/writing Apertium and HFST formats support for subreadings (where one reading has several "parts", used for multi-word expressions and compounds) scanning past point of origin or even window boundaries use as a library and support for integration with external processes There is also simple IDE for CG-3 developed by VISL, which provides syntax highlighting and lets you see input and output and possible errors as you write your grammar. There is also an Emacs mode cg.el with similar features and simple code-navigation. Unlike the Tapanainen implementation, the VISL implementations do not use finite state transducers. Rules are ordered within sections, which gives more predictability when writing grammars, but