Skip to content
grammarware edited this page Jan 19, 2013 · 5 revisions

The grammar is rewritten by local transformations such that the language generated by the grammar (or the denotation according to any other semantics for that matter) is increased. The known rewriting rules affect the use of epsilon and regular expression operators. There are two expression arguments: one to be matched, and another one that replaces the matched expression. The scope of the transformation can be limited.

Syntax

widen:
        expression expression in::scope?

The widening relation is defined as follows:

![widen-equality](https://github.com/grammarware/slps/raw/master/topics/documents/wiki/widen.png)

It is trivial to prove that for each case the expression on the left is included in the expression on the right, but not otherwise. For going the other way narrow transformation is used. For shaping an expression into a completely equivalent one, use massage.

Example

Given the input:

[main] program:
        fun::function

After using this transformation:

widen(
 function,
 function+
 in [main]);

The result will look like this:

[main] program:
        fun::(function+)

Relevant files

See also

  • Widen is a part of XBGF

Contributors

Clone this wiki locally