shminux comments on Types of recursion - Less Wrong

16 Post author: AnthonyC 04 September 2013 05:48PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (16)

You are viewing a single comment's thread.

Comment author: shminux 04 September 2013 06:24:24PM 12 points [-]

Just a guess: you need more working memory and more complicated processing to parse the second case -- try writing a parser for each!

In the first form (which is like RPN) it's push-on-stack all the way through until the first verb to construct a complete determiner. In the second form you have to first push all the nouns on stack, then keep popping the stack up for each verb to match with the corresponding noun to construct the determiner. Except that the last verb corresponding to the first noun is not a part of the determiner, so you have to check that.

TL;DR: RPN expressions and parsers are simpler than the alternatives.

Comment author: iDante 04 September 2013 11:40:34PM *  4 points [-]

The first is head recursive. If it were written in opposite order (in NY, on the street, at the house, the car ...) it would be tail recursive and would be very easy to parse. Once we've found NY we can forget that we're there and reuse our stack space to find the street, etc. I think this is why it's so much easier than the second, which is neither head nor tail recursive and so requires a stack frame for each level.

Comment author: Creutzer 04 September 2013 07:34:31PM 2 points [-]

I don't understand the sense in which you're using the word determiner here. It's not how linguists use the word, because for them, the determiner is just the; it's not constructed. It's also not a sense that's explained in the Wikipedia article you linked to.

Comment author: shminux 04 September 2013 08:07:53PM 1 point [-]

Sorry, wrong term, I meant a modifier... It's been years since I looked into the basics of English grammar...

Comment author: AnthonyC 04 September 2013 06:50:14PM 2 points [-]

Interesting. So in the first case, at each stage we have a completed phrase which my brain can regard as a single unit, whereas reading the second case from left to right I don't have a grammatically correct phrase until the very end. Cool. This seems plausible. I wonder how I should go about testing it.

Comment author: sketerpot 04 September 2013 07:10:01PM 1 point [-]

Formally, I believe the first form can be produced by a regular grammar, but the second form can not. Check out the Chomsky hierarchy for a rundown on the power of each type of grammar.

Comment author: Creutzer 04 September 2013 07:32:42PM *  0 points [-]

Natural language is full of constructions that can't be produced by a regular grammar, but which nobody has any trouble parsing. So that can hardly be the issue.