10 views

Uploaded by gkgj

The cyk algorithm

save

You are on page 1of 9

**CYK algorithm is Developed by J. Cocke D. Younger, T. Kasami
**

• The membership problem:

– Problem:

• Given a context-free grammar G and a string w

– G = (V, ∑ ,P , S) where

» V finite set of variables

» ∑ (the alphabet) finite set of terminal symbols

» P finite set of rules

» S start symbol (distinguished element of V)

» V and ∑ are assumed to be disjoint

– G is used to generate the string of a language

– Question:

Is w in L(G)?

Basics

– The Structure of the rules in a Chomsky Normal Form grammar

– Uses a “dynamic programming” or “table-filling algorithm”

– Normal Form is described by a set of conditions that each rule in the

grammar must satisfy

– Context-free grammar is in CNF if each rule has one of the following forms:

– A à BC at most 2 symbols on right side

– A à a, or terminal symbol

– Sàλ null string

where B, C Є V – {S}

Construct triangular Table

• Each row corresponds to one length of substrings

– Bottom Row – Strings of length 1

– Second from Bottom Row – Strings of length 2

.

Top Row – string ‘w’

• Xi, i is the set of variables A such that

A à wi is a production of G

• Compare at most n pairs of previously computed sets:

(Xi, i , Xi+1, j ), (Xi, i+1 , Xi+2, j ) … (Xi, j-1 , Xj, j )

X1, 5

X1, 4 X2, 5

X1, 3 X2, 4 X3, 5

X1, 2 X2, 3 X3, 4 X4, 5

X1, 1 X2, 2 X3, 3 X4, 4 X5, 5

w1 w2 w3 w4 w5

Table for string ‘w’ that has length 5

Looking for pairs to compare Example CYK Algorithm • Show the CYK Algorithm with the following example: – CNF grammar G • S à AB | BC • A à BA | a • B à CC | b • C à AB | a – w is baaba – Question Is baaba in L(G)? Constructing the Triangular Table Calculating the Bottom ROW .

.

.

.

.

.

Final Triangular Table .

A. Question • Show the CYK Algorithm with the following example: – CNF grammar G • S à AB | BC • A à BA | a • B à CC | b • C à AB | a – w is ababa – Question Is ababa in L(G)? • Basics of CYK Algorithm – The Structure of the rules in a Chomsky Normal Form grammar – Uses a “dynamic programming” or “table-filling algorithm” • Complexity O(n3) . C) then if S Є X15 then baaba Є L(G) Theorem: • The CYK Algorithm correctly computes X i j for all i and j.Result • Is baaba in L(G)? Yes We can see the S in the set X1n where ‘n’ = 5 We can see the table the cell X15 = (S. thus w is in L(G) if and only if S is in X1n. • The running time of the algorithm is O(n 3).

- Automata 2Uploaded bywest_lmn
- AI_Lecture_9Uploaded byArsalan Ahmed
- Facts PDF FilesUploaded byKim
- Hacking ErlangUploaded byapi-26318246
- lec5Uploaded bySon Bon
- THEORY OF COMPUTER SCIENCEUploaded byjoshi_sachin
- A haskell study of map warUploaded bywar3map
- SPUploaded byHema Kuppi
- Identification of Brain Regions Related to Alzheimers' Diseases using MRI Images Based on Eigenbrain and K-means ClusteringUploaded byantonytechno
- Assignment of Cells to Switches Using Firefly AlgorithmUploaded byIAEME Publication
- 38300_BAM_AS2Uploaded byTrupti Wanare
- Grammar - LatestUploaded byMuhammad Fadzreen
- Group 4Uploaded byCam Manh Vu
- DECISION MATHEMATICS 2010Uploaded byMohammad Falakhuddin
- Wrapper GenerationUploaded bySuyash Tiwari
- Ch0 OutlinesUploaded byWang Si Qi
- 21_oktober_2010Uploaded byNugrafindo Yanto
- FEM LectureUploaded bySampathNarayanan
- AssignmentModelProblem1Solution_HungarianAlgorithmUploaded bySyed Zain Ul Hassan
- Lb 2519271931Uploaded byAnonymous 7VPPkWS8O
- Class 15Uploaded byDarya Memon
- PCDUploaded byAkash Vishal
- Form 5 Test 1 KeyUploaded byMildred C. Walters
- z-aalg10Uploaded bySurangma Parashar
- gate SIGNALS-and-SYSTEMS.pdfUploaded byramlakhan
- Bastc Simulation LabUploaded byravibabukancharla
- L11_OptimizationUploaded byJesús C. Prado
- Discrete DifferentiatorUploaded byAnsari Rehan
- ClusteringUploaded byamrajee
- Remapping algorithms: application to trimming operations in sheet metal formingUploaded byMarta Oliveira

- Esmonde slides.pptxUploaded bygkgj
- Flower_Pollination_Algorithm_A_Novel_App.pdfUploaded bygkgj
- Multiobjective Reliability RedundancyUploaded bygkgj
- d05026Uploaded bygkgj
- Flower_Pollination_Algorithm_A_Novel_App (1).pdfUploaded bygkgj
- Brochure Linear AlgrabraUploaded bygkgj
- 1-8Uploaded bygkgj
- ProceedingsUploaded bygkgj
- Vol4 Iss3 344 - 349 Optimized Solution of Pressure VessUploaded bygkgj
- PA6 steelUploaded bygkgj
- Template MS Word (1)Uploaded bygkgj
- IJAET - final 4.4.16Uploaded bygkgj
- Innovative ECE Final projects list 2013 Sooxma.pdfUploaded bygkgj
- Esmonde slides.pptxUploaded bygkgj
- Cuckoo Search LiteratureUploaded bygkgj
- BBO AlgorithmUploaded bygkgj
- An Adjustable Grouping Genetic Algorithm for IntegratedUploaded bygkgj
- KOM May2014Uploaded bygkgj
- data clustering approach reliability.pdfUploaded bygkgj
- Dry Sliding Wear Characteristics of Glass Epoxy Silicon CarbideUploaded bygkgj
- Location and Allocation DecisionUploaded bygkgj
- Fluid mechanics by R K Bansal PDFUploaded bygkgj
- Dynamics of Machinery-qbUploaded bygkgj
- A Modified Real Coded Genetic Algorithm for ConstrainedUploaded bygkgj
- SyllabusandSchemeICTMRevision6.2ason31.10.2015Uploaded bygkgj
- SampleProblemsFinalAnswers.epdfUploaded bygkgj
- Location and Allocation Decisionin supply chain manangementUploaded bygkgj
- biobjective optimizationUploaded bygkgj
- Ppt Mech 5sem AHPUploaded bygkgj