简体   繁体   English

自动机正则表达式{0 + 1} *

[英]Automata regular expression {0+1}*

I'm new in Automata concept AND In some papers I found {0,1}* . 我是Automata概念的新手。在一些论文中,我发现了{0,1}*

  1. Is it same as (0+1)* 是否与(0+1)*

  2. Also can we generate 101 from the (0+1)* 我们也可以从(0+1)*生成101

  3. can we generate 101 from the {0,1}* 我们可以从{0,1}*生成101
    if 1) answer is NO 如果1)答案是否定的

PLEASE any one help me to solve this confusion.. 请任何人帮我解决这个困惑..

If all of them are found in computer science paper and computational theory books , then yes, they are likely the same. 如果所有这些都出现在计算机科学论文和计算理论书籍中 ,那么是的,它们可能是相同的。

  • In the notation {0,1}* , set notation {0,1} is used to denote "0 or 1". 在符号{0,1}* ,设置符号{0,1}用于表示“0或1”。

  • Alternatively, + is also used to denote alternation ( JFLAP , for example). 或者, +也用于表示交替(例如JFLAP )。 So (0+1) can also mean "0 or 1". 所以(0+1)也可以表示“0或1”。

  • | is also used to denote alternation (0|1) in theoretical computer science context. 也用于表示理论计算机科学背景下的交替(0|1) This is also the syntax for alternation in many regex engines. 这也是许多正则表达式引擎中交替的语法。

The Kleene star * is, having the same notation in both theoretical regular expression (books, paper) and practical regex library, denotes repetition of 0 or more times of the preceding atom. Kleene星*在理论正则表达式(书籍,纸张)和实际正则表达式库中具有相同的符号,表示重复前一个原子的0次或更多次。

Since they mean "(0 or 1) repeated 0 or more times", both of them can generate the language 101 . 由于它们意味着“(0或1)重复0次或更多次”,因此它们都可以生成语言101

As @Bergi mentioned in the comment, you should take a step back when you see both syntax being used in the same book/paper. 正如@Bergi在评论中提到的那样,当您在同一本书/论文中看到这两种语法时,您应该退后一步。 For example, @paarandika noted that + can actually means "repeat once or more times" in book/paper if it is in superscript. 例如,@ paarandika指出,如果是上标, +实际上可以在书/纸上“重复一次或多次”。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM