User loginNavigation |
archivesHuman language and machine languageI am reading The language instinct from Steven Pinker. Some of the examples he has are very familiar to compiler construction. Shift/Reduce conflictis a conflict in LALR grammars (most programming languages) where in the parser has to decide between shifting a new token for a rule or reducing the rule. Quoting Stephen C. Johnson from the YACC paper As an example of the power of disambiguating rules, consider a fragment from a programming language involving an ``if-then-else'' construction:That is during a shift/reduce conflict, LALR parsers chose shift over reduce, implying that clauses are always associated with the innermost clause.stat : IF '(' cond ')' stat | IF '(' cond ')' stat ELSE stat ; On the human side of the equation, Steven Pinker talks about Chomsky's classic illustration of turning a declarative sentence into a question A unicorn is in the garden -> Is a unicorn in the garden? This is done by taking the auxiliary "is" and moving it. However, this is not a simple move as illustrated in the below case A unicorn that is eating a flower is in the garden -> Is a unicorn that is eating a flower in the garden? Chomsky argues that our mental algorithm does not pick words by their linear positions, but does so by grouping it into phrases, implying that during a conflict the mind chooses entire units together. Does this mean that the designers of LALR were goaded by their mintal algorithm to chose shift instead of reduce? Or does this mean that language is an algorithm (albeit more powerful than any parser) that is wired into our brain - and evolution chose shift over reduce because that is the easier one to implement? Also at here By kusimari at 2009-07-18 03:39 | LtU Forum | login or register to post comments | other blogs | 5352 reads
Munkres' TopologyNot really the PL-applicable sort of topology, but I think it will be interest to a fair few folks here: there's a PDF scan of James Munkres (2000) Topology available. Postscript: Not anymore. I guess it was not a legitimate distribution of the text. Postscript #2: Or maybe it does still, for some... |
Browse archivesActive forum topics |
Recent comments
22 weeks 3 days ago
22 weeks 3 days ago
22 weeks 3 days ago
44 weeks 4 days ago
48 weeks 6 days ago
50 weeks 3 days ago
50 weeks 3 days ago
1 year 1 week ago
1 year 5 weeks ago
1 year 5 weeks ago