計算理論 形式語言與自動機_下推式自動機(PDA)| 計算理論

計算理論 形式語言與自動機

Pushdown Automaton (PDA) is a kind of Automaton which comes under the theory of Computation that appoints stack. The word Pushdown stands due to the fact that the stack can be pushed down as operations can only work on the elements which are on the top of the stack. A PDA can store an infinite amount of information. It is used to identify Context-free languages.

下推式自動機(Pushdown Automaton,PDA)是一種基于計算理論的自動機,它指定堆棧。 之所以使用Pushdown一詞,是因為可以將堆棧向下推,因為操作只能在堆棧頂部的元素上進行。 PDA可以存儲無限量的信息。 它用于識別上下文無關的語言。

The following equation will help you to understand Pushdown Automaton (PDA),

以下等式將幫助您了解下推自動機(PDA)

"Pushdown Automation" = "Finite State Machine" + "Stack"

“下推式自動化” =“有限狀態機” +“堆棧”

A finite state machine does not employ any stack and only bothers about the input signal and the current state that does not work in the case of context free grammar. Push Down Automata is different from finite state machine because,

有限狀態機不使用任何堆棧,而只關心輸入信號和當前狀態,這在上下文無關文法的情況下不起作用。 下推自動機與有限狀態機不同,因為,

  1. It uses top of the stack for deciding which transition is to be taken.

    它使用堆棧的頂部來決定要進行的過渡。

  2. While performing the transition, it can handle or manipulate the stack.

    在執行過渡時,它可以處理或操縱堆棧。

Pushdown Automaton (PDA) reads the provided string from left to right direction. The current state, input symbol and the symbol at TOS (Top of the Stack) are being indexed in the table and helps in choosing a transition, this happens at each step. While performing a transition, PDA can manipulate stack in two ways, either it can push a symbol at the top of the stack or can pop out a symbol from the stack.

下推式自動機(PDA)從左到右讀取提供的字符串。 在表中為當前狀態,輸入符號和TOS(堆棧頂部)上的符號建立索引,并有助于選擇過渡,這在每個步驟中都會發生。 在執行轉換時,PDA可以通過兩種方式操縱堆棧,既可以將符號推入堆棧的頂部,也可以從堆棧彈出符號。

Formal definition of PDA,

PDA的正式定義,

PDA can be betokened formally by a 7-tuple (Q, ∑, S, δ, q0, I, F) where,

PDA可以由7個元組(Q,∑,S,δ,q0,I,F)正式標記,其中,

  1. Q is the number of states. It is finite.

    Q是狀態數。 這是有限的。

  2. is an input alphabet. It is a finite set.

    Σ是輸入字母。 這是一個有限集。

  3. S stands for stack symbols.(which can be pushed and popped from the stack).

    S代表堆棧符號(可以從堆棧中壓入和彈出)。

  4. δ is the transition function which is Q × (∑ ∪ {ε}) × S × Q × S*. It is a finite subset.

    δ是轉移函數Q×(∑ε{ε})×S×Q×S * 。 它是一個有限子集。

  5. q0 is the start or initial or beginning state (q0 ∈ Q).

    q0是開始或初始或開始狀態(q0∈Q)

  6. I is the initial stack top symbol (I ∈ S).

    I是初始堆棧頂部符號(I∈S)

  7. F is the set of accepting states (F ∈ Q).

    F是一組接受狀態(F∈Q)

In a specified state, PDA will read the symbol which is at the top of the stack and the input signal and move to a new state after changing the symbol of the stack.

在指定狀態下, PDA將讀取堆棧頂部的符號和輸入信號,并在更改堆棧符號后移至新狀態。

Consider the following diagram which demonstrates transition in a PDA, from State q1 to state q2 described as x, y->z.

考慮下圖,該圖演示了PDA從狀態q1到狀態q2的過渡,描述為x,y-> z

PDA

In the above scenario, you can observe that if the current state of machine is q1, The input symbol is 'x' and 'y' is at the Top of Stack symbol then we can carry out push and pop operation by popping 'y' and pushing 'z' on the top of the stack and can proceed to state q2.

在上述情況下,您可以觀察到,如果計算機的當前狀態為q1 ,輸入符號為'x'并且'y'在堆棧頂部符號中,那么我們可以通過彈出'y'來執行推入和彈出操作并將'z'推入堆棧的頂部,然后可以進入狀態q2

Some important points of PDA:

PDA的一些要點:

  • A PDA is used to check whether a given grammar is context free grammar or not.

    PDA用于檢查給定的語法是否為上下文無關的語法。

  • A grammar is accepted if it reaches the end state on using of all its input symbols.

    如果語法在使用所有輸入符號時都達到結束狀態,則該語法被接受。

  • There are some other notations of the PDA that are used. They are:

    使用了PDA的其他一些符號。 他們是:

    1. Instantaneous Description: For a PDA, instantaneous description is given by,即時描述 :對于PDA,即時描述由,
    2.     triplet (q,w,s), where 
      q is the current state of the machine
      w is the set of input symbols that are remaining
      s is the stack. 
      
      
    3. Turnstile Notation: It defines the moves of PDA based on ID notation. Transition is defined as 旋轉記號 :它根據ID記號定義PDA的移動。 過渡定義為'?'“?”

翻譯自: https://www.includehelp.com/toc/pushdown-automaton-pda-theory-of-computation.aspx

計算理論 形式語言與自動機

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541749.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541749.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541749.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

運維人員究竟如何提升價值,持續獲得高薪?

作者簡介:老男孩,北京老男孩IT教育創始人,17年IT經驗,資深Linux實戰專家,IT培訓界實戰派頂尖大師,國內將實戰心理學體系大量注入IT運維培訓領域的第一人,多本IT暢銷圖書作者,51CTO金…

Webservice soap wsdl區別之個人見解

Web Service實現業務訴求:Web Service是真正“辦事”的那個,提供一種辦事接口的統稱。WSDL提供“能辦的事的文檔說明”:對要提供的服務的一種描述格式。我想幫你的忙,但是我要告訴你我都能干什么,以及干這些事情需要的…

java uuid靜態方法_Java UUID nameUUIDFromBytes()方法及示例

java uuid靜態方法UUID類名UUIDFromBytes()方法 (UUID Class nameUUIDFromBytes() method) nameUUIDFromBytes() method is available in java.util package. java.util包中提供了nameUUIDFromBytes()方法 。 nameUUIDFromBytes() method is used to get a UUID constructed fr…

清空 linux 服務器,Linux服務器清理

Why?廢話不多說直接來圖,可以看出磁盤已經快要滿了未清之前What?可以看出mnt文件夾占用的最大,然后進入mnt目錄里通過命令,根據文件大小對該路徑下文件排序du -h --max-depth1我們服務器出現磁盤快滿了的原因是因為,服務器部署了多個tomcat…

Git中的AutoCRLF與SafeCRLF換行符問題

2019獨角獸企業重金招聘Python工程師標準>>> 原文:http://www.cnblogs.com/flying_bat/archive/2013/09/16/3324769.html 最近在使用GitHub,發現不時沒有修改過的文件要提交,對比發現文件全部修改,但找不到不一樣的地方…

stringwriter_Java StringWriter getBuffer()方法與示例

stringwriterStringWriter類的getBuffer()方法 (StringWriter Class getBuffer() method) getBuffer() method is available in java.io package. getBuffer()方法在java.io包中可用。 getBuffer() method is used to get the StringBuffer that holds the present buffer valu…

linux 下郵件服務器,Linux 下搭建Postfix郵件服務器

Linux 下搭建Postfix郵件服務器詳解:1、首先關閉sendmail服務service sendmail stop2、chkconfig sendmail off(關閉開機自啟動)3、修改DNS正解文件,使DNS能夠解析郵箱服務添加下面兩行mail.zhubf.com. IN A 172.17.17.2zhubf.com. IN M…

Java PipedInputStream close()方法與示例

PipedInputStream類close()方法 (PipedInputStream Class close() method) close() method is available in java.io package. close()方法在java.io包中可用。 close() method is used to close this PipedInputStream and free all system resources linked with this stream…

Coreseek Windows下安裝調試

由于項目需要全文檢索,后面就去網上查了下資料,找到了Sphinx【中文是獅身人面像】這個全文檢索引擎,聽說挺好用的,不過沒有中文分詞。后面又去找了一下,找到了Coreseek,一款中文全文檢索/搜索軟件。 一、Sp…

linux sudo命令全稱,linux sudo命令的概念與使用

1.sudo介紹本文引用地址:http://www.eepw.com.cn/article/201610/305498.htmsudo是linux下常用的允許普通用戶使用超級用戶權限的工具,允許系統管理員讓普通用戶執行一些或者全部的root命令,如halt,reboot,su等等。這樣…

java 方法 示例_Java語言環境getISOCountries()方法與示例

java 方法 示例區域設置類getISOCountries()方法 (Locale Class getISOCountries() method) getISOCountries() method is available in java.util package. getISOCountries()方法在java.util包中可用。 getISOCountries() method is used to return an array of string that …

android shape.xml 屬性詳解

轉載源:http://blog.csdn.net/harvic880925/article/details/41850723 一、簡單使用 剛開始,就先不講一堆標簽的意義及用法,先簡單看看shape標簽怎么用。 1、新建shape文件 首先在res/drawable文件夾下,新建一個文件,命名為&#…

linux檢查防火墻是否阻擋端口,淺析linux查看防火墻狀態和對外開放的端口狀態...

1.查看防火墻狀態查看防火墻狀態 systemctl status firewalld開啟防火墻 systemctl start firewalld關閉防火墻 systemctl stop firewalld開啟防火墻 service firewalld start若遇到無法開啟先用:systemctl unmask firewalld.service然后:systemctl star…

Java類class getClasses()方法及示例

類的類getClasses()方法 (Class class getClasses() method) getClasses() method is available in java.lang package. getClasses()方法在java.lang包中可用。 getClasses() method is used to return an array that contains Class objects denoting all the public classes…

linux內核計數函數,linux中的內核引用計數器

linux中的內核引用計數器文檔 /Documentation/kref.txt翻譯。krefs能讓你往你的對象中添加一個引用計數器。如果你有一些需要在多處被使用和傳遞的對象,而你并沒有給這些對象中添加引用計數器的話,你的代碼肯定會有某些缺陷,會出現一些問題。…

jQuery常用的全局方法源碼

下面常用方法的詳細使用請查看:http://www.cnblogs.com/moqiutao/p/4775725.html 1.$.noConflict()方法 語法:jQuery.noConflict(removeAll) removeAll:布爾值。指示是否允許徹底將 jQuery 變量還原。 源碼: var// Map over jQuer…

isinstance_Java類class isInstance()方法及示例

isinstance類class isInstance()方法 (Class class isInstance() method) isInstance() method is available in java.lang package. isInstance()方法在java.lang包中可用。 isInstance() method is used to check whether the given object is an instance with the object d…

Linux比較大文件內容,Linux系統最大文件打開數優化,解決Too many open files報錯

這是一個Linux系統常見的故障,網絡上也能輕易的找到解決辦法,我也只是在工作中遇到了這個問題,所以在博客記錄下,以備不時之需。一、報錯截圖:圖為resin的報錯日志,很明顯提示了Too many open files&#x…

java日歷類add方法_Java日歷computeFields()方法及示例

java日歷類add方法日歷類的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is available in java.util package. 在java.util包中提供了validateFields()方法 。 computeFields() method is used to convert current ms(milliseconds) t…

Varnish緩存代理簡介與配置

一、varnish原理:1)Varnish簡介:varnish緩存是web應用加速器,同時也作為http反向緩存代理。你可以安裝varnish在任何http的前端,同時配置它緩存內容。與傳統的 squid 相比,varnish 具有性能更高、速度更快、…