Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory in grammar bounding #3

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 1 comment
Open

Out of memory in grammar bounding #3

GoogleCodeExporter opened this issue Mar 13, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

This should go through really fast because all sizes are fixed. Instead, it
blows up.

var string:75;
cfg q2 := \104 \116 \116 \112 \058 \047 \047 \057 \056;
cfg q3 := \046;
cfg q4 := \049 \051 \048;
cfg q5 := \046;
cfg q6 := \050 \052 \057;
cfg q7 := \046;
cfg q8 := \053 \055 \047 \098 \050 \101 \118 \111 \108 \117 \116 \105  
\111 \110 \047 \097 \100 \109 \105 \110;
cfg q9 := \046;
cfg q10 := \112 \104 \112;
cfg q11 := \063;
cfg q12 := \099 \116 \114 \108 \061 \105 \116 \101 \109 \115 \038  
\102 \105 \108 \116 \101 \114 \061 \114 \101 \115 \116 \111 \114 \101  
\038 \098 \108 \111 \103 \061 \049;
cfg q1 := q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12;
cfg flax0 := q1;

assert string in flax0; 

Original issue reported on code.google.com by [email protected] on 3 Feb 2010 at 6:19

@GoogleCodeExporter
Copy link
Author

The problem is in GrammarStringBounder.lowerBounds.
For safety and simplicity it assumes that lower bound on any nonterminal is 0 
or 1.
This bound can be dramatically improved if we checked what the nonterminal 
expands to
and, if it expands to a constant string, then use the length of that string as 
both
the lower and the upper bound. More aggresively, we could check if the all 
strings
generated from the nonterminal are of constant size (or maybe there's just one 
string
genenerated).   

Original comment by [email protected] on 26 Feb 2010 at 8:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant