简体   繁体   English

从两个确定性有限自动机(确定性有限状态机)创建异或

[英]Creating an Exclusive Or from two Deterministic Finite Automatons (Deterministic Finite-State Machines)

Two DFAs (Deterministic Finite Automaton or Deterministic Fininte-State Machines - Which will be called DFAs from here on) Defined over the set DFA 1: L1 = {Q1, E, D1, s1, F} DFA 2: L2 = {Q2, E, D2, s2, F} 在集合DFA 1上定义了两个DFA(确定性自动机或确定性有限状态机-从此处开始将称为DFA)L1 = {Q1,E,D1,s1,F} DFA 2:L2 = {Q2, E,D2,s2,F}

Q is the list of states. Q是状态列表。 Ex 1, 2, 3, 4 or a, b, c, d 例如1、2、3、4或a,b,c,d

E is the the language Ex. E是语言Ex。 0, 1 0,1

D is the transition set Ex. D是过渡集Ex。 {(a,0,b)} state a goes to b on a 0 {(a,0,b)}状态a在0处进入b

s is the starting state s是起始状态

F is the final state F是最终状态

How would you take and exclusive-or of two DFAs L1 and L2 您如何将两个DFA L1和L2排除在外?

Here are a few broad hints to get you started... 这里有一些广泛的提示可以帮助您入门...

You'll probably want to build another DFA whose states Q3 are identified with elements of the Cartesian product of Q1 and Q2. 您可能需要构建另一个DFA,其状态Q3由Q1和Q2的笛卡尔积的元素标识。 From s1 and s2, it should be pretty obvious which element of Q3 should be designated as the start state. 从s1和s2开始,应该很明显地将Q3的哪个元素指定为开始状态。
Then, given any node (n1 in Q1, n2 in Q2) in Q3, it should be pretty easy to figure out where the edges need to go for each input. 然后,给定Q3中的任何节点(Q1中的n1,Q2中的n2),应该很容易找出每个输入的边沿位置。 And F3 will a set of states (n1, n2) where (n1 in F1 XOR n2 in F2) holds. F3将拥有一组状态(n1,n2),其中(F1中的n1与F2中的n2相乘)成立。

Q = Q1 X Q2; Q = Q1 X Q2;

E = E; E = E;

D is all transitions that agree from both systems; D是两个系统都同意的所有转换;

s = S1 intersect S2; s = S1与S2相交;

F = F1 XOR F2 F = F1 XOR F2

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

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