计算理论 形式语言与自动机_下推式自动机(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.mzph.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 具有性能更高、速度更快、…