HAL Id: hal-00859355
https://hal.archives-ouvertes.fr/hal-00859355
Submitted on 6 Sep 2013
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of
sci-entific research documents, whether they are
pub-lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Regular Temporal Cost Functions
Thomas Colcombet, Denis Kuperberg, Sylvain Lombardy
To cite this version:
Thomas Colcombet, Denis Kuperberg, Sylvain Lombardy. Regular Temporal Cost Functions.
Inter-national Colloquium on Automata, Languages and Programming (ICALP), 2010, Bordeaux, France.
pp.563-574. �hal-00859355�
ThomasCol ombet
1
, DenisKuperberg1
,SylvainLombardy2
1
Liafa/CNRS/UniversitéParis 7,DenisDiderot,Fran e
2
Ligm-UniversitéParis-EstMarne-la-Vallée, Fran e
Abstra t. Regular ostfun tionshavebeenintrodu ed re entlyas an exten-siontothenotionofregularlanguageswith ounting apabilities,whi hretains strong losure, equivalen e,and de idabilityproperties.Thespe i ity of ost fun tionsisthatexa tvaluesarenot onsidered,butonlyestimated.
In this paper, we studythe stri tsub lassof regular temporal ost fun tions. Insu h ostfun tions,itisonlyallowedto ountthenumberofo urren esof onse utiveevents.Forthisreason,thismodelintendstomeasurethelengthof intervals,i.e.,adis retenotionoftime.Weprovidevariousequivalent represen-tations forfun tionsinthis lass,usingautomata,and` lo kbased'redu tion toregularlanguages.Weshowthatthe onversionsaremu hsimplertoobtain, andmu hmoree ientthaninthegeneral aseofregular ostfun tions. Ourse ondaiminthispaperistousetemporal ostfun tionasatest- asefor exploringthealgebrai natureof regular ostfun tions.Following theseminal ideasofS hützenberger,thisresultsinade idablealgebrai hara terizationof regulartemporal ostfun tionsinsidethe lassofregular ostfun tions.
1 Introdu tion
Sin etheseminal works ofKleene [Kle56℄ andRabin andS ott [RS59℄, thetheoryof regularlanguagesisoneofthe ornerstonesin omputers ien e.Regularlanguageshave manygoodproperties, of losure, of equivalent hara terizations,and of de idability, whi h makesthem entralin manysituations.
Re ently, the notion of regular ost fun tion for words has been presented as a andidateforbeingaquantitativeextensiontothenotionofregularlanguages[Col09 ℄, while retainingmostof thefundamental properties oftheoriginal theorysu h asthe losure properties, the various equivalent hara terizations, and the de idability. A ost fun tion is an equivalen e lass of thefun tions from the domain (wordsin our ase) to
N
∞
, modulo an equivalen e relation≈
whi h allows some distortion, but preservestheboundedness propertyoverea h subsetofthedomain. Themodelisan extensiontothenotionoflanguagesinthefollowingsense:one anidentifyalanguage withthefun tionmappingea hwordinsidethelanguageto0
,andea hwordoutside thelanguageto∞
. It isastri t extension sin eregular ostfun tions have ounting apabilities, e.g., ountingthenumberofo urren esofletters, measuringthelength ofintervals,et ...Related worksand motivatingexamples
Regular ostfun tions arethe ontinuationofasequen eofworksthat haveintended to solve di ult questions in language theory. The prominent example is the star-heightproblem:givenaregularlanguage
L
andanintegerk
,de idewhetherL
anbe expressed using a regular expression using at mostk
-nestingof Kleene stars. It wasre entlyproposedbyKirsten[Kir05℄. Thetwoproofsworkalongthesamelines:show thattheoriginalproblem anberedu edtotheexisten eofaboundoversomefun tion fromwordstointegers.Thisfun tion anberepresentedusinganautomatonthathave ountingfeatures (adistan e automatonfor Hashigu hi,and anesteddistan edesert automaton for Kirsten). The proof is on luded by showing that su h boundedness problemsarede idable.
Otherde isionproblems analsoberedu edtoboundednessquestions overwords: in languagetheorythenite powerproperty [Sim78,Has79℄ andthenite substitution problem[Bal04,Kir04℄,andinmodeltheorytheboundednessproblemofmonadi formu-lasoverwords[BOW09℄.Distan eautomataarealsoused inthe ontextofdatabases andimage ompression.AutomatasimilartotheonesofKirstenhavealsobeen intro-du edindependentlyinthe ontextofveri ation[AKY08℄.
Finally, using also ideasinspiredfrom [BC06℄, the theoryof those automata over wordshasbeenuniedin[Col09 ℄,inwhi h ostfun tionsareintrodu ed,andsuitable models of automata, algebra, and logi for dening them are presented and shown equivalent. Correspondingde idabilityresults areprovided. Theresulting theoryis a neat extension of the standardtheory of regularlanguages to aquantitative setting. All the limitedness problems from theliterature appear asspe ial instan es of those results,aswellasallthe entralresultsknownforregularlanguages.
Contributions
We introdu e thesub lass of regular temporal ost fun tions.Regular temporal ost fun tionsareregular ostfun tionsinwhi hone anonly ount onse utiveevents:for instan e,overthealphabet
{a, b},
themaximallengthofasequen eof onse utive let-tera
'sistemporal,whilethenumberofo urren esoflettera
isnot.This orresponds to the model of desert automata introdu ed by Kirsten [Kir04℄. We believe that the notionofregulartemporal ostfun tionisofinterestinthe ontextofmodelizationof time.We show that regular temporal ost fun tions admit various equivalent presenta-tions.Therstsu hrepresentationisobtainedasasynta ti restri tionofB-automata andS-automata(theautomatausedfordes ribingregular ostfun tions[Col09 ℄). Se -ond,weprovideanequivalent lo k-based presentation,inwhi htheregulartemporal ostfun tionsisrepresentedasaregularlanguageoverwordslabeledwiththeti ksof a lo kasan extrainformation. Weshowallthe losure resultsforregular temporal ostfun tions(e.g.,min,max,et ...)usingthispresentation.Asopposedtothegeneral theoryof regular ostfun tions,allthose resultsare obtainedbyatranslationtothe theoryofregularlanguages.Thisresultsin onstru tionsofbetter omplexity,bothin termsofnumberofstatesofautomata,andintermsofte hni alityofthe onstru tions themselves.Lastbutnotleast,whileinthegeneraltheoryofregular ostfun tionsthe error ommitted during the onstru tionis bounded by apolynomial,it is linearfor regulartemporal ostfun tions.
Our se ond ontributionis analgebrai hara terization of this lass. It is known from [Col09 ℄ that regular ost fun tions are the one re ognizable by stabilization monoids.Thismodelofmonoidsextendsthestandardapproa hforlanguages.Oneof ourobje tivesin studyingregular temporal ost fun tion wasto validatethe interest ofthisalgebrai approa h,andshowthatresultssimilartothefamousS hützenberger theorem on star-free languages [S h65℄ were possible. We believe that we su eeded in this dire tion, sin e we are able to algebrai ally hara terize the lass of regular
After somenotations,we present ost fun tions and ost automata in Se tion 2,and introdu e the sub lass of regular temporal ost fun tions. In Se tion 3 we propose a lo k-basedpresentation to temporal ost fun tions, and advo atesome of its ad-vantages. In Se tion 4 we present the algebrai formalism and sket h our algebrai hara terizationforregulartemporal ostfun tions.Wenally on lude.
Notations
We will note
N
the set of non-negative integers andN
∞
the setN ∪ {∞}
, ordered by0 < 1 < · · · < ∞
.IfE
isaset,E
N
isthesetof innitesequen esof elementsof
E
(wewillnotuseherethenotionof innitewords).Su h sequen eswillbedenotedby boldletters (a
,b
,...). We will work with axed nite alphabetA
. The set of words overA
isA
∗
. The empty word
ǫ
, andA
+
= A
∗
\ {ǫ}
. The on atenation of words
u
andv
isuv
.Thelengthofu
is|u|
.Thenumberofo urren esoflettera
inu
is|u|
a
.We willnoteinf E
andsup E
thelowerandupperbounds ofasetE ⊆ N
∞
,in parti ularinf ∅ = ∞
andsup ∅ = 0
.2 Regular ost fun tions
Thetheoryofregular ostfun tionshasbeenproposedin [Col09 ℄.Inthisse tion,we reviewsomeofthedenitionsusefulforthepresentpaper.
2.1 Basi son ost fun tions
Theprin ipleof ostfun tionsisto onsiderfun tionsmoduloanequivalen erelation
≈
allowingsomedistortionsofthevalues.Thisdistortionis ontrolledusingaparameter (α, α
′
, α
1
. . .
)whi hisamappingfromN
toN
su hthatα(n) ≥ n
foralln
, alledthe orre tion fun tion.Forx, y ∈ N
∞
,x 4
α
y
meansthat eitherx
andy
areinN
andx ≤ α(y)
, ory = ∞
. It is equivalent to write thatx ≤ α(y)
in whi h weimpli itly extendα
toN
∞
byα(∞) = ∞
. ForallsetsE
,4
α
isnaturallyextendedto mappings fromE
toN
∞
byf 4
α
g
iff (x) 4
α
g(x)
forallx ∈ E
,orequivalentlyiff ≤ α ◦ g
(using thesameexpli itextensionofα
).Theintuitionhereisto onsiderthatg
dominatesf
upto a`stret hingfa tor'α
. Wenotef ≈
α
g
iff 4
α
g
andg 4
α
f
.Finally, wenotef 4g
(resp.f ≈g
)iff 4
α
g
(resp.f ≈
α
g
)forsomeα
.A ostfun tion (overasetE
)is anequivalen e lass of≈
amongthesetoffun tions fromE
toN
∞
.Therelation
4
hasother hara terizations:Proposition 1 For allfun tions
f, g : E → N
∞
,the following itemsareequivalent:f 4 g
,Forall
X ⊆ E
,g
boundedoverX
impliesf
boundedoverX
.Thelast hara terizationshowsthat
≈
preservestheexisten eofbounds.Toea hsubset
X ⊆ E
,oneasso iatesits hara teristi mappingχ
X
fromE
toN
∞
whi h tox
asso iates0
ifx ∈ X
, and∞
otherwise. It is easy to see thatX ⊆ Y
iχ
X
< χ
Y
. Inthis way, thenotionof ost fun tions anbeseenasanextension toInthis se tion, wewill des ribe howsomefun tions from
A
∗
to
N
∞
anbe a epted by ertainformsofautomatausing ountersofvalueranginginN
.Wenamesu h ost fun tions`regular'.A ostautomaton isatuple
hQ, A, In, Fin, Γ, ∆i
whereQ
isanitesetofstates,A
isanitealphabet,In
andFin
are theset ofinitial and nal statesrespe tively,Γ
is aniteset of ounters,and∆ ⊆ Q × A × ({i, r, c}
∗
)
Γ
× Q
istheset oftransitions. Thevalueofea h ounterrangesover
N
,andevolvesa ordingtoatomi a tions in{i, r, c}
:i
in rementsthevalueby1
,r
resets thevalueto0
,andc
he ksthevalue(but does not hange it). Ea h a tion in({i, r, c}
∗
)
Γ
tells for ea h ounter what sequen e ofatomi a tionshasto beperformed. Hen e,givenasequen eof a tions
u
, one an exe uteitasfollows:atthe begining, all ounters sharethe value0
, andwereadthe wordu
letterbyletterfromlefttoright.Forea hletter,oneappliesthe orresponding sequen e ofatomi a tionson ea h ounter. One setsthe setC(u)⊆ N
to ontainall valuesthataretakenbya ounterwhen he ked(thisset olle tsallthe he kedvalues indistin tly:there is nodistin tion on erningthe ounter thevalue originatesfrom, orthemomentofthe he k).Arun
σ
of a ostautomatonoveraworda
1
. . . a
n
isasequen ein∆
∗
oftheform
(q
0
, a
1
, t
1
, q
1
)(q
1
, a
2
, t
2
, q
2
) . . . (q
n−1
, a
n
, σ
n
, q
n
)
su h thatq
0
is initial,q
n
is nal (the runε
isalsovalidithereexistsq
0
,bothinitialandnal).OnesetsC(σ)= C(t
1
. . . t
n
)
, i.e.,to olle tthesetofvalues he kedwhenexe utingtherunoverthe ounters.Atthis point, ostautomata areinstantiated intwoversions,namely
B
-automata andS
-automata thatdiersbytheirdualsemanti s,[[·]]
B
and[[·]]
S
respe tively.These semanti s aredenedforallu ∈ A
∗
by:
[[A]]
B
(u) = inf{sup C(σ) : σ
runoveru} ,
and[[A]]
S
(u) = sup{inf C(σ) : σ
runoveru} .
(Re all that
sup ∅ = 0
andinf ∅ = ∞
) One says that a B-automaton (resp. an S-automaton)a epts[[A]]
B
(resp.[[A]]
S
).Example 1. If
A
isastandardnon-deterministi automatona eptingL ⊆ A
∗
, it an beseen as a ost automatonwithout any ounter. Seen asa B-automaton,we have
[[A]]
B
(u) = χ
L
,andseenasanS
-automaton,[[A]]
S
(u) = χ
A
∗
\L
.Example 2. Wedes ribethetwoone ounter ostautomata
A
andA
′
bydrawings:a : ic
b : r
a, b : ǫ
b : ǫ
a : i
a, b : cr
a, b : ǫ
Cir lesrepresentstates,and atransition
(p, a, t, q)
is denoted byanedge fromp
toq
labeleda : t
(the notationa, b : t
abbreviatesmultiple transitions). Initial statesare identiedbyunlabeledingoingarrows,whilenalstatesuseunlabeledoutgoingarrows. One he ksthat[[A]]
B
≈ [[A
′
]]
S
≈ f
a
wheref
a
(u) = max{n ∈ N / u = va
n
w}
.
AB-automaton issimple ifitusesa tionsin
{ǫ, ic, r}
Γ
.A S-automatonissimple ifit usesa tionsin
{ǫ, i, cr}
Γ
.Thefollowingtheoremis entralinthetheory:
Theorem3 ([Col09 ℄). The relations
4
and≈
are de idable for regular ost fun -tions.2.3 Regular temporal ost fun tions
Thesubje tofthepaperisto studytheregulartemporal ostfun tions,asub lassof regular ostfun tions.Wegiveherearstdenition ofthis lass.
A
B
-automaton(resp.S
-automaton)istemporal ifit usesonlya tionsin{ic, r}
Γ
(resp.
{i, cr}
Γ
).Hen etemporalautomataaresimpleautomatainwhi hitisdisallowed inana tiontoleave ountersun hanged.Intuitively,su hautomata anonlymeasure onse utiveevents.We dene
temp
B
(resp.temp
S
)to map sequen esin{ic, r}
∗
to
N
(resp.{i, cr}
∗
to
N
∞
)whi htou
asso iates(sup C(u))
(resp.(inf C(u))
).Those fun -tionsareextendedtosetsof ountersandrunsasinthegeneral aseof ostautomata. We say that a ost fun tion isB
-temporal (resp.S
-temporal) if it is a epted by a temporalB
-automaton(resp.atemporalS
-automaton).Wewill seebelowthat these twonotions oin ide,upto≈
(Theorem7).Example 3. Over the alphabet
{a, b}
, the ost fun tionf
a
from Example 2 isB
-temporal(as witnessedbytheexampleautomaton).However, the fun tion
u 7→ |u|
a
is not B-temporal, even modulo≈
. Indeed, for the sake of ontradi tion, assume that there exists a temporal B-automatonA =
hQ, A, In, Fin, Γ, ∆i
a eptingg
, withg ≈
α
| · |
a
for someα
. LetK = |Q| + 1
andN = α(K) + 1
.Letσ
betherunofA
overu = (b
N
a)
K
whi h minimizes
sup C(σ)
(it hastoexistsin eg(u) ≈
α
|u|
a
< ∞
).Sin eK > |Q| + 1
,one ande omposeu
asxvy
su h that|v|
a
≥ 1
,|v| ≥ N
, andtherunσ
assumessamestatep
after readingbothx
andxv
.Letσ
x
σ
v
σ
y
bethe orrespondingde ompositionoftherunσ
.Assumerstthat thereexistsa ounterwhi hisneverresetduringσ
v
,thenwegetg(u) ≥ N > α(|u|
a
)
. This ontradi tsg ≈
α
| · |
a
.Hen eall ountershavetoberesetsomewhereinσ
v
. Con-siderthewordu
m
= xv
m
y
.Oneeasily he ksthat
|u
m
|
a
≥ m
sin e|u|
a
≥
1
.However, therunσ
x
σ
m
v
σ
y
witnessesthatg(u
m
) ≤ max(g(u), |u|)
.Hen e| · |
a
isunboundedover theu
m
's, whileg
is bounded overthe sameset. This is a ontradi tion a ordingto Proposition1.3 Clo k-form of temporal ost fun tions
Inthisse tion,wegiveanother hara terizationtoB-temporalandS-temporalregular ostfun tions. Thispresentationmakesuse of lo ks (the notionof lo kshould not be onfusedwiththenotionof lo kusedfortimed automata).
A lo k
c
is a word overthe alphabet{
, ↓}
. It should be seenas des ribingthe ti ks ofa lo k:theletteris ifthereisnoti katthismoment,anditis↓
whenthere is a ti k. A lo k naturallydetermines a fa torization of time into intervals(we say segments).Here,onefa torizesc
as:c = (
n
1
−1
↓)(
n
2
−1
↓) . . . (
n
k
−1
↓)
m−1
.
Onesets
max−seg(c)
tobemax{n
1
, . . . , n
k
, m} ∈ N
,andmin−seg
tobeinf{n
1
, . . . , n
k
} ∈
N
∞
(remarktheasymmetry). A lo kc
has periodP ∈ N
ifn
1
= n
2
= · · · = n
k
= P
, andm ≤ P
. This is equivalent to stating3
max−seg(c) ≤ P ≤ min−seg(c)
. Remark3
thatgiven
n
andP
,thereexistsoneandonlyone lo koflengthn
andperiodP
.You anremarkthatmax−seg(c) = temp
B
(h
B
(c)) + 1
inwhi hh
B
maps toic
and↓
tor
. Similarly,min−seg(c) = temp
S
(h
S
(c)) + 1
inwhi hh
B
maps toi
and↓
tocr
. A lo konu ∈ A
∗
is a lo k
c
oflength|u|
,Inthis ase,one denotesbyhu, ci
the wordoverA × {
, ↓}
obtainedbypairingthelettersinu
andinc
ofsameindex.ForL
alanguagein(A × {
, ↓})
∗
,wedenethefollowingfun tions from
A
∗
to
N
∞
:hhLii
B
: u 7→ inf{max−seg(c) : c
lo konu, hu, ci ∈ L}
hhLii
S
: u 7→ sup{min−seg(c) : c
lo konu, hu, ci /
∈ L} + 1
Lemma1. For alllanguages
L ⊆ (A × {
, ↓})
∗
,
hhLii
B
≤ hhLii
S
.Proof. Fix
u
.ConsidertheminimalP
su hthat the lo kc
overu
ofperiodP
issu h thathu, ci ∈ L
(ifthereisnosu hperiod,hu,
|u|
i /
∈ L
,and
hhLii
S
(u) = ω
).We learly havehhLii
B
(u) ≤ P
. On the other hand,hu, c
′
i 6∈ L
, where
c
′
is the lo k over
u
of periodP − 1
.Hen ehhLii
B
(u) ≤ P ≤ hhLii
S
(u)
.⊓
⊔
Thenotationshh·ii
B
andhh·ii
S
areeasily onvertibleintotemporal ostautomataas shownbyFa t4.Fa t 4 If
L
isregularandL
(resp.∁L
) isa eptedbyanon-deterministi automaton withn
states, thenhhLii
B
− 1
(resp.hhLii
S
− 1
)isa eptedby atemporalB-automaton (resp.atemporal S-automaton)withn
statesandone ounter.Proof. Wehave seenthat
max−seg = (temp
B
◦ h
B
) + 1
.Hen e, if werepla e in the automatonforL
ea htransitionoftheform(p, (a, c), q)
byatransition(p, a, h
B
(c), q)
, weimmediatelygetthedesiredtemporalB-automaton.The onstru tionfortemporal S-automataisidenti al, startingfromthe omplementautomaton,andusingh
S
.⊓
⊔
Theimportantdenitionisthefollowing:
Denition5 An
α
- lo k-language (or simply a lo k-language if there exists su h anα
) is a languageL ⊆ (A × {
, ↓})
∗
su hthat
hhLii
B
≈
α
hhLii
S
. A fun tionf
has anα
- lo k-form ifthere existsanα
- lo k-languageL
su hthathhLii
S
≤ f 4
α
hhLii
B
. A ostfun tion hasa lo k-form ifit ontainsafun tionthathas anα
- lo k-formfor someα
.WenoteCF
the setof ostfun tionsthathave a lo k-form.One an remark that it is su ient to prove
hhLii
S
4
α
hhLii
B
for proving thatL
is anα
- lo k-language:Lemma 1providesindeedtheotherdire tion.Example 4. For
L ⊆ A
∗
,
K = L × {
, ↓}
∗
isa lo k-language,whi hwitnessesthat
χ
L
hasanidentity
- lo k-form.Example 5. Consider again the fun tion
f
a
of Example 2, omputing the maximal numberof onse utivea
's. ThelanguageM = ((a,
) + (b, ↓))
∗
veries
hhM ii
B
≈ f
a
, but it is not a lo k-language:for instan e the wordba
m
is su h that
f
a
(ba
m
) = m
, meanwhile,
hhM ii
S
(ba
m
) = 0
.This ontradi ts
hhM ii
S
≈ f
a
a ordingtoProposition1. This omes from thefa t that the lo k witnessinghhM ii
B
≈ f
a
is hosengiventhe word(theoneti kingexa tlyoverb
-letters).Thisisin ontradi tionwiththeimportant intuitionbehindbeingin lo k-formwhi histhatthe lo k anbe hosenindependently fromtheword.However, it is possible to onstru t a rational lo k-language
L
forf
a
. It he ks thatea hsegmentof onse utivea
's ontainsatmostoneti kofthe lo k,i.e.:L = K[((b,
) + (b, ↓))K]
∗
inwhi h
K = (a,
)
Let
u
beaword,andc
bea lo ksu hthatmin−seg(c) = n
andhu, ci 6∈ L
.Sin ehu, ci 6∈
L
, there exists afa torofu
of theforma
k
in whi h there are twoti ksof the lo k. Hen e,
k ≥ n + 1
.Fromwhi hweobtainhhLii
S
≤ f
a
.Conversely,letu
beaword,andc
bea lo ksu hthatmax−seg(c) = n
andhu, ci ∈ L
. Letk = f
a
(u)
.This meansthat thereis afa tor oftheforma
k
in
u
.Sin ehu, ci ∈ L
, thereisat mostoneti kofthe lo kinthisfa tora
k
.Hen e,
k ≤ 2n − 1
.Weobtainthatf
a
< 2hhLii
B
.Hen e,L
isanα
- lo k-languageforf
a
,withα : n 7→ 2n
.Letus turnourselvesto losurepropertiesforlanguagesin lo k-form.Considera mapping
f
fromA
∗
to
N
∞
andamappingh
fromA
toB
(B
beinganotheralphabet) thatweextendinto amonoidmorphismfromA
∗
to
B
∗
,the
inf
-proje tionoff
(resp.sup
-proje tion)with respe ttoh
is themappingf
inf,h
(resp.f
sup,h
)fromB
∗
to
N
∞
denedforallv ∈ B
∗
by:
f
inf,h
(v) = inf {f (u) : h(u) = v}
(resp.f
sup,h
(v) = sup {f (u) : h(u) = v}
)Thefollowingtheoremshows losurepropertiesof ostfun tionsin lo k-formthat areobtainedbytranslationtoadire t ounterpartinlanguagetheory:
Theorem6 Given
L, M α
- lo k-languages overA
,h
fromA
toB
andg
fromB
toA
, wehave:
L ∪ M
isanα
- lo k-language andhhL ∪ M ii
B
= min(hhLii
B
, hhM ii
B
)
L ∩ M
isanα
- lo k-language andhhL ∩ M ii
S
= max(hhLii
S
, hhM ii
S
)
L
◦g
= {hu, ci : hg(u), ci ∈ L}
isanα
- lo k-language andhhL
◦g
ii
B
= hhLii
B
◦ g
L
inf,h
= {hh(u), ci : hu, ci ∈ L}
isanα
- lo k-languageandhhL
inf,h
ii
B
= (hhLii
B
)
inf,h
L
sup,h
= ∁ {hh(u), ci : hu, ci /
∈ L}
isanα
- lo k-languageandhhL
sup,h
ii
S
= (hhLii
S
)
sup,h
Proof. Theveitems followallthesameproofprin iple.Letus treatthe aseofinf
-proje tion.Theequalityisprovedbythefollowingsequen eofequalities:(hhL
inf,h
ii
B
)(v) = inf{max−seg(c) : hv, ci ∈ L
inf,h
}
= inf{max−seg(c) : hu, ci ∈ L, h(u) = v}
= inf{inf{max−seg(c) : hu, ci ∈ L} : h(u) = v}
= (hhLii
B
)
inf,h
(v)
Assume
L
is anα
- lo k-language, it remains to be shown thatL
inf,h
is also anα
- lo k-language.Letv
beawordandc
bethe lo kwitnessinghhLii
B
(v) = n
,i.e.,su h thathv, ci ∈ L
inf,h
andmax−seg(c) = n
.Letc
′
bea lo kover
v
su hthatmin−seg(c
′
) >
α(n)
, we have to showhv, c
′
i ∈ L
inf,h
. Sin ehv, ci ∈ L
inf,h
, there existsu
su h thatv = h(u)
andhu, ci ∈ L
. Hen e, sin eL
is anα
- lo k-language,hu, c
′
i ∈ L
. It
followsthat
hv, ci ∈ L
inf,h
.⊓
⊔
Lemma2.
temp
B
andtemp
S
have×2
- lo k-formswith×2(n) = 2n
.Proof. The proof for
temp
B
is the sameas in Example 5, in whi h one repla esthe lettera
byic
andtheletterb
byr
.Thetemp
S
sideissimilar.(SeeAppendixA.1)⊓
⊔
Theorem7 If
f
isaregular ostfun tion,the following assertionsareequivalent: 1.f
hasa lo k-form,2.
f
isB-temporal,3.
f
is omputedby atemporalB
-automatonwith onlyone ounter, 4.f
isS-temporal,Proof. (1)
⇒
(3)followsfromFa t4.(3)⇒
(2)istrivial.(2)
⇒
(1): Consider atemporal B-automatonA = hQ, A, In, Fin, Γ, ∆i
using ountersΓ = {γ
1
, . . . , γ
k
}
.ArunofA
isawordonthealphabetB = Q × A × {ic, r}
Γ
× Q
.It followsfromthedenitionof
[[·]]
B
that forallu ∈ A
∗
:
[[A]]
B
(u) = inf
σ∈B
∗
{max(χ
R
(σ), temp
B
◦ π
1
(σ), · · · , temp
B
◦ π
k
(σ)) : π
A
(σ) = u}
in whi h
R ⊆ ∆
∗
is the (regular) set of valid runs; for all
i ∈ [[1, k]]
,π
i
proje ts ea h transition(p, a, t, q)
to the itsγ
th
i
omponent oft
(and is extended to words). Finallyπ
A
proje tsea h transition(p, a, t, q)
toa
(andisalsoextended towords).By Example 4,χ
R
∈ CF
. By Lemma 2,temp
B
∈ CF
, and by Theorem 6,CF
is stable under omposition,max
andinf
-proje tion.Hen e[[A]]
B
∈ CF
.Theequivalen es(2)
⇔
(4)⇔
(5)areprovedin asimilarway.⊓
⊔
A tually,Theorem6andLemma2allowtostatethatifafun tionf
isgivenbyoneof thevedes riptionsofTheorem7,thenforanyotheramongthesedes riptions,there existsafun tiong
whi his≈
×2
-equivalenttof
.In the following, we will simply say that
f
is atemporal ost fun tion insteadofB
-temporal orS
-temporal.Con lusion on lo k-forms, and perspe tives
Independentlyfromthese ondpartofthepaper,webelievethatsomeextra omments onthe lo k-formapproa hareinteresting.
First ofall,letusstresstheremarkablepropertyof the lo k-formpresentationof temporal ostfun tions:those anbeseeneither asdeningafun tion asaninmum (
hh·ii
B
) orasa supremum(hh·ii
S
). Hen e,regular ostfun tion in lo k-forms anbe seeneither asB-automata orasS-automata. Thispresentation isin somesense `self-dual'.Nothingsimilarisknownforgeneralregular ostfun tions.Anotherdieren ewiththegeneral aseisthatall onstru tionsareinfa t redu -tion to onstru tions for languages: This is parti ularly obvious in the statement of Theorem6.Furthermore,sin eeverythingisdoneat theleveloflanguages,wedonot requireanyspe i presentationforthelanguages.Those anbedes ribede.g.byany formof automataoralgebra.Forthis reason,anyspe i optimised onstru tionsfor regularlanguageshouldbereusableforregulartemporal ostfun tions.However,sin e twodierentlanguages
L, L
′
anbesu h that
hhLii
B
≈ hhL
′
ii
B
(evenhhLii
B
= hhL
′
ii
B
), onemustkeepawarethatoptimaloperationsperformedattheleveloflanguagessu h asminimizationwillnotbeoptimal anymorewhenusedfor des ribingtemporal ost fun tions.It is aperspe tiveof resear hto developdedi ated algorithmi forregular temporal ostfun tions.Athirddieren eisthattheerror ommitted,whi hismeasuredbythestret hing fa tor
α
, is linear. This is mu h better than the general ase of ost fun tions, in whi h,e.g.,theequivalen ebetweenB-automataandS-automatarequiresapolynomial stret hingfa tor.However,wedonottakeyetfulladvantageofthisinthepresentpaper sin ewedo nottryto use this pre ision,e.g., in new de isionpro edures.There are alsohereresear hestobe ondu ted.In fa t, the argument underlying temporal ost fun tions in lo k-forms is inter-esting perse: it onsists in approximating somequantitativenotion, herethe notion oflengthofintervals,usingsomeextraunaryinformation, heretheti ksofthe lo k. Sin eunaryinformation anbehandledbyautomata,theapproximationofthe
quan-to onsiderti ksofa lo koveraninniteword(infa tthefa tthatwordsareniteis evenentailingproblems).Itwouldbenodierentontrees(seenasabran hing presen-tationoftime),betheyniteorinnite.Keepingonthesametra k,a lo kisevennot requiredto ountthetime, it ould ountsome events alreadywritten on theinput, su h asthenumberof
a
's,et .These examplesshowtheversatilityoftheapproa h.4 Algebrai approa h
We rst re all denitions of lassi semigroups and stabilization semigroups for the general aseofregular ostfun tions.Weusetheminade idablealgebrai hara ter-izationoftemporal ostfun tions.
4.1 Standard semigroups
Denition Anorderedsemigroup
S
= hS, ·, ≤i
isasetS
endowedwithanasso iative produ t· : S × S → S
andapartial order≤
overS
ompatible with·
(i.e. ifa ≤ a
′
andb ≤ b
′
,thena · b ≤ a
′
· b
′
).An idempotent elementof
S
isanelemente ∈ S
su hthate · e = e
.WenoteE(S)
thesetofidempotentelementsofS
.Re ognizing languages Inthestandardtheory,the re ognitionof alanguageby a nite semigroup is made through a morphism from wordsinto the semigroupwhi h anbede omposedinto twosteps:rst, alength-preservingmorphism
h : A
+
→ S
+
, where
S
+
isthesetofwordswhoselettersarein
S
,andse ondthefun tionπ
:S
+
→ S
whi hmapseverywordon
S
ontotheprodu tofitsletters.ThelanguageL
re ognized by the triple(S, h, P )
, whereP
is a subset ofS
, isL = h
−1
(π
−1
(P )
, i.e.
u ∈ L
iπ(h(u)) ∈ P
.Itisstandardthatlanguagesre ognizedbynitesemigroupsareexa tlytheregular languages.Itisalsobynowwellknownthatfamiliesofregularlanguages anbe har-a terizedbyrestri tionsonthesemigroupswhi hre ognizethem. Thisisforinstan e the asein Eilenberg's variety theoremorinS hützenberger'stheorem hara terizing star-freelanguagesastheonere ognizedbyaperiodi semigroups[S h65℄.
4.2 Stabilization semigroup
Thenotionof stabilization monoidhas been introdu ed in [Col09 ℄ asaquantitative extensionofstandardmonoids,forthere ognitionof ostfun tions.Stabilization semi-groupis a more onvenient obje t in the presentpaper,sin e the empty word plays a spe ial role (it has length
0
). The relationship between stabilization monoids and stabilization semigroupsis made expli it in [Col09b℄. A side ee t is that it is more easyto speakaboutregular ostfun tions overnon-emptywords.Wedoitfrom now forsimpli ity.Denition8 A stabilization semigroup
hS, ·, ≤, ♯i
is an ordered semigrouphS, ·, ≤i
together withanoperator♯: E(S) → E(S)
( alled stabilization)su hthat:for all
a, b ∈ S
witha · b ∈ E(S)
andb · a ∈ E(S)
,(a · b)
♯
= a · (b · a)
♯
· b
; for all
e ∈ E(S)
,(e
♯
)
♯
= e
♯
≤ e
; for all
e ≤ f
inE(S)
,e
♯
≤ f
♯
;
Inthispaper,weonly onsidernitestabilizationsemigroups.Theintuitionofthe
♯
operatoristhate
♯
representsthevaluethatgets
e
`whenrepeatedmanytimes'.This maybedierentfrome
ifoneisinterestedin ountingthenumberofo urren esofe
.Therststepforre ognizing ostfun tionistoprovidea`quantitativesemanti 'tothe stabilizationsemigroup
S
= hS, ·, ≤, ♯i
.Thisisdonebyamappingρ
nameda ompatible mapping, whi h maps everyword ofS
+
to aninnitenon-de reasingsequen e of
S
N
(the original denition doesnot use non-de reasing sequen es, but is equivalent, see e.g.,[Col09 ℄).Theprin ipleisthatthe
i
thpositioninthesequen eρ(u)
tellsthevalue ofthewordu
forathresholdi
separatingwhatis onsideredasfewandaslot.Thisis betterseenonanexample.Example 6. Considerthefollowingstabilizationsemigroup:
b a 0
♯
b b a 0
b
a a a 0
0
0 0 0 0
0
b
a
0
b
a
0
a, b
0
0, a, b
Itisgivenbothbyitstableofprodu taugmentedbya olumnforthestabilizationand byitsCayleygraph.IntheCayleygraphthereisanedgelabelledby
y
linkingelementx
to elementx · y
. Thereis furthermoreadouble arrowgoing fromea hidempotent to itsstabilizedversion.The intention is to ount the number of
a
's. Words with noa
's orrespond to elementb
.Wordswithatleastone,butfewa
's orrespondtoelementa
.Finally,words that ontainalotofa
'sshouldhavevalue0
:forinstan e,a
♯
= 0
witnessesthatiterating alot oftimeawordwithatleastone
a
yieldsawordwithalotofa
's.A possible ompatible mapping
ρ
forthis stabilizationsemigroupatta hesto ea h word over{b, a, 0}
+
an innite sequen e of values in
{b, a, 0}
as follows: everyword inb
+
ismappedtothe onstantsequen e
b
;everyword ontaining0
ismappedtothe onstantsequen e0
;everywordu ∈ b
∗
(ab
∗
)
+
ismappedto
0
forindi esupto|u|
a
− 1
anda
for indi e|u|
a
and beyond. Theideais that forathresholdi < |u|
a
, theword is onsideredashavingalotofa
'sinfrontofi
(hen evalue0
),whileithasfewa
'sin frontofi
fori ≥ |u|
a
(hen e thevaluea
). One anseethat this sequen e` odes'the numberofa
'sin thepositionin whi hitswit hesfrom value0
to valuea
.Aformaldenitionofa ompatiblemappingrequirestostatethepropertiesithas to satisfy, and whi h relate it to the stabilisation monoid. This would requiremu h more material, and we have to stay at this informal level in this short paper (See Appendix A.6). The important resulthereis that givena nitestabilization monoid, there exists a mapping ompatible with it, and furthermore that it is unique up to anequivalen e
∼
(whi hessentially orrespondsto≈
)[Col09 ,Col09b℄. Hen e,inthe aboveexample,the ompatiblemappingdes ribedistheuniquepossible(upto∼
).Nowthat weknow what the semanti s of stabilization semigroupslook like, one uses it for re ognizing ost fun tions. Instead of omputing the produ t of elements and he king whether it belongs to a subset
P
of the semigroup, the quantitative re ognition onsists in onsidering the innite sequen e obtained by the ompatible mappingandobservingtherstmomentitleavesaxedidealI
of thesemigroup(an idealisadownward≤
- losedsubset).Formally,the ostfun tionf
overA
+
re ognized by
(S, h, I)
isf : u 7→ inf{n ∈ ω, ρ(h(u))(n) /
∈ I}
, whereh : A
+
→ S
+
is a length-preservingmorphism,and
ρ
isamapping ompatiblewithS
.Typi ally,ontheaboveexample,theidealis
{0}
,andh
mapsea h letterin{a, b}
to the element of same name. For all wordsu ∈ {a + b}
+
, the value omputed is exa tly
|u|
a
.semigroup.
Likeforregularlanguages,thisalgebrai presentation anbeminimized.
Theorem10 If
f
is aregular ost fun tion,there existsee tively a (quotient-wise) minimal stabilizationsemigroup re ognizingf
.Thisminimalstabilizationsemigroup anbeobtainedfrom
(S, h, I)
byaMoore algo-rithm omputingthe oarsest ongruen e, ompatiblewiththesemigroupand stabiliza-tionoperations,whi hseparateselementsofI
fromtheotherelements.Thispro edure ispolynomialin thesize ofS
.(SeeAppendixA.7)4.4 Temporalstabilization semigroups
Letusnow hara terizetheregulartemporal ostfun tions. We say that an idempotent
e
is stable ife
♯
= e
. Otherwise it is unstable. The intuitionisthat stableidempotentsarenot ountedbythestabilizationsemigroup(
b
intheexample),whiletheiterationofunstableidempotentsmatters(a
intheexample).Denition11 Let
S
= hS, ·, ≤, ♯i
beastabilizationsemigroup.S
is temporalifforall idempotentss
ande = x · s · y
,ifs
isstable thene
isalsostable.For instan e, the example stabilization semigroup is not temporal sin e
b
is stable buta = a · b · a
isunstable.Thisisrelatedtotemporal ostfun tions asfollows:Theorem12 Let
f
bearegular ostfun tion,the following assertionsareequivalent:
f
istemporal
f
isre ognizedby atemporal stabilizationsemigroupthe minimal stabilizationsemigroup re ognizing
f
istemporalWewill brieygiveanideaonhowthedenition oftemporalsemigroupsisrelatedto theintuitionof onse utiveevents.Indeed,anunstableidempotentmustbeseenasan eventwewantto`measure',whereaswearenotinterestedinthenumberofo urren es ofastableidempotent.Butifwehave
e = x · s · y
withe
unstableands
stable,itmeans that wewantto` ount'thenumberofo urren esofe
without ountingthenumber ofs
withine
. In other words,wewant to in rement a ounter whene
is seen, buts
anbe repeateda lot inside asingleo urren eofe
. Toa omplishthis, wehaveno other hoi e but doinga tionǫ
on the ounter measuringe
while reading allthes
's, however,thiskindofbehaviourisdisallowedfortemporalautomata.The twolast assertionsare equivalent, sin etemporalityis preserved by quotient ofstabilizationsemigroups.Onourexample,thestabilizationsemigroupisalreadythe minimalonere ognizingthenumberofo urren esof
a
,andhen e,this ostfun tion isnottemporal.Wegaveadire tproofforthisfa t inExample3.Corollary1. The lass oftemporal ostfun tionsisde idable.
The orollaryisobvioussin etheproperty anbede idedontheminimalstabilization semigroup, whi h an be omputed either from a ost automaton or a stabilization
Wedenedasub lassofregular ostfun tions alledthetemporal lass.Ourrst def-inition used ostautomata.Wethen hara terizedregulartemporal ostfun tions as theonesdes ribableby lo k-languages.Thispresentationallowstoreuseallstandard onstru tionforregularlanguagestakenfrom lassi languagetheory.Wethen hara -terizedthe lassin thealgebrai frameworkof stabilizationsemigroups,thealgebrai notionallowingtodes riberegular ostfun tions.Thistogetherwiththe onstru tion ofminimalstabilizationsemigroupsgaveusade isionpro edureforthetemporal lass, andhopefullyformore lassesinfuture works.
The later de idable hara terization result alls for ontinuations. Temporal ost fun tions orrespond to desert automata of Kirsten [Kir04℄, but other sub lasses of automataarepresentintheliteraturesu hasdistan eautomata(whi h orrespondto one- ounter no-resetB-automata)ordistan e desert automata (a spe ial aseof two ountersB-automata).Istherede idable hara terizationsfortheregular ostfun tions des ribed bythose automata? More generally, what is the nature of thehierar hyof ounters?
Referen es
[AKY08℄ ParoshAzizAbdulla,PavelKr al,andWangYi.R-automata.InFran kvanBreugel and Mar haChe hik,editors, Pro eedings ofCONCUR'08,Toronto,Canada., vol-ume5201ofLe tureNotesinComputerS ien e,pages6781.Springer-Verlag,2008. [Bal04℄ Sebastian Bala. Regularlanguage mat hingand otherde idable asesof the sat-isability problemfor onstraintsbetween regularopenterms. InSTACS, volume 2996 ofLe ture NotesinComputer S ien e,pages596607.Springer,2004. [BC06℄ Mikolaj Boja« zykand Thomas Col ombet. Bounds in
ω
-regularity. InLICS06,pages285296,August2006.
[BOW09℄ A him Blumensath, Martin Otto, and Mark Weyer. Boundedness of monadi se ond-order formulae overnite words. In36th ICALP, Le ture Notes in Com-puterS ien e,pages6778.Springer,July2009.
[Col09a℄ ThomasCol ombet.Regular ostfun tionsoverwords.Manus riptavailableonline, 2009.
[Col09b℄ Thomas Col ombet. Regular ost fun tions,part i:logi and algebra overwords. Submitted,2009.
[Col09 ℄ ThomasCol ombet.Thetheoryofstabilizationmonoidsandregular ostfun tions. ICALP,Le tureNotesinComputer S ien e,2009.
[Egg63℄ L. C. Eggan. Transition graphs and the star-height of regular events. Mi higan Math. J.,10:385397,1963.
[Has79℄ KosaburoHashigu hi. A de isionpro edurefor theorderof regularevents. Theo-reti alComputerS ien e,8:6972,1979.
[Has88℄ K.Hashigu hi. Relativestarheight,star height andniteautomatawithdistan e fun tions. InFormalPropertiesofFiniteAutomataandAppli ations,pages7488, 1988.
[Has90℄ K. Hashigu hi. Improved limitedness theorems onnite automata with distan e fun tions. Theor.Comput.S i.,72:2738, 1990.
[Kir04℄ Daniel Kirsten. Desert automataandthe nitesubstitution problem. InSTACS, volume2996ofLe tureNotesinComputerS ien e,pages305316.Springer,2004. [Kir05℄ Daniel Kirsten. Distan e desertautomata and thestar height problem. RAIRO,
3(39):455509,2005.
[Kle56℄ StephenC.Kleene. Representationofeventsinnervenetsandniteautomata. In C.E.ShannonandJ.M Carthy,editors,AutomataStudies,pages342. Prin eton
IBMJ.Res. andDevelop.,3:114125, April1959.
[S h65℄ M.-P.S hützenberger.Onnitemonoidshavingonlytrivialsubgroups.Information andControl8,pages190194,1965.
A.1 Some proofs on
S
-automatatemp
S
-side of Lemma2 Wewill onstru tarationallanguageL ×2
- lo k-formoftemp
S
.Wewill saythat a lo k
c
is ompatible withawordu
on{i, cr}
+
if
u
andc
have thesamelengthandthereisatmostone↓
ofthe lo kc
insomeblo kofi
'sendedby acr
inu
.LetL = {hu, ci, c
ompatiblewithu}
L = K[((cr,
) + (cr, ↓))K]
∗
((i,
) + (i, ↓))
∗
in whi hK = (i,
)
∗
+ (i,
)
∗
(i, ↓)(i,
)
∗
.
We will show that
L
is a×2
- lo k-form oftemp
S
. We just need to show thattemp
S
4 ϕ
B
L
andhhLii
S
4 temp
S
. Letu ∈ {a, b}
+
, and
c
be a lo k onu
su h thathu, ci ∈ L
andmax−seg(c)
is minimal. Letn = temp
S
(u)
be the size of the smallestblo k ofi
's inu
followed by acr
. Ifmax−seg(c) ≤ ⌊n/2⌋
, there isat leasttwo↓
ofc
inthe smallest(thereforein any) blo k ofi
'sfollowed by acr
inu
, soc
annotbe ompatible withu
. Hen e we musthavehhLii
B
(u) = max−seg(c) > ⌊n/2⌋ = ⌊temp
S
(u)/2⌋
.Thisistrueforallu
,sotemp
S
4
×2
hhLii
B
.Wenowneedtoshowthat
hhLii
S
4 temp
S
. Letu ∈ A
+
,and
c
bea lo konu
su hthathu, ci /
∈ L
andmin−seg(c)
ismaximal.hu, ci /
∈ L
impliesthat thereistwo↓
inc
in anyblo kofi
'sended byacr
inu
.This impliesmin−seg(c) ≤ temp
S
(u)
. Hen e bydenition ofc
,hhLii
S
(u) = min−seg(c) ≤
temp
S
(u)
.It istrueforallu
sohhLii
S
≤ temp
S
.S
-sideof Theorem7 (4)⇒
(1)Considera
S
-automatonA = hQ, A, In, Fin, Γ, ∆i
withΓ = {γ
1
, . . . , γ
k
}
. ArunofA
isasawordonalphabet∆ ⊆ Q × A × {i, cr}
Γ
× Q
. Itfollowsfromthedenitionof
[[·]]
S
that forallu ∈ A
∗
:
[[A]]
S
(u) = sup
σ∈∆
∗
{min(χ
∁R
(σ), temp
S
◦ π
1
(σ), · · · , temp
S
◦ π
k
(σ)) : π
A
(σ) = u}
in whi h
R ⊆ ∆
∗
is the(regular)set of validruns; forall
i ∈ [[1, k]]
,π
i
proje tsea h transition(p, a, t, q)
totheγ
th
i
omponentoft
(andisextended towords).Finallyπ
A
proje tsea h transition(p, a, t, q)
toa
(and isalso extended to words). ByExample 4,χ
∁R
∈ CF
. By Lemma 2,temp
S
∈ CF
, and by Theorem 6,CF
is stable under omposition,min
andsup
-proje tion.Hen e[[A]]
S
∈ CF
.A.2 Cost sequen es
Theaimistogiveasemanti tostabilizationsemigroups.Somemathemati al prelim-inariesarerequired.
Let
(E, ≤)
beanorderedset,α
afun tionfromN
toN
,anda
, b ∈ E
N
twosequen es. Wedenetherelation
α
bya
α
b
if:∀n.∀m. α(n) ≤ m → a(n) ≤ b(m) .
Asequen e
a
issaidα
-non-de reasing ifa
α
a
.Wedene∼
α
asα
∩
α
,anda
b
(resp.a
∼b
)ifa
α
b
(resp.a
∼
α
b
)forsomeα
.if
α ≤ α
′
then
a
α
b
impliesa
α
′
b
,if
a
isα
-non-de reasing,thenitisα
-equivalenttoanon-de reasingsequen e,a
isid
-non-de reasingiitisnon-de reasing,let
a
, b ∈ E
N
betwonon-de reasingsequen es,then
a
α
b
ia
◦ α ≤ b
.The
α
-non-de reasingsequen esorderedbyα
anbeseenasaweakeningoftheα = id
ase.Wewill identifytheelementsa ∈ E
withthe onstantsequen eofvaluea
.Therelations
α
and∼
α
arenottransitives,butthefollowingpropertyguarantees a ertainkindoftransitivity.Fa t 13
a
α
b
α
c
impliesa
α◦α
c
anda
∼
α
b
∼
α
c
impliesa
∼
α◦α
c
.The fun tion
α
is used as a "pre ision" parameter for∼
and . Fa t 13 shows that atransitivitystep ostsomepre ision.Foranyα
, therelationα
oin ide over onstantsequen es withorder≤
(up to identi ationof onstantsequen ewiththeir onstantvalue).In onsequen e,thesequen einE
N
orderedby
α
formanextension of(E, ≤)
.In thefollowing, whileusing relations
α
and∼
α
, wemayforget thesubs riptα
andverifyinsteadthattheproofhasaboundednumberoftransitivitysteps.Let
(E, ≤)
and(F, ≤)
twoorderedsets,afun tionE → F
N
is
α
-monotone if∀a, b ∈ E. a ≤ b → f (a)
α
f (b) .
Inparti ular, forea h
a ∈ E
, wehavea ≤ a
, sof (a)
α
f (a)
,hen ef (a)
isα
-non-de reasing. To ea hα
-monotone fun tionf : E → F
N
we asso iate
f
˜
:E
N
→ F
N
denedin thefollowingway:
forall
a
∈ E
N
andall
n ∈ N
,f (a)(n) = f (a(n))(n) .
˜
Proposition 14 Letf : E → F
N
bea
α
-monotonefun tion anda
, b ∈ E
N
,then:a
α
b
impliesf (a)
˜
α
f (b) .
˜
Inparti ular,iff : E → F
N
andg : F → G
N
are
α
-monotone,then˜
g◦f
isα
-monotone. Moreover,^
(˜
g ◦ f ) = ˜
g ◦ ˜
f
.Denition15 If
f
andg
are fun tionsE → F
N
, we will say that
f ∼
α
g
if for allu ∈ E
,f (u) ∼
α
g(u)
.Asusual,f ∼ g
ifthere existsα
su hthatf ∼
α
g
.We will alsouse this notionswiththe produ torder : if
(E, ≤)
isan ordered set, thesetofwordsinu ∈ E
∗
is anoni allyorderedby
a
1
. . . a
n
≤ b
1
. . . b
m
im = n
anda
i
≤ b
i
fori = 1 . . . n
. We identify the elements of(E
N
)
∗
(wordsof sequen es) with someelementsof
(E
∗
)
N
(sequen esof wordsof thesamelength).Noti e that forany sequen es
a
1
, . . . , a
n
, b
1
, . . . , b
n
∈ E
N
,
a
1
. . . a
n
α
b
1
. . . b
n
ia
i
α
b
i
fori = 1 . . . n
.A.3 Ideals of anordered set
This notionwill beessentialto dene the ostfun tion re ognized byastabilization semigroup.
Let
(E, ≤)
be anordered set,an ideal is a≤ −closed
subsetI ⊆ E
, i.e. ifa ∈ I
andb ≤ a
, thenb ∈ I
. leta ∈ E
,the'ideal generatedbya
isI
a
= {b ∈ E : b ≤ a}
.Leta
∈ E
N
andI
beanideal,wedeneI[a]= sup{n + 1 : a(n) ∈ I}
. 4Let
I
beanideal, its omplementinE
isdenotedbyI
.Leta
∈ E
N
,wedene
I[a]= inf{n : a(n) ∈ I}
. 4Proposition 16 Let
f
andg
be fun tionsE → S
N
su h that
f ∼
α
g
and for anyu ∈ E
,f (u)
andg(u)
arenon-de reasing.Thenfor anyidealI
ofS
,the ostfun tionsu 7→ I[f (u)]
andu 7→ I[g(u)]
are≈
α
equivalent.Indeed,let
u ∈ E
,andn = I[f (u)]
.Theng(u)(α(n)) ≥ f (u)(n) /
∈ I
.I
isanidealsowe getg(u)(α(n)) /
∈ I
.g(u)
isnon-de reasingsoI[g(u)] ≤ α(n)
.Bysymmetryoff
andg
wenallygetu 7→ I[f (u)] ≈
α
u 7→ I[g(u)]
.Denition17 Let
a, b ∈ E
andn ∈ N
,wedene the sequen ea|
n
b
by:for all
k ∈ N
,(a|
n
b)(k) =
(
a
ifk < n
,b
otherwise.A.4 Compatible fun tions
Wenowdenethesemanti ofastabilizationsemigroupwiththenotionof ompatible fun tion.Theideaisto generalizethenotionof produ t,byasso iatingtoea hword of
S
+
, no longer an element of
S
, but a ost sequen e inS
N
. this will allow us to express stabilization in a quantitative way. Intuitively, when
n
is xed in the ost sequen e, we aninterpret the semanti asan automatonwith limited resour es.To avoidambiguities, wewill writeuv
the on atenationofu
andv
aswordsinS
+
and
a · b
theprodu tofa
andb
aselementsofS
.hS
+
, , ≤i
forms a semigroup, partially ordered by the produ t ordered between wordsofsamelengthdes ribedabove.
Denition18 Let
S
= hS, ·, ≤, ♯i
bestabilizationsemigroup.Afun tionρ
fromS
+
to
S
N
is said ompatible with
S
ifthereexistsα
su hthat : Monotoni ity.ρ
isα
-monotone,Letter. for all
a ∈ S
,ρ(a) ∼
α
a
,Produ t. for all
a, b ∈ S
,ρ(ab) ∼
α
a · b
, Stabilization. for alle ∈ E(S)
,m ∈ N
,ρ(e
m
) ∼
α
(e
♯
|
m
e)
, Substitution. for allu
1
, . . . , u
n
∈ S
+
,
n ∈ N
,ρ(u
1
. . . u
n
) ∼
α
ρ(ρ(u
˜
1
) . . . ρ(u
n
))
(re-mind:weidentify sequen eof wordsandwordof sequen es, seese tion A.2)Example 7. Let
S
be the stabilization semigroup with3
elements⊥ ≤ a ≤ b
, with produ tdenedby:x · y = min
≤
(x, y)
(b
neutralelement),andstabilizationbyb
♯
= b
anda
♯
= ⊥
♯
= ⊥
.Lettu ∈ {⊥, a, b}
+
,wedeneρ
by:ρ(u) =
b
ifu ∈ b
+
⊥|
|u|
a
a
ifu ∈ b
∗
(ab
∗
)
+
⊥
sinon.Then
ρ
is ompatiblewithS
. Remark19 When♯
istheidentityfun tion,
S
be omesastandardorderedsemigroup, andthe lassi al extendedprodu tπ
is ompatiblewithS
.Theorem20 ([Col09 ℄) Foranystabilizationsemigroup
S
,thereexistsafun tionρ
ompatiblewithS
.Moreover,ρ
isuniqueupto∼
.Lemma3. Let
ρ
ompatible with a semigroupS
. There existsγ
su h that for anyn ∈ N
andu ∈ S
+
,if
|u| ≤ n
thenfor allk ≥ γ(n), ρ(u)(k) = π(u)
Proof. Weshowthisresultbyindu tionon
n
.Itistrueforn = 1
bytakingγ(1) = 1
.We assumeγ(k)
onstru tedfork < n
,andwewanttoshowtheresultforn
.Letu ∈ S
+
of length
n
,u = va
with|v| = n−1
anda ∈ S
.Letα
awitnessofρ
ompatiblewithS
.The substitutionpropertytellsusthatρ(u) ∼
α
ρ(ρ(v)a)
˜
. but by indu tionhypothesis,for allk ≥ γ(n − 1)
,ρ(ρ(v)a)(k) = ρ(ρ(v)(k)a)(k) = ρ(π(v)a)(k)
˜
.Moreover,ρ(π(v)a) ∼
α
π(v) · a = π(u)
.Hen e wehaveforallk ≥ α(γ(α(n − 1))), ρ(u)(k) = π(u)
.Wegetthe resultwithγ(n) = α(γ(α(n − 1)))
.A.5 Generalities about stabilization semigroups
Stru ture An idempotent elementof
S
is anelemente ∈ S
su h thate · e = e
.We noteE(S)
thesetofidempotentelementsofS
.Inthesequel,weusea lassi Green'srelation.Let
a
andb
beinS
;wedenotea≤
J
b
ifthere existsx
andy
inS ∪ {1}
su h thata = xby
. Therelation≤
J
is apreorder. Ifa ≤
J
b
andb ≤
J
a
, thena
andb
are in the sameJ
- lass, and we denoteaJ b
. Obviously,≤
J
indu esanorder overJ
- lasses,alsonoted≤
J
.A regular element of
S
isanelementa
su hthat there existse ∈ E(S)
withaJ e
. Consequently,either alltheelementsofaJ
- lassareregular(wesaythat theJ
- lass isregular),either noelementis(theJ
- lassisirregular).We anextend
♯
toallregularelementsofS
. Ifa
isaregularelement,thereexistse ∈ E(S)
andx, y ∈ S ∪ {1}
su hthatx · e · y = a
.Wedenethena
♯
= x · e
♯
· y
,whi h doesnotdependonthe hoi eofthede omposition( f.[Kir05℄).
Denition21 Aregular
J
- lassJ
isstable ifthereexistsanidempotenta
inJ
su h thata
♯
∈ J
, otherwise
J
is unstable. IfJ
is stable, then for all idempotenta
inJ
,a
♯
= a
.
Denition22 (Produ t ofstabilization semigroups) Let
S
1
= hS
1
, ·
1
, ≤
1
, ♯
1
i
andS
2
=
hS
2
, ·
2
, ≤
2
, ♯
2
i
be stabilization semigroups, then their produ tS
1
× S
2
is the tuplehS
1
× S
2
, ·, ≤, ♯i
su hthat(a
1
, a
2
) · (b
1
, b
2
) = (a
1
· b
1
, a
2
· b
2
)
,(a
1
, a
2
) ≤ (b
1
, b
2
)
ifa
1
≤ b
1
anda
2
≤ b
2
,and(e
1
, e
2
)
♯
= (e
♯
1
1
, e
♯
2
2
)
.Proposition 23 If
S
1
andS
2
are stabilization semigroups, thenS
1
× S
2
is one too. Moreover,ifρ
1
is ompatiblewithS
1
andρ
2
withS
2
thenρ
denedforallu = (u
1
, u
2
) ∈
(S
1
× S
2
)
+
andk ∈ N
byρ(u)(k) = (ρ
1
(u
1
)(k), ρ
2
(u
2
)(k))
,is ompatiblewithS
1
× S
2
.Denition24 Afun tion
φ
fromS
toS
′
isamorphism ofstabilizationsemigroupsif
for all
u, v
inS
,φ(u · v) = φ(u) · φ(v)
, Forallu ∈ E(S)
,φ(u) ∈ E(S
′
)
andφ(u
♯
) = φ(u)
♯
. Lemma4. LetS
, S
′
be stabilization semigroups,
ρ
andρ
′
ompatible with
S
andS
′
. We assume there exists a morphism of stabilization semigroups
τ
fromS
toS
′
. Let
τ
+
: S
+
→ S
′+
and
τ
N
: S
N
→ S
′N
the natural extensions of
τ
to nite and innite sequen es.Thenτ
N
◦ ρ ∼ ρ
′
◦ τ
+
.
Proof. Let
K = {(a, τ (a)), a ∈ S}
.We anprovideK
withastru tureofstabilization semigroup,asasub-stabilization semigroupofS
× S
′
. Letφ : K
+
→ K
N
dened byφ(u, τ
+
(u)) = (ρ(u), τ
N
(ρ(u))
. Letα
beawitnessofMonotoni ity.
ρ
isα
-monotone, soφ
istooLetter.Let
a ∈ K
,a = (b, τ (b))
withb ∈ S
,φ(a) = (ρ(b), τ (ρ(b)) ∼
α
(b, τ (b)) = a
Produ t.Leta, b ∈ K
,a = (a
′
, τ (a
′
)), b = (b
′
, τ (b
′
)), φ(ab) = (ρ(a
′
b
′
), τ (ρ(a
′
b
′
))) ∼
α
(a
′
· b
′
, τ (a
′
· b
′
)) = a · b
,
Stabilization. Let
e ∈ E(K)
,m ∈ N
,e = (a, τ (a))
witha ∈ E(S)
,φ(e
m
) =
(ρ(a
m
), τ
N
(ρ(a
m
))) ∼
α
(a
♯
|
m
a, τ
N
(a
♯
|
m
a)) = e
♯
|
m
e
, Substitution.Letu
1
, . . . , u
n
∈ S
+
,n ∈ N
,∀i, ∃v
i
∈ S
+
, u
i
= (v
i
, τ
+
(v
i
))
,φ(u
1
. . . u
n
) =
(ρ(v
1
. . . v
n
), τ
N
(ρ(v
1
. . . v
n
))) ∼
α
(˜
ρ(ρ(v
1
) . . . ρ(v
n
)), τ
N
(˜
ρ(ρ(v
1
) . . . ρ(v
n
)))
. Wegetφ ∼
α
g
withg(u
1
. . . u
n
)(k) = (ρ(ρ(v
1
)(k) . . . ρ(v
n
)(k))(k), τ
N
(ρ(ρ(v
1
)(k) . . . ρ(v
n
)(k))(k)))
. To on lude,˜
φ(φ(u
1
) . . . φ(u
n
))(k) = φ((ρ(v
1
), τ
N
(ρ(v
1
))(k) . . . (ρ(v
n
), τ
N
(ρ(v
n
))(k))(k)
= φ(ρ(v
1
)(k) . . . ρ(v
n
)(k), τ
+
(ρ(v
1
)(k) . . . ρ(v
n
)(k))(k)
= (ρ(ρ(v
1
)(k) . . . ρ(v
n
)(k))(k), τ
+
(ρ(ρ(v
1
)(k) . . . ρ(v
n
)(k))(k)))
∼
α
φ(u
1
. . . u
n
)(k)
But(ρ, ρ
′
)
is also ompatible with
K
, sin eK
is asub-stabilization semigroupofS ×S
′
(Proposition23).Theuniqueness(upto
∼
)ofthe ompatiblefun tion(Theorem 20)givesusφ ∼ (ρ, ρ
′
)
,hen ebyproje tiononthese ond omponent,weget
τ
N
◦ ρ ∼
ρ
′
◦ τ
+
.
A.6 Re ognized ostfun tions
We now haveall the mathemati al tools to dene how stabilization semigroups an re ognize ostfun tions.
Let
S
= hS, ·, ≤, ♯i
be astabilization semigroup. Leth : A → S
be amorphism, anoni allyextendedtoh : A
+
→ S
+
,and
I ⊆ S
anideal.ThenthetripletS
, h, I
re -ognizes thefun tionf : A
+
→ N
∞
dened byf (u) = I[ρ(h(u))]
whereρ
is ompatible withS
. A ostfun tion fromA
+
to
N
∞
issaid re ognizableifitis≈
-equivalentto a fun tion re ognized by someS
, h, I
. By Proposition 16, there ognized ost fun tion doesnotdependonthe hoi eofρ
.Example 8. Let
A = {a, b}
,the ostfun tion| · |
a
is re ognizable.Wetakethe stabi-lizationsemigroupfrom Example7,h
denedbyh(a) = a, h(b) = b
,andI = {⊥}
.We havethen|u|
a
= I[ρ(h(u))]
forallu ∈ A
+
.
Thefollowingresultshowstheanalogywithregularlanguages,andjustifythename of"regular" ostfun tions :
Theorem25 ([Col09 ℄) For a ostfun tion, the following propertiesare equivalent :
beingre ognizable bystabilizationsemigroup, being omputableby
B
-automaton,being omputableby