上下文無關文法(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
一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語言講話,沒人能聽懂,但他的語言是可逐步解釋成人能聽懂的語言,因為他的語言是由以下兩種形式的規則由人的語言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個魔王語言的解釋系統,把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規則和上述規則形式(2)實現.設大寫字母表示魔王語言的詞匯 小寫字母表示人的語言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測試數據: B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對應關系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時間: 2014-12-02
上傳用戶:jkhjkh1982
長高44b0xi BIOS源碼 FS44B0II BIOS具有啟動、引導,下載、燒寫,設置日期、時間,設置工作頻率等多種功能,並且支持各種參數的存儲和自動調用。 可以用flashpgm等軟件將BIOS燒寫到Flash中去,BIOS的自身駐留地址位于NOR FLASH的0x1f0000處,系統參數保存在0x1ff000以上區域中。所以在燒寫完BIOS,上電復位后先要執一定要執行backup命令把BIOS本身拷貝到NOR FLASH的高端1f0000去。
上傳時間: 2013-12-25
上傳用戶:ainimao
上窮碧落下黃泉 - 源碼追蹤經驗談 (PDF 繁體中文 26頁) 侯捷觀點 剖析名家源碼,是讓自己技術躍升的捷徑。但是大系統的源碼非常龐大(Unix, Linux, Java, STL, MFC, VCL, Qt...),閱讀要有閱讀的方法。本文從動機、對象、前提、書籍、態度、工具、方法、瓶頸、價值、附加價值等方向加以討論。
上傳時間: 2016-01-13
上傳用戶:cooran
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
《實戰C++ — 八個別具特色的實作經驗》與目前市面㆖ 眾多C++ 書籍的最大不同,在於 本書既非基礎觀念之教㈻ 書籍,亦非開發工具之使用手冊,而是以「㆒ 章㆒ 專案」的方式, 從實際應用面引領讀者領略C++。 本書是《The Art of C++》的㆗ 文譯本。原作者Herbert Schildt 是㆒ 位㈻ ㈲ 專精、著作等身的 IT 技術作家,其作品普遍獲得良好評價。
標簽: 12694
上傳時間: 2016-02-08
上傳用戶:894898248
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
altera Quartus II FSM使用 可設定時間波形,手動調整波形頻率。 (含電路)
上傳時間: 2016-02-13
上傳用戶:kbnswdifs
「新聞群聚」就是一項需要人力介入的新聞服務,而為了使其更為自動化,我們將文件分群(document clustering)的技術應用在新聞文件上,達到新聞分群(news clustering)的目的。
標簽:
上傳時間: 2014-01-24
上傳用戶:731140412
一篇來自臺灣中華大學的論文--《無線射頻系統標簽晶片設計》,彩色版。其摘要為:本論文討論使用於無線射頻辨識系統(RFID)之標籤晶片系統的電路設計和晶片製作,初步設計標籤晶片的基本功能,設計流程包含數位軟體及功能的模擬、基本邏輯閘及類比電路的設計與晶片電路的佈局考量。 論文的第一部份是序論、射頻辨識系統的規劃、辨識系統的規格介紹及制定,而第二部份是標籤晶片設計、晶片量測、結論。 電路的初步設計功能為:使用電容作頻率緩衝的Schmitt trigger Clock、CRC-16的錯誤偵測編碼、Manchester編碼及使用單一電路做到整流、振盪及調變的功能,最後完成晶片的實作。
上傳時間: 2016-08-27
上傳用戶:tb_6877751