HAL Id: inria-00341770
https://hal.inria.fr/inria-00341770
Submitted on 25 Nov 2008
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.
How to Split Recursive Automata
Isabelle Tellier
To cite this version:
Isabelle Tellier. How to Split Recursive Automata. 9th International Colloquium ICGI, Alexander
Clark, François Coste, Laurent Miclet, 2008, St Malo, France. pp.200-212. �inria-00341770�
IsabelleTellier
LIFL-InriaLilleNordEurope
universityofLille
isabelle.tellieruniv-lille3. fr
⋆⋆
In this paper, we interpret in terms of operations applying on extended nite
stateautomatasomealgorithmsthathavebeenspeiedonategorialgrammars
to learnsublassesof ontext-freelanguages.Thealgorithms onsideredimple-
mentspeializationstrategies.Thisnewperspetivealsohelpstounderstandhow
itispossibletoontroltheombinatorialexplosionthatspeializationtehniques
havetofae,thankstoatypingapproah.
1 Introdution
Thereareoftenseveralwaystorepresentalanguage:itiswellknownthatevery
regular language an be speied either by a regular grammar or by a deter-
ministi nitestateautomaton.Context-freelanguagesanalsobespeiedby
dierentkindsofdevies.Inreentpreviouspapers[17,18℄,wehaveshownthat
somelassesofategorialgrammars(CGsinthefollowing),generatingontext-
free languages, ould easily be represented by a family of extended automata
alled reursiveautomata (RA).Thistranslationallowedtoexhibit onnexions
betweentwopreviouslydistintapproahesofgrammatialinferenefromposi-
tiveexamples:theoneusedin[3,13,14℄tolearnCGs,andtheoneusedtolearn
regulargrammarsrepresentedbynitestateautomata[1,10℄.Thiswaspossible
beausebothemployageneralization strategy.Inpartiular,thegeneralization
operatorsusedin bothontextswereshowntobesimilar.
Now,wewanttoapplythesameproessforspeializationstrategiesfrompos-
itiveexamples.Insuhstrategies,theinitialhypothesisistoogeneralagrammar
(or set ofgrammars) andeahexampleis onsidered asaonstraint whihre-
stritsthesearhspae,untilitisreduedtothetargetgrammar.Weshowhere
thatthetranslationofCGsintoRA,whihhashelpedtobetterunderstandthe
familyofgeneralizationstrategies,analsohelptobetterunderstandthefamily
of speialization strategies.As a matterof fat, although barely used, speial-
ization approaheshave been proposed independentlyin bothbakgrounds: to
learnsublassesofCGsintheonehand[16℄,andtolearnregulargrammarsrep-
resented by nite stateautomata in the otherhand [11℄.A rst movetowards
that diretion has been briey proposed in [19℄, but limited to unidiretional
CGs.Inthispaper,wegeneralizetheapproahtoitsfullgenerality.
⋆⋆
into aRA preservingthestrutures produed, inbothunidiretional andbidi-
retionalases. Insetion 3,werst brieypresentthe speialization strategy
desribedbyMoreauin[16℄,allowingtolearnrigidCGsfrompositiveexamples.
We thenexplain how it relatesto thespeializationstrategy proposedby Fre-
douilleand Miletin[11℄,whihtargetsregularlanguagesrepresentedbynite
stateautomata. Weshow that Moreau'salgorithm anbe interpretedassome
kindofwellfoundedstatesplittingstrategyapplyingonRA.Finaly,thewhole
pitureisompletedinsetion4,byanewinterpretationofyetanotheralready
knownalgorithmallowingtolearnCGsfromsentenesenrihedbylexialtypes
[8,7℄.Itappearstobeaneientlyontroledspeializationapproah.
This paperthus proposes neither any newalgorithm orresult, noranyex-
periment,but itsuggestsanewstimulatinglookonalreadyknownstrategies.
2 From ategorial grammars to reursive automata
2.1 Basi denitionsof ategorialgrammars
Denition1 (Categories, CategorialGrammarsand theirLanguage).
Let
B
be aset (atmostountable)of basiategories ontaining adistinguished ategoryS ∈ B
,alledtheaxiom.Cat (B)
isthesmallestsetsuhthatB ⊂ Cat (B)
andfor any
A, B ∈ Cat(B)
:A/B ∈ Cat(B)
andB\A ∈ Cat (B)
.Unidiretional variantsallow onlyoneoftheseoperators(either/
or\
)butnotboth.Foreverynitevoabulary
Σ
andforeverysetB
ontainingS
,aategorialgrammar(orCG) isaniterelation
G
overΣ × Cat (B)
.Wenotehv, Ci ∈ G
the assignmentoftheategory
C ∈ Cat (B)
totheelementofthevoabularyv ∈ Σ
.Thesyntatirules ofaCG take theformof tworewriting shemes:
∀A, B ∈ Cat (B)
FA
(ForwardAppliation):A/B B → A
BA
(Bakward Appliation) :B B\A → A
Unidiretional CGs make use of only one of these rules (either
FA
orBA
) butnotof both.The languagegenerated(orreognized)byaCG
G
is:L(G)
={w = v 1 . . . v n ∈ Σ + | ∀i ∈ {1, . . . , n}
,∃C i ∈ Cat (B)
suhthathv i , C i i ∈ G
andC 1 . . . C n → ∗ S}
,where
→ ∗
is the reexive and transitive losure of the relation→
, dened byFA
andBA
shemes. For everyw ∈ L(G)
, a syntati analysis struture anbe produed, taking the form of a binary-branhing tree whose leaf nodes are
assignmentsof
G
andwhose internalnodesarelabelledeitherbyFA
orBA
andby aategory (seeFigure1).
Example 1 (asimpleCG).CGshavemainlybeenusedtorepresentnaturallan-
guagesyntax,asillustratedbythisexample.Let
B = {S, T, CN }
whereT
standsfortermand
CN
forommonnoun,Σ = {John, runs, a, man, f ast}
andG = {hJohn, T i, hruns, T \Si, hman, CN i, ha, (S/(T \S))/CN i, hf ast, ((T \S)\(T \S))i}
.Thisover-simpleCGreognizessenteneslikeJohnruns oraman runsfast
withthesyntatianalysisstruturesofFigure1.
S BA
T
John
T \S
runs
S FA
S/(T \S) FA
(S/(T \S))/CN
a
CN
man
T \S BA
T \S
runs
(T \S)\(T \S)
fast
Fig.1.SyntatianalysisstruturesproduedbyaCG
2.2 Reursive Automataand theirLanguage
Denition2 (Reursive Automaton). Areursive automaton
R
isa5
-tuple
R = hQ, Σ, γ, q 0 , F i
withQ
athenitesetof states,Σ
anite voabulary,q 0 ∈ Q
a (unique) initial state andF ∈ Q
a (unique) nal state.γ
is thetransitionfuntion of
R
,denedfromQ × (Σ ∪ Q)
to2 Q
.Werestritourselveshereto reursiveautomata(RAin thefollowing)with
uniqueinitialandnalstates,butitisnotaruialhoie.Theonlyimportant
dierenebetweenthisdenitionandtheusualdenitionofnitestateautomata
isthat,inaRA,itispossibletolabelatransitioneither byanelement of
Σ
orbyanelementof
Q
.Touseatransitionlabelledbyastate,youhavetoprodueastringbelonging tothe languageofthis state.RA anthus be onsidered as
speialasesofreursivetransitionnetworks orRTRs[20℄.But,dependingon
the notionof statelanguage used, there exist in fat twodistint notions of
RA whih will be alled, for reasons that will beome lear soon,
RA F A
andRA BA
.InaRA F A
,thelanguageL F A (q)
assoiatedwiththestateq ∈ Q
isthesetofstringsstartingfrom
q
andreahingthenalstateF
,whereasinaRA BA
,L BA (q)
istheset ofstringsstartingfromtheinitialstateq 0
andreahingq
.Denition3 (LanguageReognizedbya RA).Let
R = hQ, Σ, γ, q 0 , F i
bea
RA F A
(resp.aRA BA
).Foreveryq ∈ Q
wedenethelanguageL F A (q)
(resp.L BA (q)
) assoiatedwithq
asthe smallestset satisfying:
ǫ ∈ L F A (F)
(resp.ǫ ∈ L BA (q 0 )
);if there exists a transition labelled by
a ∈ Σ
betweenq
andq ′ ∈ Q
, i.e.q ′ ∈ γ(q, a)
then:a.L F A (q ′ ) ⊆ L F A (q)
(resp.L BA (q).a ⊆ L BA (q ′ )
);ifthere existsatransition labelledby
r ∈ Q
betweenq
andq ′ ∈ Q
, i.e.q ′ ∈ γ(q, r)
then:L F A (r).L F A (q ′ ) ⊆ L F A (q)
(resp.L BA (q).L BA (r) ⊆ L BA (q ′ )
).The language
L F A (R)
of theRA F A
(resp. the languageL BA (R)
of theRA BA
)isdenedby:
L F A (R) = L F A (q 0 )
(resp.L BA (R) = L BA (F )
).For astate
q ∈ Q
suh thatq 6= F
(resp.q 6= q 0
), thedenition ofL F A (q)
(resp.of
L BA (q)
)maybereursive:when itexists, itis asmallestx-point. Arealreursionourswhen,ina
RA F A
,thereexistsapathstartingfromastateq
,usingatransitionlabelledbyq
andreahingF
(resp.,inaRA BA
,whenthereexistsapathstartingfrom
q 0
,usingatransitionlabelledbyq
andreahingthestate
q
).Unlikenitestateautomata,RAarenotlimitedtoproduingattrees,beausereursivetransitionsallowarealbranhing.Wehaveshownin[19℄that
RA F A
andRA BA
are respetively linked with the two possible unidiretional CGs.Thisproperty,whih justiestheirname,isdetailedin thefollowing.2.3 FromUnidiretional CGs to RA
Eah one of the two families of unidiretional CGs an produe any
ǫ
-freeontext-freelanguage[2℄.Here,weshowthatevery
F A
-unidiretional(resp.BA
-unidiretional)CG anbeeasily transformedinto astronglyequivalent
RA F A
(resp.
RA BA
),i.e.generatingthesamestruturaldesriptions[19℄.Theproess, foragivenF A
-unidiretional(resp.BA
-unidiretional)CGG
,isthefollowing:thevoabulary
Σ
oftheRAisthesameastheoneofG
.let
N
be theset of everysubategoryof aategoryassigned to a memberof the voabulary in
G
(a ategory is a subategory of itself). The set ofstatesforthe
RA F A
(resp.RA BA
)tobebuiltisN ∪ {F }
withF / ∈ N
(resp.N ∪ {I}
withI / ∈ N
).TheinitialstateisS
(resp.I
),thenaloneisF
(resp.S
).forevery
C ∈ N
,deneatransitionlabelledbyC
betweenthestatesC
andF
(resp.betweenI
ansC
),i.e.F ∈ γ(C, C)
(resp.C ∈ γ(I, C)
).forevery
A/B ∈ N
(resp.A\B ∈ N
),dene a transition labelled byA/B
(resp.
A\B
) between the statesA
andB
, that is:B ∈ γ(A, A/B)
(resp.B ∈ γ(A, A\B)
).forevery
hv, ,iC ∈ G
,addatransitionlabelledbyv
betweenthestateC
andF
, i.e.F ∈ γ(C, v)
(resp.add atransition betweenI
andC
labelledbyv
,i.e.
C ∈ γ(I, v)
).2.4 Mutually Reursive Automata
Both families of unidiretionalCGs havethe expressivityof
ǫ
-freeontext-free languagesatthestringlevel,but bidiretionalCGsareusefulforlinguistipur-poses,beauseofthestrutures theyprodue,andpartiularlythelabels
FA
orBA
assignedtoeahinternalnode.Itisthusnaturaltotrytoextendournotionof RA to the generalase of bidiretionalCGs,where both
F A
andBA
rulesare used. As we haveseen, itis possibleto represent theuse of
F A
rules in aRA F A
andtheuseofBA
rulesinaRA BA
.So,weproposetorepresenta(bidi-retional)CGbyapair ofmutuallyreursiveautomata(MRAinthefollowing):
one element of the pairis a
RA F A
, theother one is aRA BA
. Fora syntatianalysisthatusesboth
F A
andBA
rules,mutualallsbetweenthetwoRAwillbeneessary.After an introduing example, we provide ageneral denition of
Example 2 (Example of aMRA).Letus translatetheCG
G
givenin Example1 into a MRA (f. Figure 2). The states of eah of these RA orrespond to
every possible subategory of a ategory assigned by
G
to a element of thevoabulary,plusanalstate
F
intheRA F A
(above),andaninitialstateI
intheRA BA
(under).Thetransitionshavebeendesignedexatlyasexplainedbefore.Then,eahRAhasbeensimpliedforreadability(someun-neessarystatesand
transitions are deleted), but not asmuh aspossible: here,wehave hosen to
preservetherepresentationofallthenal voabulary
Σ
in bothautomata.T
S T\S F (T\S)\(T \S)
S/(T \S) CN
S/(T \S)
T
JohnT \S
runs
(T\S)\(T \S)
fast
a
(S/(T \S))/CN
man
CN
CN (T \S)\(T\S)
I T S
(S/(T\S))/CN T \S
man CN
T
John
T\S
runs
runs
T \S
a
(S/(T\S)/CN
fast
(T\S)\(T \S)
(T\S)\(T \S)
Fig.2.Apairofmutuallyreursiveautomata:the
RA F A
andtheRA BA
Denition4 (MRA and their Language). A pair of mutually reur-
sive automata (or MRA) is a pair
M = (R F A , R BA )
whereR F A = hQ ∪ {F}, Σ, γ F A , S F A , F i
is aRA F A
andR BA = hQ ∪ {I}, Σ, γ BA , I, S BA i
is aRA BA
sharingthe samevoabularyΣ
andthesamesetofstatenamesQ
exeptfor the nal state of the
RA F A
(F / ∈ Q
) and for the initial stateof theRA BA
(
I / ∈ Q
). Weonsiderǫ ∈ L F A (I)
andǫ ∈ L BA (F )
and for every stateq ∈ Q
,the language
L M (q)
of thestateq
inM
isthe smallestsetsuhthat:
L F A (q) ∪ L BA (q) ⊆ L M (q)
if there existsa transition labelledby
r ∈ Q
betweenq
andq ′ ∈ Q
inR F A
(resp.in
R BA
),i.e.q ′ ∈ γ F A (q, r)
(resp.q ′ ∈ γ BA (q, r)
)then:L M (r).L F A (q ′ ) ⊆ L F A (q)
(resp.L BA (q).L M (r) ⊆ L BA (q ′ )
).Wedene thelanguage ofthe MRA as:
L(M ) = L M (S F A ) ∪ L M (S BA ).
ForeveryCG
G
, thereexists aMRAM = (R F A , R BA )
stronglyequivalentwith
G
,i.e.generatingthesamestrutures.3 Learning by speialization
3.1 Learning rigid CGfrom positiveexamples
A rigid CG is a CG in whih every
v ∈ Σ
is assigned at most one ategory.Kanazawa has proved [13,14℄ that the set of every (bidiretional) rigid CG
is learnable in the limit (i.e. in the sense of [12℄) from positive examples, i.e.
fromsentenes.Twodistintlearningalgorithmsarenowavailable forthis pur-
pose. The best known is Kanazawa's, derived from BP (proposed earlier by
Buszkowski and Penn [3℄) and is alassial generalization strategy. The other
one, alled RGPL (Rigid GrammarPartial Learning) is desribed by Moreau
in [16℄. It is this seond algorithm that we will onentrateonhere. Although
itsauthordidnotpresentitthisway,weshowthatitisin fataspeialization
strategy.
Letusrstillustratehowitworksonasimpleexample.Wesupposethatthe
availablesetofpositiveexamplesis
{
Johnruns,amanrunsfast}
.Atitsrststep,thealgorithmassignstoeahmemberofthevoabularyusedatleastone
in theexamplesadistintvariable. Thisinitialassignmentisthushere:
A = {hJohn, x 1 i, hruns, x 2 i, ha, x 3 i, hman, x 4 i, hf ast, x 5 i}
.Evenifawordisusedseveraltimesin theexamples,onlyonevariableisintro-
duedbeausethetargetgrammarisrigid.Infat,
A
impliitely speiesasetof grammars: theset ofrigidCGsbuiltontheusedvoabulary.Asamatterof
fat,everysuhrigidCG
G
anbeobtainedbyapplying asubstitutionσ
fromthesetofvariablestoasetofategoriesto
A
suhthat:G = σ(A) = {hv, σ(C)i|hv, Ci ∈ A}
Thesubstitution
σ
hasonlytheeetofrenamingthevariablesintoategories.Ofourse,
A
an alsoberepresentedby aMRAM = (R F A , R BA )
.In thisMRA,
R F A
(resp.R BA
)has{x 1 , x 2 , x 3 , x 4 , x 5 , F }
(resp.{I, x 1 , x 2 , x 3 , x 4 , x 5 }
)asset of states, and eah state
x i
for1 ≤ i ≤ 5
is onneted toF
(resp.I
isonneted to
x i
) by atransition labelled by the orresponding word (another transition labelled byx i
should be addedbut it is uselessat thispoint).AsS
appearsnowherein this MRA, thelanguageit reognizesis empty. Butit isa
ompatwaytorepresentthe wholelass ofrigid CGsbuilt on
Σ
.Then, eah sentene is syntatially parsedwith theassigmentsin
A
, byaCYK-likealgorithm.TheonlytwopossiblewaystoparseJohnruns are:
eithertoreplae
x 1
byS/x 2
:thenaF A
ruleanbeappliedeithertoreplae
x 2
byx 1 \S
:thenaBA
ruleanbeappliedThese kindsof substitutions express aonstraint that thevariables (
x 1
orx 2
)must satisfy:
A
must thus be updatedto a disjuntion of sets of assignments, eahsubsetorrespondingtoasublassofrigidCGs.Asimplerwaytostoretheurrentsubsetsof possiblesolutionsisto storetheset ofpossiblesubstitutions
thatanbeappliedto
A
.Inourase,thissetismadeof{σ 1 , σ 2 }
,withσ 1 (x 1 ) = S/x 2
and is equalto the idential funtion elsewhere, andσ 2 (x 2 ) = x 1 \S
andis equal to the idential funtion elsewhere.
σ 1 (A)
, as well asσ 2 (A)
, an berepresented by a MRA derived from the previous one. This time, both MRA
reognizeexatlythesenteneJohnruns.
Toparseamanrunsfast,manymoresolutionsarepossible.Themaximum
theoretialnumberis
5 ∗ 2 3 = 40
beausethere are5
possiblebinarybranhingtrees with
4
leaves(this anbe omputed in the general aseby the Catalannumber),andeahofthem has
3
internal nodeswhih anreeiveeitheraF A
or a
BA
label. This makes40 ∗ 2 = 80
theoretial possible substitutions by ombining theonstraintsobtained from both sentenes(the ombinaisonis alassialomposition of funtions). But, among them, some areontraditory:
asthetargetgrammarisrigid,theuniqueategoryassignedtothewordruns
annotbeoftheform
x i /x j
andx k \x l
atthesametime.Wethusseewheretheinitiallassplaysarolein thelearningstrategy.
Itiseasytoseethatthemainproblemwiththisalgorithmistheombinato-
rialexplosionithastofae,espeiallywhenexamplesdonotshareanyommon
word.Thisisnotsurprising,sinetheproblem oflearningrigid CGsfrom sen-
tenes isknownto beNP-hard [4℄.Tolimitthis explosion,Moreauproposes to
exploitasmuhinitialknowledgeaspossible,intheformofaninitialgrammar,
that is,initiallyknownategoriesforsomeusualwords(forexamplethelexial
ones)whihannotberenamed,asitistheaseforthevariableategories.
Furthermore,thereisnoguaranteeatallthatthisstrategyalwaysonverges
toauniquesolution.Intheory,tofullltherequirementsoflearnabiblityinthe
limit, when several possibleompatible grammars are available,inlusion tests
should beperformed toseletthe onegenerating thesmallest language.This
problemalsoourredwithKanazawa'salgorithm,whenappliedto sentenes.
3.2 State mergesand state splits
The previousstrategy annowbe interpretedin termsof operations applying
on MRA. As we have seen, at every step of this algorithm, the searh spae
is a disjuntion of sets of assignmentsof the form
σ(A)
for some substitutionσ
, and eah of them anbe representedby a MRA. The MRA orrespondingwith
A
reognizesno sentene. But, assoonas at leastone examplehas beentreated(and,thus,theategory
S
beenintrodued),σ(A)
speiesasetofCGsreognizingatleastthisexample.WhatistheeetofaonstraintonaMRA?
Theonstraintsalwaystaketheform:
x k = x l
,wherex k
andx l
arealreadyintroduedvariablesorequalto
S
,orx k = X m /X n
orx k = X m \X n
,withX m
and
X n
anyategorybuiltontheset ofeveryvariableunionS.theeet ofaonstraintoftheform
x k = x l
onaMRAisastatemerge inboth the
RA F A
and theRA BA
of the MRA. As, in MRA,x k
an also beusedastransitionlabels,orrespondingtransition merges analsoour.
theeet of aonstraintof theform
x k = X m /X n
(resp.X m \X n
)an bedeomposedintofour steps:
1.
X m /X n
(resp.X m \X n
)replaesx k
everywhereintheMRA;2. every subategory of
X m
andX n
(inluding themselves) not already identied (i.e.notalready asub-ategoryof thepreviousset of assign-ments)beomesanewstateinbothRA:inthe
RA F A
,itislinkedtothestate
F
(resp.intheRA BA
fromthestateI
)byatransitionlabelledbyitsname;
3. inthe
RA F A
(resp.in theRA BA
),anewtransitionlabelledbyX m /X n
(resp.
X m \X n
) links the statesX m
andX n
, and the sameours foreverynewlyidentiedsubategory;
4. thestatesandtransitionsofthesamenamearemergedineahRA.
This operation an now be ompared to the state splitting strategy pro-
posedbyFredouilleandMiletin[11℄tolearnregularlanguagesrepresentedby
nite stateautomata byspeialization.Forexample,theonstraint
x 1 = S/x 2
hastheeet of splittingthe state
x 1
into twonewstates:S
andx 2
. Then, asastatenamed
x 2
already exists,the newoneis mergedwiththe previousone.But our speialization operation is more generalthan Fredouilleand Milet's,
beause of the reursivenature of the automata on whih it applies. Further-
more,their algorithm wasaspeialization strategyat the language level: their
initialhypothesiswasthemostgeneralregularlanguage
Σ ∗
andonstraintswereused to speialize the language. Moreau's algorithmis aspeialization strategy
at the set of grammars level: its initial hypothesis is theset of possible gram-
mars, and the examplesare used to introdue onstraints that redue this set
tosubsets.TheorrespondingMRArepresentsaset ofgrammars andnotonly
a spei language.Forthese reasons, ourapproah annot be easily adapted
to usualnite stateautomata.Butwebelievethatourstatesplitting operator
isbetterfoundedthanthepreviousone,beauseitistheformalounterpartof
well-denedsubstitutions.
4 Learning from typed examples revisited
We now show that the algorithm proposed in [8,7℄ to learn CGs from typed
examplesan be onsidered asaspeialization strategywhere state splits and
statemergesareontrolledbyatypingapproah.
4.1 Learning from semantiallytyped examples
Theideaof learningCGs from typedexampleswasrstintroduedin [8℄.The
typesonsideredinthisworkareborrowedfromMontague'stheory[6℄:theyare
fromtypedexamplesisognitivelyrelevantbeausetypesanbeinterpretedas
semantiinformationavailableintheenvironmentorpreviouslylearned.Inthis
setion,webrieyreallthisnotioninageneralfashionandgivetheonditions
underwhihtheyanhelp learning.
ThenotionoftypesusefulforlearningCGs isbasedon:
a nite set
τ
of basi types among whih is a distinguished typet ∈ τ
standingfortruthvalues:usually,this setis
τ = {e, t}
wheree ∈ τ
isthetypeofentities.Montaguealsousedatype
s
forintensions thatwillnotbeusedin thefollowing;
the set
Types(τ)
of every typeis the smallestset suh thatτ ⊂ Types(τ)
andforeverytype
α, β ∈ Types(τ)
,hα, βi ∈ Types(τ)
.hα, βi
is thetypeoffuntionsthatrequireanargumentoftype
α
andprovidearesultoftypeβ
.Typesin
Types(τ)
are usefulfor learning aCG only ifthey are onnetedwith itssyntatiategories in
Cat (B)
.Morepreisely, theneessaryonditiontobefullledisthat thereexistsahomomorphism
h
suhthat:for everybasi ategory
C ∈ B
,h(C)
is dened and belongs toTypes(τ)
.Thedistinguishedategory
S ∈ B
isassoiatedwiththedistinguishedtypet ∈ τ
:h(S) = t
.for every other ategory in
Cat (B)
of the formA/B
orA\B
, we have:h(A/B) = h(B\A) = hh(B), h(A)i
.Example 3 (lassial semantitypes for natural languages). Let
τ = {e, t}
.ThewordsofthegrammardenedinExample1reeivethefollowingsemantitypes:
Johnanbeonsideredasanentityoftype
e
;runsandman areone-plaeprediates;theirtypeis:
he, ti
;fastisaone-plae-prediatemodier,i.e.ittransformsaprediateofarity
oneintoanotheroneofthesamearity:itthushasthetype
hhe, ti, he, tii
;naly,ifwefollowMontague'sintuitionaboutthepropertreatmentofquan-
tiation[6℄,thedeterminerahasthemostomplextype:
hhe, ti, hhe, ti, tii
.Theorrespondinghomomorphism
h
isdenedby:h(S) = t
,h(T ) = e
,h(CN) = he, ti
.Asrequired,ifhv, Ci ∈ G
,thesemantitypeofv
ish(C)
.4.2 How types helpto ontrol state splitsand state merges
Learning from typed examples means learningfrom sentenes where eah ele-
ment of the voabulary
v ∈ Σ
, whih should be assignedC ∈ Cat (B)
by thetargetgrammar
G
toanalysethis sentene,is provided withtheorresponding typeh(C) ∈ Types(τ )
. As we will see, the learningstrategy proposed in [8,7℄an alsobeinterpretedin termsofoperationsapplyingonMRA.Weillustrate
thisalgorithmonourexample.Theinputdataarenowoftheform:
John runs
e he, ti
e x 1 he, ti
hhe, ti, hhe, ti, tii he, ti he, ti hhe, ti, he, tii x 2 hx 3 he, ti, x 4 hx 5 he, ti, tii x 6 he, ti x 1 he, ti x 7 hx 8 he, ti, x 9 he, tii
Inthesetypedexamples,thethirdlineistheresultofasimplepre-treatment
whih onsistsin introduing variables in frontof everyfuntional type.The
variablesarealldistint,exeptwhenthesameoupleword,typeours(asit
istheaseherefortheoupleruns,
he, ti
).Thesevariableswilleventuallytakethevalue
/
or\
duringthelearningproess.Theinitialsetofassignements is,thistime:A = {hJohn, ei, hruns, x 1 he, tii, ha, x 2 hx 3 he, ti, x 4 hx 5 he, ti, tiii, hman, x 6 he, tii, hf ast, x 7 hx 8 he, ti, x 9 he, tiii}
.Aspreviously,
A
impliitelyspeiesasetof grammars.Thissetismuhlargerthan the one of rigid CGs:it is the set of CGs whih an assign an arbitrary
number of distint ategories to eah word (so, it intersets everylass of
k
-valuedCGs),butforwhihthereexistsahomomorphismsuhthateverydistint
ategoryassignedtothesamewordgivesrisetoadistinttype.Informalterms,
itissuhthatthereexists ahomomorphism
h
satisfying:∀hv, C 1 i, hv, C 2 i ∈ G
,h(C 1 ) = h(C 2 ) = ⇒ C 1 = C 2
.We haveshown [9℄ that forevery
ǫ
-freeontext-free language,it is possible to deneaCGgeneratingthislanguage,asetoftypesandahomomorphismsuhthatthispropertyissatised.Thisnewtargetlassislearnableinthelimitfrom
typedexamples[8,7℄.
As previously,
A
an also be represented by aMRA. But the information arried by thetypesis muh riherthan theone arried by thebasivariablesMoreauused: typesan be interpretedassomekindof maximalbound onthe
possibleategoriestheyreplae;theydisplayalltheirpotentialrenaming.
Thelearningalgorithmappliesasinsetion3.1:itonsistsintryingtoparse
eah sentene with the rules
FA
andBA
adapted to typesso as to reah thetype
t
at theroot, bydening onstraintson thevariables(see [7℄for details).The onlypossibletype-ompatible way to parsethe rsttyped exampleJohn
runs isto have:
x 1 = \
, meaningthat onlyaBA
rule is ompatible with thetypeassignments.runs shouldthusnalyreeivetheategory
e\t
.This time,there is only one type-ompatible way to parse a man runs fast: this parse
(isomorphitotheoneinFigure1) isshownonFigure3.Both typedexamples
lead to the following (unique) set of onstraints:
x 2 = /
,x 3 = x 6
,x 7 = \
,x 8 = x 1 = \
,x 4 = /
,x 5 = x 9
.Theset ofassignmentsisthusupdatedto:
A = {hJohn, ei, hruns, \he, tii, ha, /hx 3 he, ti, /hx 5 he, ti, tiii, hman, x 3 he, tii, hf ast, \h\he, ti, x 5 he, tiii}
.Ifweapplytheproess ofsetion2.4 tothis set(after re-orderingthetypesto
makethemsimilartosyntatiategoriesand
t
playingtheroleofS
),weobtaintheMRAofFigure4.Inthisexample,withonlytwotypedexamples,weobtain
auniqueMRAwhihisnearlyisomorphitothetargetone.
Inthis ontext,theonstraintstaketheform
x i = x j
,x i = /
orx i = \
andt FA : x 4 = /
x 5 = x 9
x 4 hx 5 he, ti, ti FA : x 2 = /
x 3 = x 6
x 2 hx 3 he, ti, x 4 hx 5 he, ti, tii
a
x 6 he, ti
man
x 9 he, ti BA : x 7 = \
x 8 = x 1
x 1 he, ti
runs
x 7 hx 8 he, ti, x 9 he, tii
fast
Fig.3.parsetreeforatypedexample
e\t e
t x 5 he, ti F (e\t)\x 5 he, ti
t/x 5 he, ti x 3 he, ti
t/(x 5 he, ti)
e
Johnx 5 he, ti e\t
runs
(e\t)\(x 5 he, ti)
fast
a
(t/x 5 he, ti)/x 3 he, ti
man
x 3 he, ti
x 3 he, ti (e\t)\x 5 he, ti
I e t
(t/(x 5 he, ti))/x 3 he, ti e\t x 5 he, ti
man
x 3 he, ti
e
John
e\t
runs
runs
e\t
a
(t/x 5 he, ti)/x 3 he, ti
fast
(e\t)\(x 5 he, ti)
(e\t)\x 5 he, ti
fast
Fig.4.MRAfortypeassignments
statesplit,butthesituationisabitmoreomplex.Inourexample,toreahthe
target,onlyoneonstraintismissing:
x 5 = \
.Thetypedexampleorresponding tothesenteneJohnrunsfast wouldprovidethisonstraint.Itsrsteetonthe MRAwould be to renamethe state
x 5 he, ti
both in theRA F A
and in theRA BA
by\he, ti
, that ise\t
. But, doingso, thisstate beomes idential to analreadyexistingoneand thenmustbemergedto it.
The table of Figure 5 explains why types help the algorithm to avoid a
ombinatorialexplosionandtoonvergequiker.Wehaveseenthattherealways
exists ahomomorphism
σ
betweenolumn 2andolumn 3,whih isthetargetof the learning proess. Hypotheses about types ensure that there also exists
ahomomorphism
h
betweenolumn 3 and olumn 4.This situation is similarto the onedesribed in [15℄,and analyzedin [5℄. Thetwo learningalgorithms
presentedhere are bothspeialization strategies at the set of grammars level,
buttheirinitialhypothesisiseitheralowerboundoranupperboundoftheset
of ategories of the target grammar.Types are eient beausethey allow to
ontrolthepossiblerenamings.
voabulary Moreau'sinitialtargetategory pre-treated
assigment initialassignment types
John
x 1 T e
a
x 2 (S/(T \S)/CN x 2 hx 3 he, ti, x 4 hx 5 he, ti, tii
man
x 3 CN x 6 he, ti
runs
x 4 T \S x 1 he, ti
fast
x 5 (T \S)\(T \S) x 7 hx 8 he, ti, x 9 he, tii
Fig.5.tabularshowingthestartingpointsandtargetofthetwoalgorithms
5 Conlusion
In grammatial inferene from positive examples, two soures of information
are usually available: the target lass and theset of examples. Generalization
tehniquesusetheexamplestogenerate amostspei grammar ompatible
withthem(theprextreeautomatonintheaseofregularlanguages),andthen
use thetarget lass to generalizeit. Speialization tehniques dothe ontrary:
thelassisthestartingpointand theexampleshelptospeializeit.
Inthis paper, we propose anew perspetive onthese tehniques.First, we
see that disjuntions of MRA are able to represent the searh spae of suh
learning algorithms. Seond, we show that the algorithm to learn CGs from
typedexamplesproposed in[8,7℄introduestypeontrolinto theproess.The
initial semanti types assoiated with the elements of the voabulary speify
some kindof maximal bound on the possible renamings, allowingto limit the
1. D.Angluin. InfereneofReversibleLanguages JournaloftheACM3:p.741765,
1982.
2. Y.BarHillelandC.GaifmanandE.Shamir.OnCategorialandPhraseStruture
Grammars. BulletinoftheResearh CounilofIsrael,9F,1960.
3. W.BuszkowkiandG.Penn.Categorialgrammarsdeterminedfromlinguistidata
byuniation,newblokStudiaLogia,p.431454,1990.
4. C. Costa-Florenio. Consistent Identiation in the Limit of Rigid Grammars
fromStrings IsNP-hard. proeedings oftheIGGI: Algorithms andAppliations,
p.4962,LNAI2484,2002.
5. F. Coste, D. Fredouille, C. Kermovant,C. de laHiguera. Introduingdomain
and typingbiasinautomatainferene, inproeedings of the7thICGI,Vol.3264
ofLNAI,p.115126,2004.
6. D. Dowty and R.E. Wall and S. Peters. Introdution to Montague Semantis,
LinguistisandPhilosophy,Reidel,1981.
7. D. Dudau-Sofronie. Apprentissage de grammaires atégorielles pour simuler
l'aquisition du langage naturel à l'aide d'informations sémantiques, thèse
d'informatique,universitéLille3,2004.
8. D. Dudau-Sofronie, I. Tellier, and M. Tommasi. Learning ategorial grammars
fromsemantitypes, inproeedingsofthe13thAmsterdamColloquium,p.7984,
2001.
9. D.Dudau-Sofronie,I.Tellier,andM.Tommasi. ALearnableClassofCCGsfrom
Typed Examples, inproeedings of the 8thonferene onFormal Grammars,p.
7788,2003.
10. P.Dupont and L. Milet andE. Vidal. What is the searhspae of the regular
inferene. proeedingsofICGI,p.2537,LNCS862,1994.
11. D.Fredouille,andL.Milet.Experienessurl'inferenedelangageparspeialisa-
tion, inproeedings ofCAP'2000,p.117130, 2000.
12. E.M. Gold. Language identiation inthe limit. Information and Control, 10:
p.447474, 1967.
13. M.Kanazawa.Identiationinthelimitofategorialgrammars,JournalofLogi,
Language andInformation5(2),p.115155,1996.
14. M. Kanazawa. Learnable Classes of Categorial Grammars, CSLI Publiations.
1998.
15. C.Kermovant,C.delaHiguera Learninglanguagewithhelp proeedingsofICGI,
p.161173, LNAI,2002.
16. E.Moreau.Apprentissagepartieldegrammaireslexialisées, TAL45(3),p.71102,
2004.
17. I. Tellier. When ategorial grammars meet regular grammatial inferene, in
proeedings ofthe5thLACL,Vol.4492 ofLNAI,p.317332, 2005.
18. I.Tellier.Learningreursiveautomatafrompositiveexamples,Revued'Intelligene
ArtiielleNewMethodsinMahineLearning(20/2006),p.775804, 2006
19. I.Tellier. Grammatialinferenebyspeializationasastatesplittingstrategy, in
proeedings ofthe16thAmsterdam Colloquium,p.223-228,2007.
20. W.A.WoodsTransitionNetworkGrammarsofNaturalLanguageAnalysis Com-
muniationof theACMvol.13,p.591606, 1970.