# Push down automata for $\{a^n b^n c^n | n \ge 0\}$

I am learning about context free languages.

I understand how $\{a^n b^n c^n | n \ge 0\}$ can be shown to be not context free using the pumping lemma for CFL's.

Intuitively however it seems that a pushdown automata to recognize $\{a^n b^n c^n | n \ge 0\}$ can be constructed. This PDA would initially push two $a$'s into its stack whenever it sees an $a$ in the input. It would change state when it first encounters a $b$ and pop a single $a$. It would continue to pop $a$'s for every b in the input until it encounters a $c$. It would again change state and pop single $a$'s for every c encountered. If the stack is empty at the end of the input the language is recognized as $\{a^n b^n c^n | n \ge 0\}$.

There must be something I am overlooking whilst constructing the PDA as a language is context free if its has a PDA recognizing it. Please point out my mistake.

Your PDA would also accept strings of the form $a^nb^ic^j$ where $i+j=2n$ and $i,j>0$. For example the string "aaabbbbbc" is accepted. There is no way to tell that there are exactly $n$ $a$'s still remaining on the stack once you've finished reading the $b$'s.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9402107,"math_prob":0.9843309,"size":865,"snap":"2020-10-2020-16","text_gpt3_token_len":229,"char_repetition_ratio":0.09756097,"word_repetition_ratio":0.074074075,"special_character_ratio":0.26473987,"punctuation_ratio":0.054054055,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9991822,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-05T18:07:54Z\",\"WARC-Record-ID\":\"<urn:uuid:bb906586-ae04-4dc6-8445-de4764cc88e8>\",\"Content-Length\":\"140601\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f5171428-4b5b-40a0-8c04-83d1e1bb2668>\",\"WARC-Concurrent-To\":\"<urn:uuid:bbc60523-bd12-4e8a-ad0a-1b7253b22812>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://cs.stackexchange.com/questions/8989/push-down-automata-for-an-bn-cn-n-ge-0\",\"WARC-Payload-Digest\":\"sha1:XE35JIMPDCOXGBHU2WW7GIMWYZVNOZNS\",\"WARC-Block-Digest\":\"sha1:LYON32IPL4ZCQA6WDJUSAQYODXUFXO77\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585371606067.71_warc_CC-MAIN-20200405150416-20200405180916-00324.warc.gz\"}"}