What happened was—I ran into too many parses situation [1], tried to sort/reject parses by setting ranks in the grammar, failed and ended up fixing the grammar (by going from sequences to recursion) so that the number of parses reduced greatly and the first parse produced by Marpa was just right—but I thought I need to share my probably naive experience so here goes.
When setting ranks for my rules I felt the need for the method like show_choice_points [2] to be able to see which rules form alternatives and set their ranks accordingly. YAGNI might well apply, but still.
I understand that the rule ranks do not add up when a parse tree is being evaluated—the rank of a parse tree node (alternative) at a choice point equals the rank of its rule, rather than the sum of the children nodes' ranks—am I right? I understand that descending order of parse tree evaluation speaks against such an addition but just in case.
Another general (and rather naive, methinks—my background in grammars and parsing is sparse so excuse is in order) question: if parse trees can contain alternatives then what is the difference among multiple parse trees? I mean how alternatives (choice points) are distributed among multiple parse trees?
Thanks in advance.
[1] I parsed sequences of nouns (N) modified by adjectives (A) modified by adverbs (adv), e.g. "adv, adv and adv A, adv, and adv A N, A, A N, and A N".
[2]
When ranking, the logic descends the parse trees top-down and left-to-right. Places where there is more than one alternative are called choice points.