- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
nfa转化为dfa(NFA is converted to DFA)
nfa转化为dfa(NFA is converted to DFA)
# includes stdio.h
# includes conio.h
/ / 宏定义
# define max _ node 50 / / 允许最多的结点数
# define max _ end 10 / / 允许最多的输入符号数
# define max _ degr 8 / / 每个结点允许的最大出度
# define max _ table 200 / / 状态转化矩阵最多行数
# define begin _ were 0 / / 初始状态结点 int型
# define end _ were 1 / / 终结状态结点 int型
# define empty is # / / 空代价 char型
# define area (from, to) (((n) = (from)) ((n) = ())) / / 判断n是否在区间 (from, to)
/ / 集合结构体
typedef struct muster
{
int member [max _ node]; / / 集合的元素, 最多为结点个数
int num; / / 集合的元素个数
} muster.
/ / 函数声明
void musinit (muster *); / / 初始化a集合
void init (void); / / 初始化函数, 将集合等清零
getdata void (void); / / 获得用户输入数据
getdataexpert void (void); / / 获得用户输入数据 专家模式
void taxis (muster *); / / 排序函数, 把集合里的元素按小到大排序
bool isequal (muster *, muster * b); / / 判断集合a与b是否相等 注意: 判断的两个集合应该已排序
void eclosure (muster *, muster * b); / / 求a的空字闭包, 结果保存到b
void empty (int a, muster * b); / / 递归求结点a出发花费空字到达的结点集合
void aclosure (muster muster * * a, b, char c); / / 求a经过一条c弧到达的状态结点全体的空字闭包, 结果保存到b
int findlocal (int); / / 找到结点表示为a的元素在node数组的下标
void addmem2mus (muster * a, int b); / / 将b加至集合a
void addmus2mus (muster *, muster * b); / / 将集合b加至集合a
void printmus (muster *); / / 打印a集合
/ / 为了便于处理, 这里把一系列变量设置为全局变量
int nodenum; / / 结点数
int endnum; / / 终结符数
char end (max _ end]; / / 终结符
int node [max _ node] [max _ degr + 1], [2].
/ / node [i] [0] [0] 保存结点的表示 - 2表示开始 - 1表示终结
/ / node [i] [0] [1] 存当前结点的出度n
/ / node [i] [1] [0] - - node [i] [n + 1] [0] 保存当前结点到下一结点的表示
/ / node [i] [1] [1] - - node [i] [n + 1] [1] 保存字符 当前结点到下一结点的代价
muster table _ table [max] [max _ end + 1]; / / 状态转化矩阵 其元素均为集合类型muster
/ / end 全局变量
void musinit (muster *) / / 初始化a集合
{
- num = 0;
}
void init () / / 初始化函数, 将集合等清零
{
int i, j;
for (i = 0; i max _ tab; + + i)
for (j = 0, j max _ end + 1; + + j)
musinit ( tab [the] [j]).
}
void getdata () / / 获得用户输入数据
{
int i, j, k; / / 循环辅助变量
bool flg; / / 在判断输入代价是否合法时用的一个标记
/ / 获得合法的终结符数
i give
{
fflush (stdin); / / 防止非数字的输入导致死循环 不规范的用法 不推荐
printf (\ n \ n请输入输入符号表的输
您可能关注的文档
- 2006年全国各地高考题(语音)完全详解汇编.txt1(In 2006, the national college entrance examination questions (voice) fully detailed assembly,.Txt1).doc
- 2006年林业系统工人技师培训森林管护试题(Forestry system workers, technicians training, forest protection and management questions in 2006).doc
- 2006年海淀区高三理综二模(化学部分)(In 2006 the Haidian District Middle School Science (Chemistry) the second mock exam).doc
- 2007-2008年南京市高三英语摸底调研考试成绩表(2007-2008 years of Nanjing City Senior English survey survey results).doc
- 2007–2008学年第一学期植科`资环(普高)专业植物生理生化试卷(a)卷(In the first semester of the 2007 - 2008 academic year, the department specialized in plant physiology and Biochemistry (a)).doc
- 2007年4月全国计算机等级考试二级java笔试(In April 2007, the National Computer Rank Examination two level java written examination).doc
- 2007年小升初小学英语语法复习要点归纳(In 2007, elementary school English grammar review points are summarized).doc
- 2008年10月自考语言学概论试题(An introduction to Linguistics in October 2008).doc
- 2008初中毕业体育考试定量项目成绩评价标准(2008, junior high school graduate sports examination quantitative project performance evaluation standards).doc
- 2008年高考作文经典人物素材(2008 college entrance examination composition classic material).doc
- notepad++搜索(Notepad++ search).doc
- notepad++正则表达式替换字符串详解(Notepad++ regular expression replacement string detailed).doc
- ntfs与fat32有什么区别(What's the difference between NTFS and FAT32).doc
- oa名词解释(OA noun interpretation).doc
- office_页码设置(Office_ page settings).doc
- ongl入门介绍(Introduction to ongl).doc
- on learning the chiese language(on learning the churches language).doc
- ongl简介(ongl简介).doc
- openbsd下vi编辑器的用法(The use of the VI Editor under OpenBSD).doc
- none和no one的区别(The difference between none and no one).doc
最近下载
- 华东师大版八年级数学上册《作一个角等于已知角》教案及教学反思.docx VIP
- 【真题】河南省2025年对口升学(语文、英语)考试真题卷 完整版2025.pdf VIP
- 中心吸氧装置出现故障的应急预案.pptx VIP
- 13.4.2作一个角等于已知角展示课件数学八年级上册.pptx VIP
- 梦幻西游手游科举乡试会试答案大全 乡试答题器.pdf VIP
- QB∕T 5617-2021 单层床通用技术条件 .pdf
- 设备采购与管理作业指导书(设备采购类).doc VIP
- 2022 ASHRAE Handbook Refrigeration. SI edition标准原版完整.docx
- 教职工请假单(部门存根)(模板).pdf VIP
- 学校篮球比赛报名表的表格打印模板文档.xlsx VIP
文档评论(0)