Chomsky Hierarchy and P vs NP










1












$begingroup$


I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular languages belong in P class and the rest (more complex) languages of chomsky hierarchy are in the NP class. Can someone answer and provide some kind of proof for the answer? Thanks in advance.










share|cite|improve this question









$endgroup$











  • $begingroup$
    I think this might be related to your query.
    $endgroup$
    – Gokul
    Aug 25 '18 at 11:24










  • $begingroup$
    @Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
    $endgroup$
    – Maverick98
    Aug 25 '18 at 11:29










  • $begingroup$
    Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
    $endgroup$
    – reinierpost
    Aug 25 '18 at 14:41















1












$begingroup$


I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular languages belong in P class and the rest (more complex) languages of chomsky hierarchy are in the NP class. Can someone answer and provide some kind of proof for the answer? Thanks in advance.










share|cite|improve this question









$endgroup$











  • $begingroup$
    I think this might be related to your query.
    $endgroup$
    – Gokul
    Aug 25 '18 at 11:24










  • $begingroup$
    @Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
    $endgroup$
    – Maverick98
    Aug 25 '18 at 11:29










  • $begingroup$
    Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
    $endgroup$
    – reinierpost
    Aug 25 '18 at 14:41













1












1








1





$begingroup$


I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular languages belong in P class and the rest (more complex) languages of chomsky hierarchy are in the NP class. Can someone answer and provide some kind of proof for the answer? Thanks in advance.










share|cite|improve this question









$endgroup$




I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular languages belong in P class and the rest (more complex) languages of chomsky hierarchy are in the NP class. Can someone answer and provide some kind of proof for the answer? Thanks in advance.







complexity-theory p-vs-np chomsky-hierarchy






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Aug 25 '18 at 11:14









Maverick98Maverick98

82




82











  • $begingroup$
    I think this might be related to your query.
    $endgroup$
    – Gokul
    Aug 25 '18 at 11:24










  • $begingroup$
    @Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
    $endgroup$
    – Maverick98
    Aug 25 '18 at 11:29










  • $begingroup$
    Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
    $endgroup$
    – reinierpost
    Aug 25 '18 at 14:41
















  • $begingroup$
    I think this might be related to your query.
    $endgroup$
    – Gokul
    Aug 25 '18 at 11:24










  • $begingroup$
    @Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
    $endgroup$
    – Maverick98
    Aug 25 '18 at 11:29










  • $begingroup$
    Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
    $endgroup$
    – reinierpost
    Aug 25 '18 at 14:41















$begingroup$
I think this might be related to your query.
$endgroup$
– Gokul
Aug 25 '18 at 11:24




$begingroup$
I think this might be related to your query.
$endgroup$
– Gokul
Aug 25 '18 at 11:24












$begingroup$
@Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
$endgroup$
– Maverick98
Aug 25 '18 at 11:29




$begingroup$
@Gokul I was recommended that question when I posted mine , but I can't actually understand what the answer is when they speak of decidable languages. What I get is that to form regular languages and context-free languages are P class problems , but there are some exceptions??
$endgroup$
– Maverick98
Aug 25 '18 at 11:29












$begingroup$
Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
$endgroup$
– reinierpost
Aug 25 '18 at 14:41




$begingroup$
Where do you see any room for exceptions? The parsing algorithms that decide membership are completely general.
$endgroup$
– reinierpost
Aug 25 '18 at 14:41










1 Answer
1






active

oldest

votes


















5












$begingroup$

Regular languages



Regular languages are in $mathbfP$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time.



Context-free languages



In fact, any context-free language is in $mathbfP$: Valiant showed in the 1970s that context-free grammars in Chomsky normal form can be parsed in time $O(n^3)$ [1]. $mathbfP$ strictly includes the set of context-free languages, since $a^nb^nc^nd^nmid ngeq 0$ is not context-free but is clearly in $mathbfP$.



Context-sensitive languages



Context-sensitive languages can be parsed in nondeterministic linear space [2]. We don't know the exact relationship between this class and $mathbfNP$ but, since a linear space Turing machine can use exponential time, probably there are context-sensitive languages that aren't in $mathbfNP$. However, showing this would be a major advance in complexity theory as it would imply that $mathbfNPneqmathbfPSPACE$.



The problem of "Here's a context-sensitive grammar $G$ and a string $w$: is $win L(G)$" is $mathbfPSPACE$-complete [2], so certainly every problem in $mathbfNP$ can be reduced to the parsing problem for context-sensitive gramars. However, that's not the same thing as saying that every language in $mathbfNP$ is defined by a context-sensitive grammar, since the $mathbfPSPACE$-completeness result allows arbitrary polynomial-time computation in the reduction and also allows the grammar to depend on the instance. Hopefully, somebody can post a comment or answer clarifying this.



Unrestricted grammars



Unrestricted grammars define all recursively-enumerable languages. This includes all of $mathbfNP$ and includes undecidable languages such as the halting problem, which definitely aren't in $mathbfNP$.




References



[1] L. G. Valiant, General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10(2):308–315, 1974.



[2] Context-sensitive language, Wikipedia.






share|cite|improve this answer









$endgroup$












    Your Answer





    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "419"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96606%2fchomsky-hierarchy-and-p-vs-np%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5












    $begingroup$

    Regular languages



    Regular languages are in $mathbfP$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time.



    Context-free languages



    In fact, any context-free language is in $mathbfP$: Valiant showed in the 1970s that context-free grammars in Chomsky normal form can be parsed in time $O(n^3)$ [1]. $mathbfP$ strictly includes the set of context-free languages, since $a^nb^nc^nd^nmid ngeq 0$ is not context-free but is clearly in $mathbfP$.



    Context-sensitive languages



    Context-sensitive languages can be parsed in nondeterministic linear space [2]. We don't know the exact relationship between this class and $mathbfNP$ but, since a linear space Turing machine can use exponential time, probably there are context-sensitive languages that aren't in $mathbfNP$. However, showing this would be a major advance in complexity theory as it would imply that $mathbfNPneqmathbfPSPACE$.



    The problem of "Here's a context-sensitive grammar $G$ and a string $w$: is $win L(G)$" is $mathbfPSPACE$-complete [2], so certainly every problem in $mathbfNP$ can be reduced to the parsing problem for context-sensitive gramars. However, that's not the same thing as saying that every language in $mathbfNP$ is defined by a context-sensitive grammar, since the $mathbfPSPACE$-completeness result allows arbitrary polynomial-time computation in the reduction and also allows the grammar to depend on the instance. Hopefully, somebody can post a comment or answer clarifying this.



    Unrestricted grammars



    Unrestricted grammars define all recursively-enumerable languages. This includes all of $mathbfNP$ and includes undecidable languages such as the halting problem, which definitely aren't in $mathbfNP$.




    References



    [1] L. G. Valiant, General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10(2):308–315, 1974.



    [2] Context-sensitive language, Wikipedia.






    share|cite|improve this answer









    $endgroup$

















      5












      $begingroup$

      Regular languages



      Regular languages are in $mathbfP$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time.



      Context-free languages



      In fact, any context-free language is in $mathbfP$: Valiant showed in the 1970s that context-free grammars in Chomsky normal form can be parsed in time $O(n^3)$ [1]. $mathbfP$ strictly includes the set of context-free languages, since $a^nb^nc^nd^nmid ngeq 0$ is not context-free but is clearly in $mathbfP$.



      Context-sensitive languages



      Context-sensitive languages can be parsed in nondeterministic linear space [2]. We don't know the exact relationship between this class and $mathbfNP$ but, since a linear space Turing machine can use exponential time, probably there are context-sensitive languages that aren't in $mathbfNP$. However, showing this would be a major advance in complexity theory as it would imply that $mathbfNPneqmathbfPSPACE$.



      The problem of "Here's a context-sensitive grammar $G$ and a string $w$: is $win L(G)$" is $mathbfPSPACE$-complete [2], so certainly every problem in $mathbfNP$ can be reduced to the parsing problem for context-sensitive gramars. However, that's not the same thing as saying that every language in $mathbfNP$ is defined by a context-sensitive grammar, since the $mathbfPSPACE$-completeness result allows arbitrary polynomial-time computation in the reduction and also allows the grammar to depend on the instance. Hopefully, somebody can post a comment or answer clarifying this.



      Unrestricted grammars



      Unrestricted grammars define all recursively-enumerable languages. This includes all of $mathbfNP$ and includes undecidable languages such as the halting problem, which definitely aren't in $mathbfNP$.




      References



      [1] L. G. Valiant, General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10(2):308–315, 1974.



      [2] Context-sensitive language, Wikipedia.






      share|cite|improve this answer









      $endgroup$















        5












        5








        5





        $begingroup$

        Regular languages



        Regular languages are in $mathbfP$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time.



        Context-free languages



        In fact, any context-free language is in $mathbfP$: Valiant showed in the 1970s that context-free grammars in Chomsky normal form can be parsed in time $O(n^3)$ [1]. $mathbfP$ strictly includes the set of context-free languages, since $a^nb^nc^nd^nmid ngeq 0$ is not context-free but is clearly in $mathbfP$.



        Context-sensitive languages



        Context-sensitive languages can be parsed in nondeterministic linear space [2]. We don't know the exact relationship between this class and $mathbfNP$ but, since a linear space Turing machine can use exponential time, probably there are context-sensitive languages that aren't in $mathbfNP$. However, showing this would be a major advance in complexity theory as it would imply that $mathbfNPneqmathbfPSPACE$.



        The problem of "Here's a context-sensitive grammar $G$ and a string $w$: is $win L(G)$" is $mathbfPSPACE$-complete [2], so certainly every problem in $mathbfNP$ can be reduced to the parsing problem for context-sensitive gramars. However, that's not the same thing as saying that every language in $mathbfNP$ is defined by a context-sensitive grammar, since the $mathbfPSPACE$-completeness result allows arbitrary polynomial-time computation in the reduction and also allows the grammar to depend on the instance. Hopefully, somebody can post a comment or answer clarifying this.



        Unrestricted grammars



        Unrestricted grammars define all recursively-enumerable languages. This includes all of $mathbfNP$ and includes undecidable languages such as the halting problem, which definitely aren't in $mathbfNP$.




        References



        [1] L. G. Valiant, General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10(2):308–315, 1974.



        [2] Context-sensitive language, Wikipedia.






        share|cite|improve this answer









        $endgroup$



        Regular languages



        Regular languages are in $mathbfP$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time.



        Context-free languages



        In fact, any context-free language is in $mathbfP$: Valiant showed in the 1970s that context-free grammars in Chomsky normal form can be parsed in time $O(n^3)$ [1]. $mathbfP$ strictly includes the set of context-free languages, since $a^nb^nc^nd^nmid ngeq 0$ is not context-free but is clearly in $mathbfP$.



        Context-sensitive languages



        Context-sensitive languages can be parsed in nondeterministic linear space [2]. We don't know the exact relationship between this class and $mathbfNP$ but, since a linear space Turing machine can use exponential time, probably there are context-sensitive languages that aren't in $mathbfNP$. However, showing this would be a major advance in complexity theory as it would imply that $mathbfNPneqmathbfPSPACE$.



        The problem of "Here's a context-sensitive grammar $G$ and a string $w$: is $win L(G)$" is $mathbfPSPACE$-complete [2], so certainly every problem in $mathbfNP$ can be reduced to the parsing problem for context-sensitive gramars. However, that's not the same thing as saying that every language in $mathbfNP$ is defined by a context-sensitive grammar, since the $mathbfPSPACE$-completeness result allows arbitrary polynomial-time computation in the reduction and also allows the grammar to depend on the instance. Hopefully, somebody can post a comment or answer clarifying this.



        Unrestricted grammars



        Unrestricted grammars define all recursively-enumerable languages. This includes all of $mathbfNP$ and includes undecidable languages such as the halting problem, which definitely aren't in $mathbfNP$.




        References



        [1] L. G. Valiant, General context-free recognition in less than cubic time, Journal of Computer and System Sciences 10(2):308–315, 1974.



        [2] Context-sensitive language, Wikipedia.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Aug 25 '18 at 12:22









        David RicherbyDavid Richerby

        66.3k15101190




        66.3k15101190



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Computer Science Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96606%2fchomsky-hierarchy-and-p-vs-np%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Crossroads (UK TV series)

            ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế