Grew main page

Filter rules

In a module definition, it may be useful to filter out some output graphs to keep only the subset of normal forms which verify some linguistics properties. To do this, we extend the syntax of GREW modules with a new kind of element introduced by the keyword filter.

The syntax of a filter element is the same as the rule syntax without the command part.

For instance, if a module M contains the code below, an M-normal form which contains an “a” label is removed (unless it contains a “b” label with the same source and the same target than “a” edge).

  filter ex_filt {
    match {
      X [];
      Y [];
      X -[a]-> Y;
    without {
      X -[b]-> Y;