简体   繁体   English

PDA M 中的堆栈大小可以增长到最多容纳 k 个符号。 L(M) 是什么语言?

[英]the stack size in a PDA M can grow to hold at most k symbols. What kind of language is L(M)?

the stack size in a PDA M can grow to hold at most k symbols. PDA M 中的堆栈大小可以增长到最多容纳 k 个符号。 What kind of language is L(M)? L(M) 是什么语言? Prove your claim.证明你的主张。

I think the answer for this is this: The language L(M) is a regular language if it can hold at most k symbols.我认为答案是这样的:如果语言 L(M) 最多可以容纳 k 个符号,则它是一种常规语言。 Since it can hold at most k symbols, the stack size is therefore finite.由于它最多可以容纳 k 个符号,因此堆栈大小是有限的。 Furthermore, we can create a DFA that will accept L(M), and therefore we can conclude that this language L(M) is regular.此外,我们可以创建一个接受 L(M) 的 DFA,因此我们可以得出结论,该语言 L(M) 是正则的。

But I am having a debate with my friends whether this is correct or not但是我正在和我的朋友争论这是否正确

You are correct, such automata accept the regular languages.你是对的,这样的自动机接受常规语言。

One way to argue this is by showing how to construct an NFA for any of these limited-stack PDAs.论证这一点的一种方法是展示如何为这些有限堆栈 PDA 中的任何一个构建 NFA。 The construction is easy, as you have suggested and has been suggested in the comments:构造很简单,正如您所建议的那样,并在评论中提出了建议:

  1. take your limited-stack PDA带上你的有限堆栈 PDA
  2. for every state q and every possible stack configuration S (there can be no more than (|E| + 1)^k of them for sure) in the limited-stack PDA, define state qS in the NFA对于有限堆栈 PDA 中的每个 state q 和每个可能的堆栈配置 S(肯定不会超过 (|E| + 1)^k),在 NFA 中定义 state qS
  3. for every transition (q, S, s, q', S') where q is the initial state, S is the initial stack configuration, s is the transition symbol, q' is the transition state and S' is the stack configuration after the transition, add a transition from qS to q'S' in the NFA on symbol s.对于每个转换 (q, S, s, q', S'),其中 q 是初始 state,S 是初始堆栈配置,s 是转换符号,q' 是转换 state,S' 是之后的堆栈配置转移,在符号 s 上的 NFA 中添加从 qS 到 q'S' 的转移。 Note: do this for empty/epsilon/lambda transitions as well注意:对空/epsilon/lambda 转换也执行此操作
  4. make the initial state of the NFA the state q0S0 the one where q0 is the initial state of the limited-stack PDA and S0 is the empty stack将 NFA 的初始 state 设为 state q0S0 其中 q0 是有限堆栈 PDA 的初始 state,S0 是空堆栈
  5. make the accepting states of the PDA those states qaSa where qa is accepting in the limited-stack PDA (and/or if you are accepting by empty stack, Sa is the empty stack).使 PDA 的接受状态成为 qaSa,其中 qa 在有限堆栈 PDA 中接受(和/或如果您通过空堆栈接受,Sa 是空堆栈)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pda 接受语言 L={a^nb^m | n <m}< div><div id="text_translate"><p> 我知道如何解决 m&lt;n,但我很难理解 m&gt;n 的逻辑。</p><p> 在 m&lt;n 中,我们将所有 a 压入堆栈,当我们得到 b 时,我们弹出一个 a,当输入以包含 mn a 的堆栈结束时,机器应该进入最终的 state</p><p> 我该怎么办 m&gt;n.... </p></div></m}<> - pda to accept the language L={a^n b^m | n<m} 什么是语言a ^ mb ^ n的PDA(下推式自动机),其中n &lt;m - What would be the PDA (pushdown automata) of the language a^mb^n where n<m L = {a^na^nb^m |m, n ≥ 0} 是规则语言还是不规则语言? - Is L = {a^n a^n b^m |m, n ≥ 0} a regular or irregular language? CS,Java:数组实现的堆栈数据结构如何增长(向上,向下)? 分析 - CS, Java: How an array implemented stack data structure can grow (upwards, downwards)? analyze 暂停问题是否意味着程序无法检查其他程序? - Does the halting p‌r‌o‌b‌l‌e‌m mean that programs cannot check other programs? O(n + log(m)) 可以简化吗? - Can O(n + log(m)) be simplified? 参数大小 m = logn 的问题实例是如何变成 2^(logn) 的? - How did the problem instance with the parameter size m = logn become 2^(logn)? 为定义在 Σ = {0, 1} 上的以下语言构建 NFA。 D = {0^n 10^m10^q |n, m, q ∈ N, q ≡ nm (mod 5)} - Construct a NFA for the following language defined over Σ = {0, 1}. D = {0^n 10^m10^q |n, m, q ∈ N, q ≡ nm (mod 5)} 如何证明 L = {a^jb^kc^kd^k: j, k ≥ 1} ∪ {b^jc^kd^l: j, k, l ≥ 0} 满足 CFL 的泵浦引理? - How to prove that L = {a^j b^k c^k d^k: j, k ≥ 1} ∪ {b^j c^k d^l : j, k, l ≥ 0} satisfies the pumping lemma for CFL’s? 语言 {⟨A⟩∣A 是 NFA 并且 L(A)={0,1}∗} 是可判定的吗? 可决定的? - Is the language {⟨A⟩∣A is an NFA and L(A)={0,1}∗} decidable? decidable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM