正在进行安全检测...

发布时间:1714224503   来源:文档文库   
字号:
不确定有限状态自动机的确定化(NFA TO DFA 2008-12-05 22:11 #include #include #define MAXS 100 using namespace std; string NODE; //结点集合 string CHANGE; //终结符集合 int N; //NFA边数 struct edge{ string first; string change; string last; }; struct chan{ string ltab; string jihe[MAXS]; }; void kong(int a { int i; for(i=0;i cout<<' '; } //排序
void paixu(string &a { int i,j; char b; for(j=0;j for(i=0;i if(NODE.find(a[i]>NODE.find(a[i+1] { b=a[i]; a[i]=a[i+1]; a[i+1]=b; } }
void eclouse(char c,string &he,edge b[] {
int k; for(k=0;k{ if(c==b[k].first[0] if(b[k].change=="*" { if(he.find(b[k].last>he.length( he+=b[k].last; eclouse(b[k].last[0],he,b; } } } void move(chan &he,int m,edge b[] { int i,j,k,l; k=he.ltab.length(; l=he.jihe[m].length(; for(i=0;i for(j=0;j if((CHANGE[m]==b[j].change[0]&&(he.ltab[i]==b[j].first[0] if(he.jihe[m].find(b[j].last[0]>he.jihe[m].length( he.jihe[m]+=b[j].last[0]; for(i=0;i for(j=0;j if((CHANGE[m]==b[j].change[0]&&(he.jihe[m][i]==b[j].first[0] if(he.jihe[m].find(b[j].last[0]>he.jihe[m].length( he.jihe[m]+=b[j].last[0]; } //输出
void outputfa(int len,int h,chan *t {
int i,j,m; cout<<" I "; for(i=0;i cout<<'I'<cout<for(i=0;i{ cout<<' '< m=t[i].ltab.length(;

本文来源:https://www.2haoxitong.net/k/doc/e395720e844769eae009ed4c.html

《正在进行安全检测....doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式

相关推荐