上下文無關(guān)文法(Context-Free Grammar, CFG)是一個4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產(chǎn)生式規(guī)則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結(jié)符,T的元素稱為終結(jié)符,S是一個特殊的非終結(jié)符,稱為文法開始符。 設(shè)G=(V, T, S, P)是一個CFG,則G產(chǎn)生的語言是所有可由G產(chǎn)生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個語言L是上下文無關(guān)語言(Context-Free Language, CFL),當且僅當存在一個CFG G,使得L=L(G)。 *⇒ 例如,設(shè)文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結(jié)符都是大寫字母,開始符都是S,終結(jié)符都是小寫字母。
標簽: Context-Free Grammar CFG
上傳時間: 2013-12-10
上傳用戶:gaojiao1999
本文件描述了一個基于串口實現(xiàn)文件傳輸?shù)膮f(xié)議eXmodem,該協(xié)議基于標準Xmodem File Transfer Protocol,是一個獨立標準,完全功能,全新的文件傳輸協(xié)議。 1)該協(xié)議除實現(xiàn)Xmodem File Transfer基本功能,即已實現(xiàn)了在兩個設(shè)備相互之間,通過串口把一個設(shè)備內(nèi)文件傳輸至另一個設(shè)備內(nèi);其增強功能所列參考如下: a)兩個設(shè)備相互之間傳輸文件能夠以一致的文件目錄存放; b)兩個設(shè)備相互之間可以傳輸任意大小的文件,而Xmodem File Transfer只能傳送128 *n字節(jié)大小的文件; c)具備避免一個文件在兩個設(shè)備相互之間重復(fù)傳輸?shù)墓δ埽岣吡宋募鬏數(shù)男省?/p>
標簽: eXmodem 文件描述 串口實現(xiàn) 文件傳輸
上傳時間: 2015-09-30
上傳用戶:LouieWu
一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語言講話,沒人能聽懂,但他的語言是可逐步解釋成人能聽懂的語言,因為他的語言是由以下兩種形式的規(guī)則由人的語言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個魔王語言的解釋系統(tǒng),把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規(guī)則和上述規(guī)則形式(2)實現(xiàn).設(shè)大寫字母表示魔王語言的詞匯 小寫字母表示人的語言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測試數(shù)據(jù): B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對應(yīng)關(guān)系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時間: 2014-12-02
上傳用戶:jkhjkh1982
2005-7-13 10:03 前幾天要做一個短信收發(fā)的小軟件,于是按照習慣Box尋找例程和控件,可惜沒有找到! 于是,大幅翁、Google!!!終于找到了好幾個,不是要收費就是不能用!氣憤!! 這又不是什么高新尖端科技,俺們不是做不出來,俺們只是秉承RAD的精神而已! 于是這個短消息控件誕生了!雖然還很簡陋,起碼胳膊腿都有了,剩下就看它怎么跑了! 使用標準AT指令 現(xiàn)在只能支持PDU模式(Text模式太簡陋)! 支持7_Bit 和 UCS2 編碼 集成了串口(spcomm) 只需要簡單的配置幾個參數(shù)就可以收發(fā)短信了
上傳時間: 2015-12-19
上傳用戶:wxhwjf
t112 參考文件,使用KEIL C51編譯器。AU 7寸模擬屏幕資料。
標簽: t112
上傳時間: 2016-01-02
上傳用戶:hakim
一般情況下,我們都是在MATLAB命令行或DOS命令行下編譯MEX程序。 所用的命令就是:mex filename.c 這有很多不方便的地方: a. 雖然mex也可以編譯C++的mex程序,但是它的主框架仍是C的 a. 當程序有多個模塊時,需要多次使用mex命令,操作很麻煩 b. 不能利用VC特有的ClassWizard自動創(chuàng)建和維護類 c. 不能用MFC類庫編寫應(yīng)用程序 d. 不能方便地進行類似VC的項目管理 本文詳細解說如何在IDE中編譯MEX程序
標簽:
上傳時間: 2016-01-05
上傳用戶:shizhanincc
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
MSP430F149串口行實驗程序 //使用ADC12采集實驗,將采集到數(shù)據(jù)送向PC.(序列單次采集,采用定時器A作為時鐘源) //P3.4為發(fā)送,P3.5為接收 晶體使32768HZ/8MHZ. 串行波特率B/S //使用SMCLK作為波特率發(fā)器時,不能使用LPM2,LPM3!
上傳時間: 2013-12-18
上傳用戶:D&L37
成績顯示三個部份abc #include<stdio.h> #include<stdlib.h> int main(void) { float gread printf("請輸入分數(shù)\n") scanf("%f",&gread) if(gread>=80&&gread<=100) printf("成績?yōu)锳\n") else if(gread>=60&&gread<=79) { printf("成績?yōu)锽\n") } else if(gread>=0&&gread<60) { printf("成績?yōu)镃\n") } else { printf("分數(shù)輸入錯誤\n") } system("pause") return 0 }
標簽: include stdlib float gread
上傳時間: 2014-01-15
上傳用戶:waizhang
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1