-
Notifications
You must be signed in to change notification settings - Fork 15
Widen
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.
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.
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+)
- Widen is a part of XBGF