简体   繁体   English

确定性/非确定性状态系统映射

[英]Deterministic/non-deterministic state system mapping

I read in a book on non-deterministic mapping there is mapping from Q*∑ to 2 Q for M=(Q,∑,trans,q 0 ,F) where Q is a set of states. 我在一本关于非确定性映射的书中读到,对于M =(Q,∑,trans,q 0 ,F),存在从Q * ∑到2 Q的映射,其中Q是一组状态。 But I am not able to understand how it's 2 Q ; 但是我不明白它是2 Q if there are 3 states a , b , c , how does it map to 8 states? 如果存在3个状态abc ,它将如何映射到8个状态?

I always found that the easiest way to think about these (since the set of states is finite) is as having each of those subsets be an encoding of a base-2 number that ranges from 0 (all bits zero) to 2 |Q| 我总是发现,考虑这些问题的最简单方法(因为状态集是有限的)是让每个子集是从0(所有位为零)到2 | Q |的以2为基数的编码。 -1 (all bits one), where there are as many bits in the number as there are members in the state set, Q. Then, you can just take one of these numbers and map it into a subset by using whether a particular bit in the number is set. -1(所有位均为1),其中位数与状态集中Q中成员的位数一样多。然后,您可以只取这些数值中的一个,并通过使用特定位将其映射到子集中在数字设置。 Easy! 简单!

Here's a worked example where Q = { a , b , c }. 这是一个工作示例,其中Q = { abc }。 In this case, |Q| 在这种情况下,| Q | is 3 (there are three elements) and so 2 3 is 8. That means we get this if we say that the leading bit is for element a , the next bit is for b , and the trailing bit for c : 是3(有三个元素),所以2 3是8。这意味着如果我们说前导位是元素a ,下一位是b ,后一位是c,则得到此结果

  • 0 = 000 = { 0 = 000 = { } }
  • 1 = 001 = { c } 1 = 001 = { c }
  • 2 = 010 = { b } 2 = 010 = { b }
  • 3 = 011 = { b,c } 3 = 011 = { b,c }
  • 4 = 100 = { a } 4 = 100 = { a }
  • 5 = 101 = { a,c } 5 = 101 = { a,c }
  • 6 = 110 = { a,b } 6 = 110 = { a,b }
  • 7 = 111 = { a,b,c } 7 = 111 = { a,b,c }

See? 看到? That initial three states has been transformed into 8, and we have a natural numbering of them that we could use to create the labels of those states if we chose. 最初的三个州已被转换为8,并且我们对它们进行了自然编号,如果我们选择的话,可以用来创建这些州的标签。

Now, to the interpretations of this within a non-deterministic context. 现在,在非确定性上下文中对此进行解释。 Basically, the non-determinism means that we're uncertain about what state we're in. We represent this by using a pseudo-state that is the set of “real” states that we might be in; 基本上,非确定性意味着我们不确定我们所处的状态。我们通过使用伪状态来表示这一点,该伪状态是我们可能处于的“真实”状态的集合。 if we have total non-determinism then we are in the pseudo-state where all real-states are possible (ie, { a,b,c }) whereas the pseudo-state where no real-states are possible (ie, {}) is the converse (and really ought to be impossible to reach in the transition system). 如果我们具有全部不确定性,那么我们将处于所有状态都可能的伪状态(即{ a,b,c }),而没有实际状态的伪状态(即{}) )是相反的(在过渡系统中确实应该是不可能实现的)。 In a real system, you're usually not dealing with either of those extremes. 在实际系统中,您通常不会处理这些极端情况中的任何一个。

The logic of how you convert the deterministic transition system into a non-deterministic one is rather more complex than I want to go into here. 如何将确定性转换系统转换为非确定性转换系统的逻辑比我想讲的要复杂得多。 (I had to read a substantial PhD thesis to learn it so it's definitely more than an SO answer's worth!) (我必须阅读大量的博士学位论文才能学习它,因此绝对比SO答案更有价值!)

2 Q means the set of all subsets of Q. For each state q and each letter x from sigma, there is a subset of Q states to which you can go from q with letter x. 2 Q表示Q的所有子集的集合。对于每个状态q和sigma中的每个字母x,您可以从带有q的x到q的一个Q状态的子集。 So yeah, if there are three states abc the set 2 Q consists of 8 elements {{}, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c}}. 因此,是的,如果存在三个状态abc,则集合2 Q包含8个元素{{},{a},{b},{c},{a,b},{a,c},{b,c} ,{a,b,c}}。 It doesn't map to 8 states, it maps to one of these 8 sets. 它不映射到8个状态,而是映射到这8个集合之一。 HTH HTH

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

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