Glushkov's construction algorithm

In computer science theory – particularly formal language theoryGlushkov's construction algorithm, invented by Victor Mikhailovich Glushkov, transforms a given regular expression into an equivalent nondeterministic finite automaton (NFA). Thus, it forms a bridge between regular expressions and nondeterministic finite automata: two abstract representations of the same class of formal languages.

A regular expression may be used to conveniently describe an advanced search pattern in a "find and replace"–like operation of a text processing utility. Glushkov's algorithm can be used to transform it into an NFA, which furthermore is small by nature, as the number of its states equals the number of symbols of the regular expression, plus one. Subsequently, the NFA can be made deterministic by the powerset construction and then be minimized to get an optimal automaton corresponding to the given regular expression. The latter format is best suited for execution on a computer.

From another, more theoretical point of view, Glushkov's algorithm is a part of the proof that NFA and regular expressions both accept exactly the same languages; that is, the regular languages. The converse of Glushkov's algorithm is Kleene's algorithm, which transforms a finite automaton into a regular expression. The automaton obtained by Glushkov's construction is the same as the one obtained by Thompson's construction algorithm, once its ε-transitions are removed.

Construction

Given a regular expression e, the Glushkov Construction Algorithm creates a non-deterministic automaton that accepts the language accepted by e.[1][2]: 59–61  The construction uses four steps:

Step 1

Linearisation of the expression. Each letter of the alphabet appearing in the expression e is renamed, so that each letter occurs at most once in the new expression . Glushkov's construction essentially relies on the fact that represents a local language . Let A be the old alphabet and let B be the new one.

Step 2a

Computation of the sets , , and . The first, , is the set of letters which occurs as first letter of a word of . The second, , is the set of letters that can end a word of . The last one, , is the set of letter pairs that can occur in words of , i.e. it is the set of factors of length two of the words of . Those sets are mathematically defined by

,
,
.

They are computed by induction over the structure of the expression, as explained below.

Step 2b

Computation of the set which contains the empty word if this word belongs to , and is the empty set otherwise. Formally, this is , where denotes the empty word.

Step 3

Computation of automaton recognizing the local language, as defined by , , , and . By definition, the local language defined by the sets P, D, and F is the set of words which begin with a letter of P, end by a letter of D, and whose factors of length 2 belong to F, optionally also including the empty word; that is, it is the language:

.

Strictly speaking, it is the computation of the automaton for the local language denoted by this linearised expression that is Glushkov's construction.

Step 4

Remove the linearisation, replacing each indexed letter B by the original letter of A.

Example

Automaton constructed by Glushkov's algorithm – linear version
Automaton constructed by Glushkov's algorithm - final version

Consider[2]: 60–61  the regular expression .

  1. The linearized version is
    .
    The letters have been linearized by appending an index to them.
  2. The sets P, D, and F of the first letters, last letters, and factors of length 2 for the linear expression are respectively
    .
    The empty word belongs to the language, hence .
  3. The automaton of the local language
    contains an initial state, denoted 1, and a state for each of the five letters of the alphabet
    .
    There is a transition from 1 to the two states of P, a transition from x to y for , and the three states of D are final, and such is the state 1. All transitions to a letter y have as label the letter y.
  4. Obtain the automaton for by deleting the indices.

Computation of the set of letters

The computation of the sets P, D, F, and Λ is done inductively over the regular expression . One must give the values for ∅, ε (the symbols for the empty language and the singleton language containing the empty word), the letters, and the results of the operations .

  1. For Λ, one has
    ,
    ,
    for each letter a,
    ,
    , and
    .
  2. For P, one has
    ,
    for each letter a,
    ,
    , and
    .

    The same formulas are also used for D, except for the product where

    .
  3. For the set of factors of length 2, one has
    for each letter a,
    ,
    , and
    .

The most costly operations are the products of sets for the computation of F.

Properties

The obtained automaton is non-deterministic, and it has as many states as the number of letters of the regular expression, plus one. Furthermore, it has been shown[3]: 215 [4] that Glushkov's automaton is the same as Thompson's automaton when the ε-transitions are removed.

Applications and deterministic expressions

The computation of the automaton by the expression occurs often; it has been systematically used in search functions, in particular by the Unix grep command. Similarly, XML's specification also uses such constructions; for more efficiency, regular expressions of a certain kind, called deterministic expressions, have been studied.[4][5]

See also

Notes and references

  1. ^ V.M. Glushkov (1961). "The abstract theory of automata". Russian Mathematical Surveys (in Russian). 16 (5): 1–53. Bibcode:1961RuMaS..16....1G. doi:10.1070/rm1961v016n05abeh004112. S2CID 250833514.
  2. ^ a b Jean-Éric Pin (Nov 2016). Mathematical Foundations of Automata Theory (PDF). Paris.{{cite book}}: CS1 maint: location missing publisher (link)
  3. ^ Jacques Sakarovitch (Feb 2003). Éléments de théorie des automates. Paris: Vuibert. ISBN 978-2711748075.
  4. ^ a b Jacques Sakarovitch (2009). Elements of Automata Theory. Cambridge: Cambridge University Press. ISBN 9780521844253.
  5. ^ Brüggemann-Klein, Anne (1993). "Regular Expressions into Finite Automata". Theoretical Computer Science. 12 (2): 197–213. doi:10.1016/0304-3975(93)90287-4.

Read other articles:

See also: List of casual dining restaurant chains This is a dynamic list and may never be able to satisfy particular standards for completeness. You can help by adding missing items with reliable sources. The following is a list of restaurant chains. International Name Known for Parent company First store location Founded Locations worldwide Employees Related restaurants 85°C Bakery Cafe Baked goods Taipei, Taiwan 2004 1000+ Applebee's American DineEquity Decatur, Georgia 1980 1830 31,500 A...

 

Joe GilgunGilgun di San Diego Comic-Con International 2017 mempromosikan Preacher.LahirJoseph William Gilgun9 Maret 1984 (umur 40)Chorley, Lancashire, InggrisKebangsaanBritania RayaPekerjaanPemeranTahun aktif1984–kini Joseph William Gilgun (lahir 9 Maret 1984) adalah seorang pemeran Inggris yang dikenal karena beberapa peran, yang meliputi Vinnie O'Neill dalam seri Sky One Brassic, Eli Dingle dalam sinetron ITV Emmerdale, Jamie Armstrong dalam sinetron ITV Coronation Street, Wood...

 

Australian politician The HonourableNgaree Ah KitMLAAh Kit in 2015Minister for Corporate and Digital Development, International Education, Disabilities and Multicultural AffairsIncumbentAssumed office 23 May 202213th Speaker of the Northern Territory Legislative AssemblyIn office20 August 2020 – 23 May 2022DeputyMark Turner (2020–21)Joel Bowden (2021–2022)Preceded byChansey PaechSucceeded byMark MonaghanMember of the Northern Territory Legislative Assemblyfor KaramaIncumben...

American film editor Gene RuggieroJames Stewart and Margaret Sullavan in The Shop Around the Corner (1940)BornGene S. Ruggiero(1910-06-20)June 20, 1910Long Island, New YorkDiedFebruary 19, 2002(2002-02-19) (aged 91)Ogden, UtahOccupationFilm editorSpouseEva Nohavka (1966–1988, divorced) Gene S. Ruggiero (June 20, 1910 – February 19, 2002) was an American film editor. Originally a golf caddy at an exclusive New York country club, Ruggiero was fired from his job and later went to Metro-...

 

A season of the Copa-Peru leagueFootball league seasonCopa PerúSeason1977ChampionsAtlético TorinoTop goalscorerHumberto Correa (6)← 1976 1978 → The 1977 Copa Perú season (Spanish: Copa Perú 1977), the promotion tournament of Peruvian football. In this tournament after many qualification rounds, each one of the 24 departments in which Peru is politically divided, qualify a team. Those teams plus de team relegated from First Division on the last year, enter in two more rounds and finall...

 

United States historic placeHarriman City HallU.S. National Register of Historic Places Postcard depicting Temperance HallShow map of TennesseeShow map of the United StatesLocationRoane and Walden Sts., Harriman, TennesseeCoordinates35°56′02″N 84°33′06″W / 35.9340°N 84.5516°W / 35.9340; -84.5516Area1 acre (0.40 ha)Built1890Built byEast Tennessee Land Co.NRHP reference No.71000828[1]Added to NRHPApril 16, 1971 American Temperance Unive...

British architect (1920–2019) Sir William WhitfieldBorn(1920-10-21)21 October 1920Stockton-on-Tees, EnglandDied16 March 2019(2019-03-16) (aged 98)Alma materKing's College, Durham UniversityOccupation(s)Architect and town planner Sir William Whitfield CBE (21 October 1920 – 16 March 2019)[1] was a British architect and town planner. Early life Whitfield was born in Stockton-on-Tees into a coal-owning family and studied architecture at King's College, Newcastle (later the ...

 

Mieszko IAdipati PolandiaPotret imajiner oleh Jan Matejko.Berkuasatahun 962–992PendahuluSiemomysłPenerusBolesław IPemakamanBasilika Katedral Santo Petrus dan Santo Paulus, Poznań, PolandiaAyahSiemomysłIbuGorka[1][2]AnakDengan Dobrawa:Bolesław I Świętosława, Ratu Swedia, Denmark, Norwegia dan Inggris Putri, Putri Pommern (?) Vladivoj dari Bohemia (?) Dengan Oda:Mieszko Świętopełk Lambert Mieszko I (tahun 930 – 25 Mei 992),[3] merupakan seorang adipati Pol...

 

American judge Walter A. HuxmanSenior Judge of the United States Court of Appeals for the Tenth CircuitIn officeApril 1, 1957 – June 25, 1972Judge of the United States Court of Appeals for the Tenth CircuitIn officeMay 23, 1939 – April 1, 1957Appointed byFranklin D. RooseveltPreceded byRobert L. WilliamsSucceeded byJean Sala Breitenstein27th Governor of KansasIn officeJanuary 11, 1937 – January 9, 1939LieutenantWilliam M. LindsayPreceded byAlf LandonSuccee...

историческое государство ИмперияЯпонская империяяп. 大日本帝國 Флаг Императорская печать Гимн: «Кими га ё» Японская империя в 1942 году     Япония (1870—1905)      Колонии     Оккупированные территории (1932—1945) ↓ ↓ 3 января 1868 (29 ноября 1890) — 2 сентяб...

 

Material created by tanning kangaroo skin Kangaroo leather is a strong, lightweight leather derived from the hide of the kangaroo. Kangaroos are harvested.[1][2] Both the meat and the hides are sold. Although hunting most species of macropod is prohibited, a small number of the large-sized species with high populations can be hunted by commercial hunters.[3] This policy has been criticised by some wildlife activists.[4] Applications Whip made of kangaroo leathe...

 

75th season of the second-tier football league in Spain This article has no lead section. Please improve this article by adding one in your own words. (September 2021) (Learn how and when to remove this message) Football league seasonSegunda DivisiónSeason2005-06ChampionsRecreativo HuelvaPromotedRecreativo NàsticLevante UDRelegatedUE LleidaRacing FerrolMálaga BEibarMatches played462Goals scored1,061 (2.3 per match)Top goalscorer Ikechukwu Uche José Juan Luque← 2004–05 2006–07 �...

Piozzo komune di Italia Tempat Negara berdaulatItaliaDaerah di ItaliaPiemonteProvinsi di ItaliaProvinsi Cuneo NegaraItalia Ibu kotaPiozzo PendudukTotal990  (2023 )GeografiLuas wilayah14,3 km² [convert: unit tak dikenal]Ketinggian327 m Berbatasan denganBene Vagienna Carrù Farigliano Lequio Tanaro SejarahSanto pelindungStefanus Informasi tambahanKode pos12060 Zona waktuUTC+1 UTC+2 Kode telepon0173 ID ISTAT004169 Kode kadaster ItaliaG697 Lain-lainSitus webLaman resmi Piozzo adalah ko...

 

2010 UK local government election Map of the results of the 2010 Barnsley council election. The 2010 Barnsley Metropolitan Borough Council election took place on 6 May 2010 to elect members of Barnsley Metropolitan Borough Council in South Yorkshire, England. One third of the council was up for election and the Labour party stayed in overall control of the council.[1] After the election, the composition of the council was Labour 37 Barnsley Independent Group 18 Conservative 6 Liberal ...

 

1950 Maine gubernatorial election ← 1948 September 11, 1950 1952 →   Nominee Frederick G. Payne Earle S. Grant Party Republican Democratic Popular vote 145,823 94,304 Percentage 60.73% 39.27% County resultsPayne:      50–60%      60–70%      70–80% Governor before election Frederick G. Payne Republican Elected Governor Frederick G. Payne Republican The 1950 Maine gubernatorial ele...

Former railway station in Nottinghamshire, England SouthwellSouthwell railway station building in 2008General informationLocationSouthwell, Newark and Sherwood, NottinghamshireEnglandGrid referenceSK705544Platforms2Other informationStatusDisusedHistoryPre-groupingMidland RailwayPost-groupingLondon, Midland and Scottish RailwayKey dates1 July 1847Opened1871Rebuilt in stone15 June 1959Closed to passengers7 December 1964Closed for freight Southwell railway station served the town of Southwell in...

 

Shopping mall in South Carolina, United StatesHaywood MallEntrance to Haywood Mall, October 2012LocationGreenville, South Carolina, United StatesCoordinates34°51′00″N 82°20′00″W / 34.85°N 82.333333°W / 34.85; -82.333333Opening dateJuly 30, 1980DeveloperHaywood Mall AssociatesManagementSimon Property GroupOwnerSimon Property GroupNo. of stores and services172No. of anchor tenants5 (4 open, 1 vacant)Total retail floor area1,237,411 sq ft (114,959.2&...

 

American novelist For the women's basketball coach, see Rick Moody (coach). Rick MoodyMoody in Lyon, France - May 2009BornHiram Frederick Moody III (1961-10-18) October 18, 1961 (age 62)New York City, U.S.Occupation Novelist short story writer essayist composer professor EducationSt. Paul's SchoolBrown UniversityColumbia University (MFA)Period1992–present Hiram Frederick Moody III (born October 18, 1961) is an American novelist and short story writer best known for the 1994 novel The I...

Il teorema di nullità più rango. In algebra lineare, il teorema del rango, detto anche teorema di nullità più rango, o teorema della dimensione, afferma che la somma tra la dimensione dell'immagine e la dimensione del nucleo di una trasformazione lineare è uguale alla dimensione del dominio di tale trasformazione lineare; equivalentemente, la somma del rango e della nullità di una matrice è uguale al numero di colonne della matrice. Indice 1 Enunciato 2 Dimostrazione 3 Dimostrazione co...

 

Non-centralized group of legal experts and intellectuals in China Weiquan movementSimplified Chinese维权运动Traditional Chinese維權運動Literal meaningprotect rights movementTranscriptionsStandard MandarinHanyu PinyinWéiquán Yùndòng Rights Theoretical distinctions Claim rights and liberty rights Individual and group rights Natural rights and legal rights Negative and positive rights Human rights Civil and political Economic, social and cultural Three generations Rights by...