anchor.diff:      | STRING COLON cterm                                 /* match named property value / construct    */
       ;
   
  -/*  Sort declaration */
  -
  -csortparams
  -    : FORALL cvariable+ DOT                              /* Sort parameters. */
  +cterms
  +    : cterm (COMMA cterm)*                               /* Term list */
       ;
  -
  -csortset
  -    : LPAR csortkv* RPAR
  -    ;
  -
  -csortkv
  -    : constructor COLON cterm
  -    ;
  -
  -csortnames
  -    : csortname (COMMA csortname)*
  -    ;
  -
  -csortname
  -    : cconstructor csortargs?                            /* Concrete sort reference */
  -    | cvariable                                          /* Sort variable */
  -    ;
  -
  -csortargs
  -    : LSQUARE csortnames RSQUARE                         /*  */
  -    ;
  -
  -cforms
  -    : (cform SEMI)*
  -    ;
  -
  -cform
  -    : cconstructor csargs?
  -    | cvariable
  -    ;
  -
  +    
   cconstructor
       : CONSTRUCTOR
       | COLON
  
positive.code: // Lexer rules
  
  DATA            : 'data';
  FUNCTION        : 'fn';
  RULE            : 'rule';
  DISPATCH        : 'dispatch';
  
  COLON           : ':';
  ARROW           : '→';
  FORALL          : '∀';
  LPAR            : '(';
  RPAR            : ')';
  LSQUARE         : '[';
  RSQUARE         : ']';
  SEMI            : ';';
  COMMA           : ',';
  DATASORT        : '::=';
  COLONCOLON      : '::';
  DOT             : '.';
  NOT             : '¬';
  LINEAR          : '¹';
  FUNCTIONVAR     : 'ᵇ';
  DATAVAR         : 'ᵇ';
  
  CONSTRUCTOR     : StartConstructorChar ConstructorChar* Ebnf?; // '$' is for internal use only.
  
  VARIABLE        : Lower (Lower | Digit | '-' | '_')*;
  
  METAVAR         : '#' (Alpha | Digit | Other | Unicode)* Ebnf? Digit*; // '$' is for internal use only
  
  STRING          :  '"' ('\\"'|~'"')* '"';
  
  NUMBER          : Decimal;
  
  fragment StartConstructorChar : Upper | Other | [\u00C0-\u00DE] | '\u0100' | '\u0102' | '\u0104' | '\u0106'; // TODO: all upper cases
  fragment ConstructorChar      : Alpha | Digit | Other | Unicode;
  
  fragment Digit   : [0-9];
  fragment Upper   : [A-Z];
  fragment Lower   : [a-z];
  fragment Alpha   : [a-zA-Z];
  fragment Decimal : '-'? [0-9]+ ('.' [0-9]+)? | '.' [0-9]+;
  fragment Other   : '-' | '$' | '_'; // TODO: remove '-'
  fragment Unicode : ~[\u0000-\u00FF\uD800-\uDBFF] | [\uD800-\uDBFF] [\uDC00-\uDFFF];
  fragment Ebnf    : '*' | '?' | '+';
  
  WS               : [ \t\r\n\f]+ -> channel(HIDDEN) ;
  
  BLOCK_COMMENT    : '/*' .*? ('*/' | EOF)    -> channel(HIDDEN);
  
negative.code:     | NUMBER                                             /* Number literal */
      ;
  
  cvariable
      : VARIABLE<symbol> FUNCTIONAL? csortas?              /* Variable occurrence */
      ;
  
  csortas
      : AS csort                                           /* Sort annotation */
      ;
  
  ckv
  