Dictionary Search and Update by P Systems with String-Objects and Active Membranes
Abstract
Membrane computing is a formal framework of distributed parallel computing. In this paper we implement working with the prefix tree by P systems with strings and active membranes.
Full text
Dic iona y Sea ch and Upda e by P Sys ems wi h
S ing-Objec s and Ac i e Memb anes
A iom Alhazo 2,1, S e lana Cojoca u1, Ludmila Malaho a1,
Yu ii Rogozhin3,1
1Ins i u e o Ma hema ics and Compu e Science
Academy o Sciences o Moldo a, Academiei 5, Chi¸sin˘au MD-2028 Moldo a
{a iom,s e a,mal, ogozhin}@ma h.md
2IEC, Depa men o In o ma ion Enginee ing, G adua e School o Enginee ing
Hi oshima Uni e si y, Higashi-Hi oshima 739-8527 Japan
3Ro i a i Vi gili Uni e si y, Resea ch G oup on Ma hema ical Linguis ics
Pl. Impe ial T`a aco 1, Ta agona 43005 Spain
Summa y. Memb ane compu ing is a o mal amewo k o dis ibu ed pa allel compu -
ing. In his pape we implemen wo king wi h he p e ix ee by P sys ems wi h s ings
and ac i e memb anes.
1 In oduc ion
Sol ing mos p oblems o na u al language p ocessing is based on using ce ain
linguis ic esou ces, ep esen ed by co po a, lexicons, e c. Usually, hese collec ions
o da a cons i u e an eno mous olume o in o ma ion, so p ocessing hem equi es
much compu a ional esou ces. A easonable app oach o ob aining e icien solu-
ion is ha based on applying pa allelism; i has s a ed o be p omo ed al eady
in 1970s. Fo ins ance, he possibili ies o applying massi e pa allelism in Machine
T ansla ion a e conside ed in [4, 1]. We men ion ha many o he s ages o ex
p ocessing ( om okeniza ion, segmen a ion, lema izing o hose dealing wi h na -
u al language unde s anding) can be ca ied ou by pa allel me hods. This jus i ies
he in e es o applying me hods o e ed by he biologically inspi ed models, and
by memb ane compu ing in pa icula .
Howe e , he e a e some issues ha by hei na u e do no allow comple e
pa alleliza ion, ye exac ly hey a e o en hose “compu a ional p imi i es” ha
a e ine i ably used du ing sol ing majo p oblems, like he elemen a y a i hme ic
ope a ions a e always p esen in sol ing di icul compu a ional p oblems. Among
such “p imi i es” in he compu a ional linguis ics he e a e handling o he dic io-
na ies, e.g., dic iona y lookup and dic iona y comple ion. Exac ly hese p oblems
cons i u e he subjec o he p esen pape . In ou app oach we speak abou dic-
iona y ep esen ed by a p e ix ee.
2 A. Alhazo e al.
Memb ane sys ems a e a con enien amewo k o desc ibing compu a ions on
ees. Since memb ane sys ems a e an abs ac ion o li ing cells, he memb anes
a e a anged hie a chically, yielding a ee s uc u e.
2 De ini ions
Memb ane compu ing is a ecen domain o na u al compu ing s a ed by Gh. P˘aun
in [2]. The componen s o a memb ane sys em a e a cell-like memb ane s uc u e, in
he egions o which one places mul ise s o objec s which e ol e in a synch onous
maximally pa allel manne acco ding o gi en e olu ion ules associa ed wi h he
memb anes. The necessa y de ini ions a e gi en in he ollowing subsec ion; see
also [3] o an o e iew o he domain and [5] o he comp ehensi e bibliog aphy.
2.1 Compu ing by P sys ems
Le Obe a ini e se o elemen s called symbols; he se o wo ds o e Ois deno ed
by O∗, and he emp y wo d is deno ed by λ.
De ini ion 1. A P sys em wi h s ing-objec s and inpu is a uple
Π=¡O, Σ, H, E, µ, M1,· · · , Mp, R, i0¢, whe e:
•Ois he wo king alphabe o he sys em whose elemen s a e called objec s.
•Σis an inpu alphabe .
•His an alphabe whose elemen s a e called labels.
•Eis he se o pola iza ions.
•µis a memb ane s uc u e (a oo ed ee) consis ing o pmemb anes injec i ely
labeled by elemen s o H.
•Miis an ini ial mul ise o s ings o e Oassocia ed wi h memb ane i,1≤i≤
p.
•Ris a ini e se o ules de ining he beha io o objec s om Oand memb anes
labeled by elemen s o H.
•i0iden i ies he inpu egion.
A con igu a ion o a P sys em is i s “snapsho ”, i.e., he cu en memb ane
s uc u e and he mul ise s o s ings o objec s p esen in egions o he sys em.
While ini ial con igu a ion is C0= (µ, M1,···, Mp), each subsequen con igu a ion
C0is ob ained om he p e ious con igu a ion Cby maximally pa allel applica ion
o ules o objec s and memb anes, deno ed by C⇒C0(no u he ules a e
applicable oge he wi h he ules ha ans o m Cin o C0). A compu a ion is
hus a sequence o con igu a ions s a ing om C0, espec ing ela ion ⇒and
ending in a hal ing con igu a ion (i.e., such one ha no ules a e applicable).
I Mis a mul ise o s ings o e he inpu alphabe Σ⊆O, hen he ini ial
con igu a ion o a P sys em Πwi h an inpu Mo e alphabe Σand inpu egion
i0is
(µ, M1,· · · , Mi0−1, Mi0∪M, Mi0+1,· · · , Mp).
Dic iona y Sea ch by P Sys ems wi h S ing-Objec s 3
2.2 P sys ems wi h ac i e memb anes
To speak abou P sys ems wi h ac i e memb anes, we need o speci y he ules,
i.e., he elemen s o he se Rin he desc ip ion o a P sys em.
Due o he na u e o he p oblem o his pape , he s anda d model was gen-
e alized in he ollowing:
•Coope a i e ules: a ule can conside consecu i e symbols in a s ing (o he -
wise, he ime complexi y would be much highe ).
•S ing eplica ion ( o e u n he esul wi hou emo ing i om he dic io-
na y).
•Memb ane c ea ion ( o add wo ds o he dic iona y).
Hence, he ules can be o he ollowing o ms:
(a∗) [ a→b]e
h,
o h∈H, e ∈E, a, b ∈O∗
(e olu ion ules, associa ed wi h memb anes and depending on he label and
he pola iza ion o he memb anes, bu no di ec ly in ol ing he memb anes,
in he sense ha he memb anes a e nei he aking pa in he applica ion o
hese ules no a e hey modi ied by hem);
(a∗
) [ a→b||c]e
h,
o h∈H, e ∈E, a, b, c ∈O∗
(like he p e ious case, bu wi h s ing eplica ion);
(b∗)a[ ]e1
h→[b]e2
h,
o h∈H, e1, e2∈E, a, b ∈O∗
(communica ion ules; an objec is in oduced in o he memb ane; he objec
can be modi ied du ing his p ocess, as well as he pola iza ion o he memb ane
can be modi ied, bu no i s label);
(c∗) [ a]e1
h→[ ]e2
hb,
o h∈H, e1, e2∈E, a, b ∈O∗
(communica ion ules; an objec is sen ou o he memb ane; he objec can
be modi ied du ing his p ocess; also he pola iza ion o he memb ane can be
modi ied, bu no i s label);
(d∗) [ a]e
h→b,
o h∈H, e ∈E, a, b ∈O
(dissol ing ules; in eac ion wi h an objec , a memb ane can be dissol ed,
while he objec speci ied in he ule can be modi ied);
(g∗) [ a→[b]e2
g]e1
h,
o g, h ∈H, e1, e2∈E, a, b ∈O∗
(memb ane c ea ion ules; an objec is mo ed in o a newly c ea ed memb ane
and possibly modi ied).
Addi ionally, we will w i e ∅in place o some s ings on he igh -hand side o
he ules, meaning ha he en i e s ing is dele ed.
The ules o ypes (a∗),(a∗
) and (g∗) a e conside ed o only in ol e objec s,
while all o he ules a e assumed o in ol e objec s and memb anes men ioned in
4 A. Alhazo e al.
hei le -hand side. An applica ion o a ule consis s in eplacing a subs ing de-
sc ibed in he le -hand side o a s ing in he co esponding egion (i.e., associa ed
o a memb ane wi h label hand pola iza ion e o ules o ypes (a∗),(a∗
) and
(d∗), o associa ed o a memb ane wi h label hand pola iza ion e1 o ules o ype
(c∗), o immedia ely ou e o such a memb ane o ules o ype (b∗) ), by a s ing
desc ibed in he igh -hand side o he ule, mo ing he s ing o he co esponding
egion ( ha can be he same as he sou ce egion immedia ely inne o immedi-
a ely ou e , depending on he ule ype), and upda ing he memb ane s uc u e
acco dingly i needed (changing memb ane pola iza ion, c ea ing o dissol ing a
memb ane).
The ules can only be applied simul aneously i hey in ol e di e en objec s
and memb anes (we epea ha ules o ype (a) a e no conside ed o in ol e a
memb ane), and such pa allelism is maximal i no u he ules a e applicable o
objec s and memb anes ha we e no in ol ed.
3 Dic iona y
Dic iona y sea ch ep esen s compu ing a s ing- alued unc ion
{ui−→ i|1≤i≤d}
de ined on a ini e se o s ings.
We ep esen such a dic iona y by he skin memb ane con aining he memb ane
s uc u e co esponding o he p e ix ee o {ui|1≤i≤d}, wi h s ings $ i$0in
egions co esponding o he nodes associa ed o ui. Due o echnical easons, we
assume ha o e e y l∈A1, he skin con ains a memb ane wi h label l. We also
suppose ha he sou ce wo ds a e non-emp y.
Fo ins ance, he dic iona y {ba −→ lying,bi −→ s o ed}is ep esen ed by
[ [ ]0
a[[[$ lying$0]0
]0
a[[$s o ed$0]0
]0
i]b[ ]0
c· · · [ ]0
z]0
0
Le A1, A2be he alphabe s o he sou ce and a ge languages, espec i ely.
Conside a P sys em co esponding o he gi en dic iona y.
Π=¡O, Σ, H, E, µ, M1,· · · , Mp, R, i0¢,
O=A1∪A2∪ {?,?0,$,$0,$1,$2, ail} ∪ {?i|1≤i≤11}∪{!i|1≤i≤4},
Σ=A1∪A2∪ {?,?0,!,$,$0},
H=A1∪ {0}, E ={0,+,−},
µand se s Mi,1≤i≤p, a e de ined as desc ibed abo e,
i0= 1,
so only he ules and inpu seman ics s ill ha e o be de ined.
Dic iona y Sea ch by P Sys ems wi h S ing-Objec s 5
3.1 Dic iona y sea ch
To ansla e a wo d u, inpu he s ing ?u?0in egion 1. Conside he ollowing
ules.
S1 ?l[ ]0
l→[?]0
l,l∈A1
P opaga ion o he inpu in o he memb ane s uc u e, eaching he loca ion co -
esponding o he inpu wo d.
S2 [ ??0]0
l→[ ]−
l∅,l∈A1
Ma king he egion co esponding o he sou ce wo d.
S3 [ $ →$1||$2]−
l,l∈A1
Replica ing he ansla ion.
S4 [ $2]e
l→[ ]0
l$2,l∈H,e∈ {−,0}
Sending one copy o he ansla ion o he en i onmen .
S5 [ $1→$ ]0
l,l∈A1
Keeping he o he copy in he dic iona y.
The sys em will send he ansla ion o uin he en i onmen . This is a simple
example illus a ing sea ch. I he sou ce wo d is no in he dic iona y, he sys em
will be blocked wi hou gi ing an answe . The ollowing subsec ion shows a solu ion
o his p oblem.
3.2 Sea ch wi h ail
The se o ules below is conside ably mo e in ol ed han he p e ious one. How-
e e , i handles 3 cases: a) he a ge wo d is ound, b) he a ge wo d is missing
in he a ge loca ion, c) he a ge loca ion is un eachable.
F1 [ ? →?1||?2]0
0
Replica e he inpu .
F2 [ ?2→?3]0
0
Delay he second copy o he inpu o one s ep.
F3 ?1l[ ]0
l→[ ?1]+
l,l∈A1
P opaga ion o he i s copy owa ds he a ge loca ion, changing he pola iza ion
o he en e ed memb ane o +.
F4 ?3l[ ]+
l→[ ?3]0
l,l∈A1
P opaga ion o he second copy owa ds he a ge loca ion, es o ing he pola -
iza ion o he en e ed memb ane.
6 A. Alhazo e al.
F5 [ ?1l→[ ?4]−
l]0
k,l, k ∈A1
I a memb ane co esponding o some symbol o he sou ce wo d is missing, hen
he i s copy o he inpu emains in he same memb ane, while he second copy
o he inpu es o es i s pola iza ion. C ea ing a memb ane o handle he ailu e.
F6 [ ?1?0→?7]0
l,l∈A1
Ta ge loca ion ound, ma king he i s inpu copy.
F7 [ ?7]0
l→[ ]−
l∅,l∈A1
Ma king he a ge loca ion.
In ei he case, some memb ane has pola iza ion −. I emains o send he
answe ou , o ail i i is absen . The memb ane should be dele ed in he ail case.
F8 [ $ →$1||$2]−
l,l∈A1
Replica ing he ansla ion.
F9 [ $2]e
l→[ ]0
l$2,l∈H,e∈ {0,−}
Sending one copy o he ansla ion ou .
F10 [ $1→$ ]0
l,l∈A1
Keeping he o he copy in he dic iona y.
F11 [ ?3→?5]−
l,l∈A1
The second copy o inpu will check i he ansla ion is a ailable in he cu en
egion.
F12 ?3l[ ]−
l→[ ?5]−
l,l∈A1
The second copy o inpu en e s he auxilia y memb ane wi h pola iza ion −.
By now he second copy o he inpu is in he egion co esponding o ei he
he sea ch wo d, o o i s maximal p e ix plus one le e (auxilia y one).
F13 [ ?5→?6]−
l,l∈A1
I wai s o one s ep.
F14 [ ?6→ ∅ ]0
l,l∈A1
I he a ge wo d has been ound, he second copy o he inpu is e ased.
F15 [ ?6]−
l→[ ]0
l?8,l∈A1
I no , he sea ch ails.
F16 [ ?8]0
l→[ ]0
l?8,l∈A1
Sending he ail no i ica ion o he skin.
F17 [ ?8l→?8]0
0
Dic iona y Sea ch by P Sys ems wi h S ing-Objec s 7
E asing he emaining pa o he sou ce wo d.
F18 [ ?8?0]0
l→[ ]0
l ail
Answe ing ail.
F19 [ ?4→?9]−
l,l∈A1
F20 [ ?9→?10 ]−
l,l∈A1
F21 [ ?10 →?11 ]−
l,l∈A1
I he a ge loca ion was no ound, he i s inpu copy wai s o 3 s eps while
he memb ane wi h pola iza ion −handles he second inpu copy.
F22 [ ?11 ]0
l→ ∅,l∈A1
E asing he auxilia y memb ane.
3.3 Dic iona y upda e
To add a pai o wo ds u−→ o he dic iona y, inpu he s ing !u$ $0in egion
1. Conside he ollowing ules.
U1 [ ! →!1||!2]0
0
Replica e he inpu .
U2 [ !2→!3]0
0
Delay he second copy o he inpu o one s ep.
U3 !1l[ ]0
l→[ !1]+
l,l∈A1
P opaga ion o he i s copy owa ds he a ge loca ion, changing he pola iza ion
o he en e ed memb ane o +.
U4 !3l[ ]+
l→[ !3]0
l,l∈A1
P opaga ion o he second copy owa ds he a ge loca ion, es o ing he pola -
iza ion o he en e ed memb ane.
U5 [ !1→!4]0
l,l∈A1
I a memb ane co esponding o some symbol o he sou ce wo d is missing, hen
he i s copy o he inpu emains in he same memb ane, while he second copy o
he inpu es o es i s pola iza ion. Ma king he is copy o he inpu o c ea ion
o missing memb anes.
U6 [ !4l→[ !4]+
l]0
k,l, k ∈A1
C ea ing missing memb anes.
U7 [ !4$→$ ]0
l,l∈A1
8 A. Alhazo e al.
Releasing he a ge wo d in he co esponding loca ion.
U8 [ !3$→ ∅ ]0
l,l∈A1
E asing he second copy o he inpu .
We unde line ha he cons uc ions p esen ed abo e also hold in a mo e gen-
e al case, i.e., when he dic iona y is a mul i- alued unc ion. Indeed, mul iple
ansla ions can be added o he dic iona y as mul iple s ings in he egion as-
socia ed o he inpu wo d. The sea ch o a wo d wi h mul iple ansla ions will
lead o all ansla ions sen o he en i onmen . The p ice o pay is ha he con-
s uc ion is no longe de e minis ic, since he o de o applica ion o ules S4 o
F9 o di e en ansla ions is a bi a y. Ne e heless, he cons uc ions emain
“de e minis ic modulo he o de in which he ansla ions a e sen ou ”.
4 Discussion
In his pape we p esen ed he algo i hms o sea ching in a dic iona y and com-
ple ing i implemen ed as memb ane sys ems. We unde line ha he sys ems a e
cons uc ed as eusable modules, so hey a e sui able o using as sub-algo i hms
o sol ing mo e complica ed p oblems.
The scope o handling dic iona ies is no limi ed o he dic iona ies in he clas-
sical sense. Unde s anding a dic iona y as in oduced in Sec ion 3, i.e., a s ing-
alued unc ion de ined on a ini e se o s ings, leads o di ec applicabili y o
he p oposed me hods o handle alphabe s, lexicons, hesau a, dic iona ies o ex-
cep ions, and e en da abases.
Acknowledgmen s
All au ho s g a e ully acknowledge he suppo by he Science and Technology
Cen e in Uk aine, p ojec 4032. A iom Alhazo g a e ully acknowledges he sup-
po o he Japan Socie y o he P omo ion o Science and he G an -in-Aid o
Scien i ic Resea ch, p ojec 20·08364. Yu ii Rogozhin g a e ully acknowledges he
suppo o he Eu opean Commission, p ojec MolCIP, MIF1-CT-2006-021666.
Re e ences
1. H. Ki ano: Challenges o massi e pa allelism. P oceedings o he 13 h In e na ional
Join Con e ence on A i icial In elligence, Chambe y, F ance, 1993, ol. 1, 813–834.
2. Gh. P˘aun: Compu ing wi h memb anes. Jou nal o Compu e and Sys em Sciences,
61, 1 (2000), 108–143.
3. Gh. P˘aun: Memb ane Compu ing. An In oduc ion. Sp inge -Ve lag, 2002.
4. E. Sumi a, K. Oi, O. Fu use, H. Iida, T. Higuchi, N. Takahashi, H. Ki ano: Example-
based machine ansla ion on massi ely pa allel p ocesso s. P oceedings o he 13 h
In e na ional Join Con e ence on A i icial In elligence, Chambe y, F ance, 1993,
ol. 2, 1283–1289.
5. P sys ems webpage. h p://ppage.psys ems.eu/.