diff --git a/cfg_utils.py b/cfg_utils.py index 6856ecb3c4ad6a5d04db977cead867860692dae0..7d18eb4f94d5722ae849567ca0b8a626da87e1b7 100644 --- a/cfg_utils.py +++ b/cfg_utils.py @@ -463,8 +463,18 @@ class CFGBoltzmann: return [sum] else: - # CASE D (the full convolution) - + # CASE D + # Here we must do the full convolution to account for every + # possible way that the total length of the desired string can + # be split between the nonterminal at X_ijk and the remaining + # segment of the rule (from k+1 to the end of the rule) + + # Here, L will be the number of characters produced by X_ijk + # L will therefore go from 1 (we disallow epsilon-productions so + # X_ijk must produce at least one character) to: + # Total Characters Requested - (minimum number of characters generated by k+1 to end of rule) + # which will be: + # return 0