How to guess the end of pushdown automata by emptying the stack?












1












$begingroup$



Let language $L={sigma_1w_1csigma_2w_2c...sigma_nw_nc}$ where:
$$
1le n\
sigma_iin {a,b}\
w_iin {a,b}^+\
exists i:ile|w_i|
$$

and at least one condition from the two conditions below holds:



the first $i$ letters of $w_i$ form a different word from $(sigma_1sigma_2...sigma_i)^R$ OR $|w_i|=n$.



Build a pushdown automaton which receives $L$ by emptying its stack.




The solution of these two conditions separately is here: https://imgur.com/a/T9PiPgT.



As far as I understand in the automata for both condition 1 and condion 2 ($|w_i|=n$) essentially:




  1. We build an automaton which simply describes reading $sigma, w_i, c$ first.

  2. Then we guess the $w_i$ which is according to condition 1 or 2.

  3. Then we read the $sigma, c$ surrounding the guessed $w_i$ and the $w_i$ itself.


I'm new to pushdown automata, but it looks like a lot of automata could be solved in such a generic way:




  1. Read the words according to some logic described in the problem.

  2. guess some "good" word (by using $epsilon$ connection) and delete it from the stack.


Am I missing something?



Also I don't understand why we need $2$ cases in the solution for each condition. The solutions for each condition look almost identical.



Lastly, I don't understand why in the automaton for the condition $1$ in state $q_5$ we need to read the end of $w_i$ first, then read the "good" $w_i$. Why can't we read the "good" $w_i$ straight after the guess?










share|cite|improve this question









$endgroup$

















    1












    $begingroup$



    Let language $L={sigma_1w_1csigma_2w_2c...sigma_nw_nc}$ where:
    $$
    1le n\
    sigma_iin {a,b}\
    w_iin {a,b}^+\
    exists i:ile|w_i|
    $$

    and at least one condition from the two conditions below holds:



    the first $i$ letters of $w_i$ form a different word from $(sigma_1sigma_2...sigma_i)^R$ OR $|w_i|=n$.



    Build a pushdown automaton which receives $L$ by emptying its stack.




    The solution of these two conditions separately is here: https://imgur.com/a/T9PiPgT.



    As far as I understand in the automata for both condition 1 and condion 2 ($|w_i|=n$) essentially:




    1. We build an automaton which simply describes reading $sigma, w_i, c$ first.

    2. Then we guess the $w_i$ which is according to condition 1 or 2.

    3. Then we read the $sigma, c$ surrounding the guessed $w_i$ and the $w_i$ itself.


    I'm new to pushdown automata, but it looks like a lot of automata could be solved in such a generic way:




    1. Read the words according to some logic described in the problem.

    2. guess some "good" word (by using $epsilon$ connection) and delete it from the stack.


    Am I missing something?



    Also I don't understand why we need $2$ cases in the solution for each condition. The solutions for each condition look almost identical.



    Lastly, I don't understand why in the automaton for the condition $1$ in state $q_5$ we need to read the end of $w_i$ first, then read the "good" $w_i$. Why can't we read the "good" $w_i$ straight after the guess?










    share|cite|improve this question









    $endgroup$















      1












      1








      1


      0



      $begingroup$



      Let language $L={sigma_1w_1csigma_2w_2c...sigma_nw_nc}$ where:
      $$
      1le n\
      sigma_iin {a,b}\
      w_iin {a,b}^+\
      exists i:ile|w_i|
      $$

      and at least one condition from the two conditions below holds:



      the first $i$ letters of $w_i$ form a different word from $(sigma_1sigma_2...sigma_i)^R$ OR $|w_i|=n$.



      Build a pushdown automaton which receives $L$ by emptying its stack.




      The solution of these two conditions separately is here: https://imgur.com/a/T9PiPgT.



      As far as I understand in the automata for both condition 1 and condion 2 ($|w_i|=n$) essentially:




      1. We build an automaton which simply describes reading $sigma, w_i, c$ first.

      2. Then we guess the $w_i$ which is according to condition 1 or 2.

      3. Then we read the $sigma, c$ surrounding the guessed $w_i$ and the $w_i$ itself.


      I'm new to pushdown automata, but it looks like a lot of automata could be solved in such a generic way:




      1. Read the words according to some logic described in the problem.

      2. guess some "good" word (by using $epsilon$ connection) and delete it from the stack.


      Am I missing something?



      Also I don't understand why we need $2$ cases in the solution for each condition. The solutions for each condition look almost identical.



      Lastly, I don't understand why in the automaton for the condition $1$ in state $q_5$ we need to read the end of $w_i$ first, then read the "good" $w_i$. Why can't we read the "good" $w_i$ straight after the guess?










      share|cite|improve this question









      $endgroup$





      Let language $L={sigma_1w_1csigma_2w_2c...sigma_nw_nc}$ where:
      $$
      1le n\
      sigma_iin {a,b}\
      w_iin {a,b}^+\
      exists i:ile|w_i|
      $$

      and at least one condition from the two conditions below holds:



      the first $i$ letters of $w_i$ form a different word from $(sigma_1sigma_2...sigma_i)^R$ OR $|w_i|=n$.



      Build a pushdown automaton which receives $L$ by emptying its stack.




      The solution of these two conditions separately is here: https://imgur.com/a/T9PiPgT.



      As far as I understand in the automata for both condition 1 and condion 2 ($|w_i|=n$) essentially:




      1. We build an automaton which simply describes reading $sigma, w_i, c$ first.

      2. Then we guess the $w_i$ which is according to condition 1 or 2.

      3. Then we read the $sigma, c$ surrounding the guessed $w_i$ and the $w_i$ itself.


      I'm new to pushdown automata, but it looks like a lot of automata could be solved in such a generic way:




      1. Read the words according to some logic described in the problem.

      2. guess some "good" word (by using $epsilon$ connection) and delete it from the stack.


      Am I missing something?



      Also I don't understand why we need $2$ cases in the solution for each condition. The solutions for each condition look almost identical.



      Lastly, I don't understand why in the automaton for the condition $1$ in state $q_5$ we need to read the end of $w_i$ first, then read the "good" $w_i$. Why can't we read the "good" $w_i$ straight after the guess?







      proof-explanation formal-languages automata






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 15 '18 at 8:41









      YosYos

      1,1631823




      1,1631823






















          0






          active

          oldest

          votes











          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: "69"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3040276%2fhow-to-guess-the-end-of-pushdown-automata-by-emptying-the-stack%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics 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%2fmath.stackexchange.com%2fquestions%2f3040276%2fhow-to-guess-the-end-of-pushdown-automata-by-emptying-the-stack%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa