上下文無關(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
There is an example of how to use the LDPC encode/decode with AWGN channel model in files .\ldpc_decode.m and .\GFq\ldpc_decode.m. There are a few parity check matrices available in the code but you can use other matrices provided you have enough memory to load them. I suggest checking out matrices in Alist format available on David MacKay s web site.You will need to have access to a MEX compiler to be able to use a few functions written in C. LDPC的仿真代碼
標簽: example channel ldpc_de encode
上傳時間: 2013-12-03
上傳用戶:lili123
Problem Statement You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substring of input. In case of a tie, return the string that occurs earliest in input. Definition Class: ReverseSubstring Method: findReversed Parameters: string Returns: string Method signature: string findReversed(string input) (be sure your method is public) Notes The substring and its reversal may overlap partially or completely. The entire original string is itself a valid substring (see example 4). Constraints input will contain between 1 and 50 characters, inclusive. Each character of input will be an uppercase letter ( A - Z ). Examples 0) "XBCDEFYWFEDCBZ" Returns: "BCDEF" We see that the reverse of BCDEF is FEDCB, which appears later in the string. 1)
上傳時間: 2015-09-21
上傳用戶:sunjet
In the process of copper flash smelting, lining temperature of reaction shaft and its inner wall sluggish play a very important role in lining life. Up to now, however
標簽: temperature smelting reaction process
上傳時間: 2015-10-03
上傳用戶:wang5829
C#中實現(xiàn)最短路,該圖算法描述的是這樣的場景:圖由節(jié)點和帶有方向的邊構(gòu)成,每條邊都有相應(yīng)的權(quán)值,路徑規(guī)劃(最短路徑)算法就是要找出從節(jié)點A到節(jié)點B的累積權(quán)值最小的路徑。
標簽: 短路
上傳時間: 2014-01-12
上傳用戶:sammi
his paper provides a tutorial and survey of methods for parameterizing surfaces with a view to applications in geometric modelling and computer graphics. We gather various concepts from di® erential geometry which are relevant to surface mapping and use them to understand the strengths and weaknesses of the many methods for parameterizing piecewise linear surfaces and their relationship to one another.
標簽: parameterizing provides tutorial surfaces
上傳時間: 2014-11-09
上傳用戶:努力努力再努力
How well do you really know Java? Are you a code sleuth? Have you ever spent days chasing a bug caused by a trap or pitfall in Java or its libraries? Do you like brainteasers? Then this is the book for you!
上傳時間: 2013-11-25
上傳用戶:王慶才
A one-dimensional calibration object consists of three or more collinear points with known relative positions. It is generally believed that a camera can be calibrated only when a 1D calibration object is in planar motion or rotates around a ¯ xed point. In this paper, it is proved that when a multi-camera is observing a 1D object undergoing general rigid motions synchronously, the camera set can be linearly calibrated. A linear algorithm for the camera set calibration is proposed,and then the linear estimation is further re¯ ned using the maximum likelihood criteria. The simulated and real image experiments show that the proposed algorithm is valid and robust.
標簽: one-dimensional calibration collinear consists
上傳時間: 2014-01-12
上傳用戶:璇珠官人
一:需求分析 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
[輸入] 圖的頂點個數(shù)N,圖中頂點之間的關(guān)系及起點A和終點B [輸出] 若A到B無路徑,則輸出“There is no path” 否則輸出A到B路徑上個頂點 [存儲結(jié)構(gòu)] 圖采用鄰接矩陣的方式存儲。 [算法的基本思想] 采用廣度優(yōu)先搜索的方法,從頂點A開始,依次訪問與A鄰接的頂點VA1,VA2,...,VAK, 訪問遍之后,若沒有訪問B,則繼續(xù)訪問與VA1鄰接的頂點VA11,VA12,...,VA1M,再訪問與VA2鄰接頂點...,如此下去,直至找到B,最先到達B點的路徑,一定是邊數(shù)最少的路徑。實現(xiàn)時采用隊列記錄被訪問過的頂點。每次訪問與隊頭頂點相鄰接的頂點,然后將隊頭頂點從隊列中刪去。若隊空,則說明到不存在通路。在訪問頂點過程中,每次把當前頂點的序號作為與其鄰接的未訪問的頂點的前驅(qū)頂點記錄下來,以便輸出時回溯。 #include<stdio.h> int number //隊列類型 typedef struct{ int q[20]
標簽: 輸入
上傳時間: 2015-11-16
上傳用戶:ma1301115706
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1