上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。 设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒ 例如,设文法G:S→AB A→aA|a B→bB|b 则L(G)={a^nb^m | n,m>=1} 其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。
标签: Context-Free Grammar CFG
上传时间: 2013-12-10
上传用户:gaojiao1999
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
Rebel工具包,包括UKF,CDKF在内的多种粒子滤波算法仿真,是非线性系统状态估计的良好帮手
上传时间: 2013-12-30
上传用户:wfeel
共梯度算法程序代码.数学上,共梯度法实求解特定线性系统的数值解的方法,其中那些矩阵为对称和正定。共轭梯度法是一个迭代方法,所以它适用于稀疏矩阵系统,因为这些系统对于象乔莱斯基分解这样的直接方法太大了。这种系统在数值求解偏微分方程时相当常见。 共梯度法也可以用于求解无约束优化问题。
上传时间: 2016-09-05
上传用户:exxxds
阐述了高斯消元法的目的与用途、原理、流程及程序说明,并给出了程序源代码!是研究生学习线性系统课程的一个例子。
上传时间: 2014-01-19
上传用户:sardinescn
一种最小二乘法的RBF神经网络,用于对复杂系统的辨识研究
上传时间: 2017-01-05
上传用户:wff
汉诺塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C
标签: the animation Simulate movement
上传时间: 2017-02-11
上传用户:waizhang
ex6_1 ~ ex6_3二项分布的随机数据的产生 ex6_4 ~ ex6_6通用函数计算概率密度函数值 ex6_7 ~ ex6_20常见分布的密度函数 ex6_21 ~ ex6_33随机变量的数字特征 ex6_34 采用periodogram函数来计算功率谱 ex6_35 利用FFT直接法计算上面噪声信号的功率谱 ex6_36 利用间接法重新计算上例中噪声信号的功率谱 ex6_37 采用tfe函数来进行系统的辨识,并与理想结果进行比较 ex6_38 在置信度为0.95的区间上估计有色噪声x的PSD ex6_39 在置信度为0.95的区间上估计两个有色噪声x,y之间的CSD ex6_40 用程序代码来实现Welch方法的功率谱估计 ex6_41 用Welch方法进行PSD估计,并比较当采用不同窗函数时的结果 ex6_42 用Yule-Walker AR法进行PSD估计 ex6_43 用Burg算法计算AR模型的参数 ex6_44 用Burg法PSD估计 ex6_45 比较协方差方法与改进的协方差方法在功率谱估计中的效果 ex6_46 用Multitaper法进行PSD估计 ex6_47 用MUSIC法进行PSD估计 ex6_48 用特征向量法进行PSD估计
上传时间: 2013-12-10
上传用户:mpquest
将魔王的语言抽象为人类的语言:魔王语言由以下两种规则由人的语言逐步抽象上去的:α-〉β1β2β3…βm ;θδ1δ2…-〉θδnθδn-1…θδ1 设大写字母表示魔王的语言,小写字母表示人的语言B-〉tAdA,A-〉sae,eg:B(ehnxgz)B解释为tsaedsaeezegexenehetsaedsae对应的话是:“天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅”。(t-天d-地s-上a-一只e-鹅z-追g-赶x-下n-蛋h-恨)
上传时间: 2013-12-19
上传用户:aix008