tag:blogger.com,1999:blog-11295132.post7669937180420541947..comments2015-05-30T22:32:59.468-07:00Comments on A Neighborhood of Infinity: Beyond Regular Expressions: More Incremental String MatchingDan Piponihttps://plus.google.com/107913314994758123748noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-11295132.post-41846931971593099032013-06-17T05:57:51.092-07:002013-06-17T05:57:51.092-07:00Sigfpe,
I set out to prove you wrong... One can i...Sigfpe,<br /><br />I set out to prove you wrong... One can in fact use a monoid-based technique to parse context free languages. In fact the algorithm has been published in 75 by Valiant! It was a bit of work to set up things correctly so it would behave well though. A full write up will appear in ICFP:<br /><br />http://www.cse.chalmers.se/~bernardy/PP.pdfJean-Philippe Bernardyhttp://www.blogger.com/profile/09574587903886283067noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-43055201293849848772013-06-17T05:57:13.334-07:002013-06-17T05:57:13.334-07:00Sigfpe,
I set out to prove you wrong... One can i...Sigfpe,<br /><br />I set out to prove you wrong... One can in fact use a monoid-based technique to parse context free languages. In fact the algorithm has been published in 75 by Valiant! It was a bit of work to set up things correctly so it would behave well though. A full write up will appear in ICFP:<br /><br />http://www.cse.chalmers.se/~bernardy/PP.pdfJean-Philippe Bernardyhttp://www.blogger.com/profile/09574587903886283067noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-69709301651128443842009-12-22T10:34:24.853-08:002009-12-22T10:34:24.853-08:00Wei Hu,
To make this idea work requires that the ...Wei Hu,<br /><br />To make this idea work requires that the internal state of a parser be simple enough. I guess you could roughly characterise it like this: consider the set of possible transitions the parser could make from one state to another as a result of reading n characters. We need this set to grow slowly with n. For finite state machines it remains at finite size. For the example shown in this article it grows roughly as log(n) (the number of bits needed to represent an integer n). But for a LALR parser, say, I think the size of this set grows fast with n, and so it couldn't be implemented reasonably.<br /><br />So it's good enough for incrementally lexing a language like C++ or Haskell. But not for parsing it.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-72911597370767009572009-12-22T00:03:37.001-08:002009-12-22T00:03:37.001-08:00You showed one particular example beyond regular e...You showed one particular example beyond regular expression matching. Will it generalize to any context-free language?Wei Huhttp://www.blogger.com/profile/13683552196436356037noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-57606562721183034322009-02-02T23:49:00.000-08:002009-02-02T23:49:00.000-08:00I know this is a bit off subject but I am a gradua...I know this is a bit off subject but I am a graduate student at UNLV as well as a weekly math based podcast called <A HREF="http://combinationsandpermutations.blogspot.com" REL="nofollow">Combinations and Permutations</A> where we start with a mathematical topic and spin off onto as many tangents as we can. You can follow the previous link to the blog page of our podcast, search for us on iTunes, or take a trip over to our host site <A HREF="http://cppodcast.libsyn.com" REL="nofollow">http://cppodcast.libsyn.com</A>. Give us a try I do think that you will enjoy what you hear.Combinations and Permutations Podcasthttp://www.blogger.com/profile/08728258635437788711noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-38564712941008277572009-01-31T19:14:00.000-08:002009-01-31T19:14:00.000-08:00jag,You're right about the second point. I wrote t...jag,<BR/><BR/>You're right about the second point. I wrote the code a few days before the commentary!sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-81094013856237199912009-01-31T19:13:00.000-08:002009-01-31T19:13:00.000-08:00jag,On your first point:max b c+min b c = b+cjag,<BR/><BR/>On your first point:<BR/><BR/>max b c+min b c = b+csigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-23655140070026021892009-01-31T18:53:00.000-08:002009-01-31T18:53:00.000-08:00While I can see that it works, I don't quite see w...While I can see that it works, I don't quite see where the max comes from in "B (a-b+max b c) (d-c+max b c)". My attempt at it was "B (a+c-min b c) (b+d-min b c)", basically take the total ')'s and total '('s and subtract the b,c pairs.<BR/><BR/>Also, I'm a bit confused by "we only need to test whether or not p=q" (which would suggest that ")(" is balanced) but then in the code you test whether both p and q are 0 (which is what I expected the test to be).jagnoreply@blogger.com