7. "True"
Bol Processor grammars and parsing
"True"
BP grammars are transformational grammars allowing the production and
parsing
of strings representing musical sequences. The formalism of true grammars
is the one implemented in Bol Processor BP1
(Bel 1990b:33-66) for the study of drum improvisation, plus "remote contexts"
(§4.12 supra).
A
grammar successfully compiled by BP2 is a
true
BP grammar
only if using
neither
of the following features:
- Erasing
rules;
- Polymetric
expressions
(§4.10) and associated features;
- Substitutions
SUB and SUB1 (§4.14);
- Programmed
grammars
(flags) (Quickstart §11);
- Destroying
structures
(§4.5);
- Production
procedures
in rules (§8.1);
- Dynamic
weight assignment
(§4.6) or weights controlled interactively (QuickStart §6);
- Metagrammars
(§4.13);
When
compiling a grammar, BP2 checks whether or not it is a true BP grammar.
Nothing will happen at the time items are produced, but BP2 will refuse to
analyse (parse) items if the current grammar is not "true BP".
A
true BP grammar
may be used to perform a
membership
test
on arbitrary strings in order to check whether or not it might have been
produced by the grammar. However, there are limitations for the validity of
this test. These limitations are discussed in great detail in (Kippen &
Bel 1992). (Also see Bel & Kippen 1992). Note for instance that the
rewrite symbol "-->" is improper in BP grammars and should be replaced with
"<-->" meaning that the rule is valid for both production and analysis.
Thus, symbols
"-->"
and "<--" indicate that a rule is used exclusively in production or
analysis, respectively. Other restrictions of BP grammars deal with the order
of rules in each subgrammar. The parsing algorithm takes rules in the opposite
order of their occurrence in the subgrammar. Therefore, the last candidate
rule in each subgrammar is the one that will first be used repeatedly (until it
is no more candidate). As a consequence, its right argument should not be a
substring of the right argument of a rule
appearing higher in the subgrammar. (This is called the
chunk
rule,
informally:
large
patterns are recognised first.
) To
activate parsing,
first generate templates ("Action" menu) and then select an item or a set of
items in any text window. Select "Analyze" in the "Action" menu (or type
cmd-j). BP2 will parse all items and return the resulting strings, whenever
unsuccessful, in the "Trace" window.
If
parsing was unsuccessful it may be important to see at what stage of the
analysis an incorrect workstring was produced. Use "Step by step" and restart
the analysis on this particular item. The "Repeat computation" button is
inactive because parsing is deterministic.