• Breaking News

    Saturday, February 2, 2019

    Terminology for Parsing and How to Improve It Computer Science

    Terminology for Parsing and How to Improve It Computer Science


    Terminology for Parsing and How to Improve It

    Posted: 01 Feb 2019 02:30 PM PST

    I'll soon be covering parsing in my every-spring class on Programming Languages. And, as usual, I'm started to get annoyed.

    The problem is the terminology used for the theory and practice of parsing. It's a mess.

    To give an example: what is an LR parser?

    1. A parser that can handle an arbitrary LR grammar.

    2. A parser that reads its input left-to-right and goes through the steps necessary to produce a rightmost derivation.

    3. A parser that uses the method published by Knuth in 1965, involving a state machine with a stack, whose basic operations are Shift and Reduce.

    I've seen all three in the literature. I've seen an author define the term in one of the above ways, and use it in another. Want to have a fun afternoon? Read the Wikipedia "LR parser" article and try to figure out which of the three is intended.[1]

    And other terms can be similarly problematic.

    Has there been any serious attempt to come up with a standardized terminology for parsing that is consistent with itself, unambiguous, reasonably consistent with existing literature, and not confusing? If so, could anyone point me at it?


    [1] EDIT. Almost certainly more than one of the three is intended, as the article would have been written by multiple authors, each of whom thought, "Everyone out there thinks exactly like me." Alas, they were all wrong.

    submitted by /u/ggchappell
    [link] [comments]

    Collatz conjecture using recurrent regular expressions in sed one-liner

    Posted: 01 Feb 2019 07:09 AM PST

    The Collatz sequence can be calculated using recurrent regular expressions. This sed one-liner prints the sequence starting from the number 27:

    echo | sed -r ':b s/^(.*)$/a\1/;/^a{27}$/ta; bb; :a s/^a.(.*)$/\1bc/;s/^b.(.*)$/\1a/;s/^c.(.*)$/\1aaa/;/^a$/q; /^a*$/p; ba' | sed -n ':c /a/! be; s/^a/1/; s/0a/1/; s/1a/2/; s/2a/3/; s/3a/4/; s/4a/5/; s/5a/6/; s/6a/7/; s/7a/8/; s/8a/9/; s/9a/a0/; /a/ bc; :e p'

    The initial echo starts the processing (otherwise, the sed would wait to press the enter). Most of the code only calculates the string length. So using AWK this can be written more concisely:

    echo | sed -r ':b s/^(.*)$/a\1/;/^a{27}$/ta; bb; :a s/^a.(.*)$/\1bc/;s/^b.(.*)$/\1a/;s/^c.(.*)$/\1aaa/;/^a$/q; /^a*$/p; ba' | awk '{print length}'

    submitted by /u/lord_dabler
    [link] [comments]

    How does transforming sound into electricity and back into sound work

    Posted: 02 Feb 2019 02:22 AM PST

    I am not sure, if this is the right place to ask it, but how exactly is sound converted into electricity in headphones. The way I understand it there can be converted only height of tones and not actual words.

    Can someone explane that to me?

    submitted by /u/83433121
    [link] [comments]

    Automata theory and computation: other books?

    Posted: 01 Feb 2019 08:56 PM PST

    Sipser is good but I wish it was more illustrated or had more examples. It tells but does not show all that well. Are there any books that solve problems as examples?

    submitted by /u/smellslikekeenspirit
    [link] [comments]

    U Wisconsin Madison CS program reputation? Is it worth going there as an out of state student?

    Posted: 01 Feb 2019 05:11 PM PST

    I'm a high school senior. Currently I have two choices: UW Madison and my state school, whose CS major is ranked 20-30 places lower than Madison according to us news and csranking .

    Would the better education and opportunity at Madison outweigh its out of state cost?

    Additionally, how's the economy and employment opportunity for CS in the Midwest?

    Edit: state school is Texas a&m cs

    submitted by /u/sunr117
    [link] [comments]

    Why is CS not an engineering degree?

    Posted: 01 Feb 2019 08:10 AM PST

    No comments:

    Post a Comment