The topology of syntax relations of a formal language
The method of constructing of Grothendieck's topology basing on a neighbourhood grammar, defined on the category of syntax diagrams is described in the article. Syntax diagrams of a formal language are the multigraphs with nodes, signed by symbols of…
Authors: Vladimir Lapshin
THE TOPOLOGY OF SYN T AX RELA TIONS OF A F ORMAL LANGUAGE VLADIMIR LAPSHIN Abstract. The method of constructing of Grothendieck’s topol- ogy basing on a neig hbourho o d gr ammar, defined on the catego ry of syntax diagrams is describ ed in the a r ticle. Synt ax dia grams of a formal langua ge are the m ultigra phs with no des, signed by symbols of the language’s alpha bet. The neighbourho o d grammar a llows to select c o rrect syntax diagra ms from the set o f all syntax diagrams on the given alphab et by mapping a n each co r rect diag r am to the cov er co ns isted of the gramma r’s ne ig hbourho o ds. Such the cover gives r ise to Grothendieck’s to p olo gy on category E xt ( D G ) of cor- rect syntax diagra ms extended by neighbourho o ds’ diag r ams. An each ob ject of ca tegory E xt ( D G ) may b e mapp ed to the set of meanings (abstr act sens es) of this s yn tax construction. So, the contrv ariant functor from categor y E xt ( D G ) to categ ory of s ets Sets is defined. The g iven category Sets E xt ( D G ) op likes to b e seen as the conv enient mea ns to think ab o ut relations betw een sy n tax and semantic of a fo rmal lang uage. The sheav es of set defined on category E xt ( D G ) are the ob jects of ca tegory Sets E xt ( D G ) op that satisfy of c ompo sitionality principle defined in the semantic anal- ysis. 1. Introduction The f ormal language’s syn tax traditionally is describ ed b y using o f the notio n o f grammar. The gra mmar defined the laws that are the base to build correct syn tax constructs fro m at o mic en tities (sym b ols). The metho d, described in [5], allow s to univ ersally describe the syn tax of a f ormal language in spite of represen tation of its texts (linear one or not). The metho d describ es the syn tax constructs b y using of the notion of syn tax diagram. The syn tax diag r am is the connected m ulti- graph with no des signed b y a f ormal language’s alphab et and ribs can b elong to differen t sorts and represen t the syn tax relations. The m ulti- graph o f a syn tax diagram ma y b e directed o r not. The main restriction to the m ultigraphs of syn tax diagrams is connectivit y . It is p ossible to select correct syn tax diagrams from the set of all syntax diag rams on the giv en a lphab et. The f ormalism of neigh b ourho od gr a mmar is used to do this. It ma y to define the set of sub diagra ms for eac h syn tax diagram D a s the set of pairs ( D ′ , s ), where D ′ is a syn tax diagram and s – inclusion mapping of syn tax diagr a m D ′ to syn tax diag ram D . The neigh b ourho od an alphab et’s sym b ol is a syn tax diagram, whic h 1 2 VLADIMIR LAPSHI N con tains the no de, signed by this sym b ol. T his no de is named as the cen ter of the neigh b ourho o d. The neighbourho o d grammar is a finite family of neigh b ourho ods defined for eac h sym b ol of the alphab et. The syn ta x diagra m is named as correct o ne if for each its no de signed b y some sym b ol of the a lpha b et it includes some neigh b ourho od of t his sym b ol. Suc h the neigh b ourho o d should contain all ribs adjoining to its center, the set of suc h the ribs is named a s the neighbourho o d’s star. So, there is at least o ne co v er consisted of neigh b ourho o ds for each cor- rect syn tax diagra m in the giv en neighbourho o d g rammar. Suc h the co v er is named as the syn tax one. F urther, the category D of syn t a x diagrams ab ov e the give n alphab et will b e describ ed. Also, it will b e sho wn how, for the give n category of syn tax diagrams basing on neigh- b ourho o d grammar, define the catego r y of correct syn tax diagrams and Grothendiec k’s top ology on it. 2. Ca te gor y D of s ynt ax diagrams Define category D of syn tax diagrams ab ov e the fixed alphab et A and the set of ribs’ sorts S as the categor y , where ob jects ar e syn ta x diagrams with no des signed b y sym b ol of alphab et A a nd ribs ha ving sorts fro m the set S . The morphisms of the category D ar e inclusion mappings of diagrams to eac h o ther. Because of inclusion mapping is asso ciativ e and for eac h diag r a m there is the identical inclusion map- ping of the diagram t o itself, D is r eally the category . It mak es sense to sa y ab o ut one- no de diagram a which do es not con tain ribs and con- sists o f the single no de, signed the giv en sym b ol a . Suc h the diagrams are the categorical interpretation of the a lphab et. There is also empt y diagram, whci do es not contain any no de and rib. The empt y diagram is included to an y syn t ax diagram. The terminal ob ject exists o nly if the alphab et A consists of t he single sym b ol a , then it is the one-no de diagram whose no de signed b y sym b ol a . In the contrary case, the terminal ob jec t is “hashed” on o ne-no de diag r ams o f the alphab et’s sym b ols. Ob viously , it do es not mak e sense to sa y ab out the category of all syn ta x diagrams ab ov e the g iven alphab et and the given set of ribs’ sorts. The unive rse of the discussion is to o general. It is conv enien t to say ab out the category of syn tax diagrams ab ov e alphab et and ribs’ sorts, that satisfy some additional conditions on the structure of no des and r ibs. F or example, it is conv enien t to say not ab out all diagrams ab ov e the a lpha b et A = { a, b } , but only tha t represen t c hains of sym- b ols if the language o f syn tax diagrams has linear represen tatio n. If ababa – the c hain ab o ve alphab et A , then it can b e repres en ted b y the diagra m a ← b ← a ← b ← a . The conditions are: eac h suc h diagram con tains only one no de, ha ving only one rib – outcoming, one no de having only one rib – incoming, a nd all no des con tain exactly t w o no des, one incoming and one outcoming. These conditions define the SYNT AX TOPOLO GIES 3 sub category of category D , con taining all ob jects of categor y D , t ha t satisfy the giv en conditions. Often, t he conditions is the single metho d to define the needed set of the syn tax diagrams. F or example, to define the category of deriv ation trees in Chomsky’s generative con text-free grammar, it is not enough definition of the family of neigh b ourho o d diagrams, the additional conditions should b e defined. F urther, D will note the subcatego r y of category D ab ov e the giv en alphab et and sorts of ribs, which satisfies the given conditions on view of syn tax relations. In this sense, the category D is described b y using of t wo comple- men tary metho ds: globally , b y defining the conditions on the view of diagrams, and lo cally , b y defining the neigh b ourho o ds of the sym b ols. 3. Ca tegor y D G of correct s ynt ax diagrams As it is already b een said ab ov e, the described formalism defines the syn ta x of a language by using of tw o metho ds: (1) Globally – by en umerating the conditions on view of t he m ulti- graphs of syn tax diagrams of the giv en language. (2) Lo cally — b y en umerating the family of neigh b ourho o ds for eac h sym b o l of the giv en language’s a lphab et. Suc h the description may b e done in sev eral steps. At the first step, the conditions on view of the syn tax diagrams are defined and so, cate- gory D of all syn ta x diagra ms satisfy the giv en conditions is describ ed. A t the second step, fro m the set of diagrams constructed on the first step, correct syn tax diagrams are selected as t he diagram satisfied by lo cal syn tax characteristics of the langua g e. The correct syn tax dia- gram is the ob ject of category D , for whic h it exists the syn ta x cov er of neigh b ourho ods o f the giv en gr a mmar. The syn ta x cov er is a col- lection of neigh b ourho ods given for eac h diagram’s no de. And, if the no de is signed b y sym b ol a , then the elemen t of syntax cov er, whic h is defined for this no de, should b elong to the family G a of neigh b our- ho o ds of sym b ol a of the g rammar G . Thus , the syn ta x co v er may b e noted as the list of pa irs ( v , D a ), where v – the no de of the diagr a m and D a – the neigh b ourho o d o f sym b ol a , whic h signs the no de v . The category D G of correct syn tax diagrams of category D is the category of pairs ( D , P ), where D ∈ O b ( D ) – syn tax diagram and P – its syn tax co v er. The morphisms of category D G are the inclusion mappings o f diagrams, satisfying the conditio n that for eac h no de of the sub dia- gram its neigh b ourho od, a s elemen t of the syn tax co v er, should be t he elemen t of syn tax cov er of the en v eloping diagra m. So that, the neigh- b ourho o ds should b e iden tically mapp ed as elemen ts of syntax cov ers. Ob viously , this is the general case, but there ma y b e the exceptions. It can b e when there is the correct syn tax diagram, whic h has t w o differen t syn ta x cov ers (am biguity). T o correctly say ab out diagrams of suc h the kind, it is needed to think ab out a pa ir (diagram, syn t a x 4 VLADIMIR LAPSHI N co v er) as ab o ut the single ob ject what has b een done a b o v e. Go to the formal definitions. Definition 1. Let G = { G a : a ∈ A } – neigh b ourho od g r a mmar defined on category D . Define category D G of correct syn tax diagrams, giv en b y the grammar G on the category D , as follows: • Ob jects of category D G are the pairs ( D , P ), whe re D ∈ O b ( D ) – syn tax diagram and P – its syn tax co v er. P is the list o f pairs ( v , D a ), where v – no de of the syn ta x diagr a m a nd D a – neigh b ourho o d of sym b ol a , whic h signs the no de v , an eac h no de v is in the list P exactly o n one o ccasion. • F or t w o correct syn tax diagrams ( A, P A ) , ( B , P B ) ∈ O b ( D ) the set H om D G (( A, P A ) , ( B , P B )) consists of all inclusion mappings s : A → B suc h that for eac h no de v of diagram A neighbour- ho o d of no de s ( v ) in co v er P B is the neigh b o urho o d of no de v in co ve r P A . It is clear the definition 1 really define the category . The iden t ity map of suc h category is the iden tity inclusion map of a correct syn tax diagram to itself. The category D G defines correct syn tax diag rams, but further we ’ll need the extension of this b y neigh b ourho o d diagrams. Name t his new category as E xt ( D G ), but often will also name it the category of correct syn ta x diagram. Definition 2. Let G = { G a : a ∈ A } – neigh b ourho od g r a mmar defined on category D D G – catego r y of correct syn tax diagrams, defined b y the grammar G on category D . Define extension E xt ( D G ) of categor y D G as f ollo ws: • Ob jects of category E xt ( D G ) are the o b jects of category D G , and also all neigh b ourho o d diagrams of g r ammar G . • Let A and B – ob jects of category E xt ( D G ). The set of ma ps H om E x t ( D G ) ( A, B ) is defined b y follow s: (1) If A and B – correct syn tax diagrams, i.e. A, B ∈ O b ( E xt ( D G )), then H om E x t ( D G ) ( A, B ) = H om D G ( A, B ). (2) If A – some neigh b ourho od D a ∈ G a , a nd B ∈ O b ( D G ), then H om E x t ( D G ) ( A, B ) consists of inclusion mappings of elemen ts ( v , D a ) ∈ P , where P – syn tax co v er of diagram B . (3) If A ∈ O b ( D G ), and B – some neighbourho o d D a ∈ G a , then H om E x t ( D G ) ( A, B ) = ⊘ . (4) If A and B – s ome neigh b our ho o d diagrams, then if A a nd B b e the same neighbourho od D a ∈ G a , then H om E x t ( D G ) ( A, B ) = 1 D a , where 1 D a – iden t ical inclusion mapping of neigh b ourho o d diagram D a to itself. In the con trary case H om E x t ( D G ) ( A, B ) = ⊘ . SYNT AX TOPOLO GIES 5 Prop osition 1. E xt ( D G ) is a category . Pr o of . Indeed, it is enough to sho w, that en umerated in the definition 2 morphisms satisfy the axioms of category . By definition, an eac h ob ject of category E xt ( D G ) has the iden tical map, it is the inclusion mapping of the diagra m to itself. Let D a b e some neighbourho od diagram. It is the ob ject of category E xt ( D G ). There exists only one map with the end on ob ject D a – the identical inclusion o ne. If s is some morphism from D a to correct diagram ( D , P ) and s ′ – map fro m diagram ( D , P ) to correct diag ram ( D ′ , P ′ ), then clear, there exists comp osition s ′ ◦ s selecting neigh b ourho o d D a of some no de v signed b y sym b ol a in diagram D ′ b y suc h the w a y that D a is the elemen t of syntax co v er P ′ . Asso ciativit y , clear, is also true. It is in teresting, that if there exists some diag ram of neighbourho od D a , whic h is itself the correct diagram ( D a , P ) a s w ell, then there different ob jects f or neigh b ourho o d diagr a m D a and correct diagram ( D a , P ) in cat ego ry E xt ( D G ). 4. Synt ax topologies T op ological space ( X , T ), defined on set X b y top ology T , ma y b e view ed as the metho d of selection of op en subsets from the set of all subsets of set X . An each op en subset of X has the co v er consisting of op en subsets of X . The same situation is in the category of syn tax diagrams a b o ve the giv en alphab et and satisfying b y the given con- ditions on view of diagra ms. But, some neigh b o urho o d grammar is used to select correct diagrams instead the top olog y . Th us, there is the idea to define a neigh b ourho od grammar as the top o logy of a sp ecial kind, defined o n the category of correct syn tax diagrams. But, w e’ll use extended category E xt ( D G ) as the ba se for t he definition. Recall that siev e o n ob ject A of category C is the f a mily of maps S = { f : C od ( f ) = A } satisfying b y follo wing condition: if f ∈ S and h : B → D om ( f ), then f h ∈ S . In category E xt ( D G ) eac h morphism on some o b jec t D defined either the correct sub diagram of the ob ject D , or the neighbourho o d diag ram a s elemen t of its syn tax co v er. Because, siev e in catego ry E xt ( D G ) is just the set of correct and neigh b ourho o d sub diagrams of the giv en diagram, closed b y op eration of sub diagram’s getting from eac h its ob ject. F or example, the siev e ma y consists of some sub diag ram of giv en diagram and all p ossible correct and neigh b ourho o d sub diagrams of this subdiagra m. Thes e sub diagrams are also the sub diagrams of the give n diagram, so the set closed and. clear, is t he siev e. There may b e defined Grothendiec k’s top olog y on an y small categor y . Recall the definition ([4] def. 0.32) . Definition 3. Grothendiec k’s to p ology on small category C is the function J , whic h maps eac h ob ject A of category C to family J ( A ) of siev es on the ob ject and satisfying b y follow ing conditions: 6 VLADIMIR LAPSHI N (1) Maximal siev e h A = { f : C od ( f ) = A } belongs to J ( A ). (2) (Stabilit y axiom) If S ∈ J ( A ) and h : B → A , then siev e h ∗ ( S ) = { f : C od ( f ) = B , hf ∈ S } b elongs t o J ( B ). (3) (T ransitivit y axiom) If S ∈ J ( A ) and R – an y siev e on A , suc h that h ∗ ( R ) ∈ J ( B ) fo r all B h → A ∈ S , then R ∈ J ( A ). Small category Grot hendiec k’s top o logy with J named as site. The siev es from the families J are named as J -co vers . Ob viously , if a category ha s fib ered pro ducts, then Gro thendiec k’s top olo gy is defined b y using of so named base – the f amilies that giv e rise to Grothendiec k’s top ology . In our case, it is also p ossible to define fib ere d pro ducts for ob jects of category E xt ( D G ), but this do es not mak e big sense in ling uistic interpretation. Because the Grothendiec k’s top o logy for category E xt ( D G ) will b e defined b y using of another definition of base – for categories, that ha v e not fib ered pro ducts. Suc h the base is defined in [3] p. 15 6 , ex. 3. Definition 4. Let C b e a small category . Define ba se of Grothendiec k’s top ology on category C as function K , whic h maps each o b ject A of category C to set of morphisms’ families havin g the end on ob ject A (co v ering K -families), satisfied b y following conditions: (1) If f : B → A – isomorphism, then family { f : B → A } b elongs to K ( A ). (2) (Stabilit y axiom) If { f i : A i → A | i ∈ I } ∈ K ( A ), then for eac h morphism g : B → A there exists co vering K -family { h j : B j → B | j ∈ I ′ } ∈ K ( B ), such that for eac h j exists f i , suc h that f i = g ◦ h j . (3) (T ransitivit y axiom) If { f i : A i → A | i ∈ I } ∈ K ( A ) and if for eac h i ∈ I there exis ts family { g ij : B ij → A i | j ∈ I i } ∈ K ( A i ), then { f i ◦ g ij : B ij → A | i ∈ I , j ∈ I i } ∈ K ( A ). No w define the base of Grothendiec k’s top olo g y on catego ry E xt ( D G ). Definition 5. Let D = { A, S, C } b e a category of syn tax diagrams, G = { G a : a ∈ A } – neigh b ourho o d grammar and E xt ( D G ) – category of correct syn tax diagra ms. Define the base of Gro thendiec k’s top ology as function K G , whic h maps eac h ob ject D of category E xt ( D G ) and is satisfied b y follow ing conditions: (1) F amily { D I } , where D I is isomorphism, b elongs to K G ( D ). (2) If D – correct diagram ( D , P ), then family of morphisms { f v : D v → D } , where D v ∈ P for each no de v of diagram D , b elongs to K G ( D ). Prop osition 2. F unction K G , defined in 5, is the base o f some Grothendiec k’s top ology on category E xt ( D G ). SYNT AX TOPOLO GIES 7 Pr o of . The first axiom of base of top olo gy definition clear is true for an y ob ject o f category E xt ( D G ). Show that tw o other axioms ar e a lso true. Stability axiom. Let D b e an ob ject of category E xt ( D G ), whic h has non trivial cov ering fa mily K G ( D ) (i.e. syn tax co v er). It’s clear that a correct syn tax diagram ( D , P ) and family o f inclusion maps of syn ta x co v er P on diagram D is eleme nt of K G ( D ). If s : D ′ → D – inclusion map o f some dia g ram D ′ ∈ O b ( E xt ( D G )) in diagram D , then t here exists syn ta x co v er P ′ of dia gram D ′ , whic h defines the ob ject (the pair) D ′ of category E xt ( D G ). The inclusion maps of neigh b ourho o d diagrams o f syntax co v er P ′ are the f a mily on K G ( D ′ ). The comp osition of these maps with map s gives exactly the needed elemen ts of cov ering family K G ( D ). T r ansitivity a xiom. If K G ( D ) – cov ering fa mily of an ob ject D of category E xt ( D G ), then there is only p ossible co v ering family on eac h ob ject D , it is trivial one (elemen ts of syn tax co v er are neigh b o ur- ho o ds). The family of comp ositions o f eleme nts of trivial cov ers (iden- tical maps of neigh b ourho o ds diagrams) and inclusion mappings of eac h neigh b ourho o d diagram in ob ject D is the same co v ering family , i.e. an elemen t of K G ( D ). The function K G ma y b e transformed to G rothendiec k’s top ology J on category E xt ( D G ) b y the standard w a y . It is enough to get all p ossible complemen ts of inclusion maps of co v ering families of function K G ( D ) for eac h ob ject D ∈ E xt ( D G ). An eac h trivial f amily b ecames the maximal siev e on ob ject D and an eac h syn tax co v er sta ys the same. Definition 6. Let D = { A, S, C } b e a category of syn tax diagrams, G = { G a : a ∈ A } – neighbourho o d gra mmar and E xt ( D G ) – the category of correct syn tax diagram on cat ego ry D . Sy ntax top o logy J G based on neigh b ourhoo d grammar G is the Grothendiec k’s top ology , defined on category E xt ( D G ) by the follo wing w ay: • F or an each ob ject D of category D G J G ( D ) con tains maximal siev e on ob ject D . • If ( D, P ) ∈ E xt ( D G ) – correct diagram, then the family of morphisms of elemen ts of the giv en syntax cov er P b elongs to J G ( D ). 5. Ca tegor y Sets E x t ( D G ) op and shea ve s, defined by synt ax topologies It may b e p oss ible t o map an eac h ob ject o f category E xt ( D G ) to the set of some its se nses ( a bstract meanings). The abstraction is that one do e s not in teresting what is the concrete elemen t of such the set, but there t a k es in accoun t that this meaning exists. Ev en if the syn ta x diagram do es not ha v e any practical se nse, suc h the set can 8 VLADIMIR LAPSHI N b e mapp ed – it is t he empt y set. The set of meanings ma y con tain p oten tially infinite num b er of elemen ts. Because it mak es sense to use ob ject of category Sets as images of the giv en map. The map of eac h o b jec t of category E xt ( D G ) to some se t of its meanings burns the con trv ar ia n t functor (name this as F ) from cate- gory E xt ( D G ) to category of sets Sets . Indeed, mapping F is defined on eac h ob ject of category E xt ( D G ). F or eac h morphism s : D ′ → D ob jects D ′ , D ∈ O b ( E xt ( D G )) there is map F ( f ) : F ( D ) → F ( D ′ ) of a ccorded sets o f sense s, which maps each meaning m ∈ F ( D ) of diagram D to the meaning m ′ ∈ F ( D ′ ) of subdiag r am D ′ , exactly the sense, whic h deriv ed b y sub diagram D ′ from t he diagra m D and mean- ing m . If D ∈ O b ( E xt ( D G )) and 1 D is identical map, then the map 1 F ( D ) is clear defined a s iden tical map on the set F ( D ). It is also not hard to see that F is in v ersely tr ansitiv e functor. Th us, it is pro v en that F is f unctor F : E xt ( D G ) op → Sets . The contrv arian t functor from an y category to category o f sets is named a lso as subsheaf of sets. So, F is subs heaf of sets on category E xt ( D G ). An eac h subsheaf of sets on categor y E xt ( D G ) ma y b e view ed as the lang ua ge. So , define the catego r y of languages defined b y the giv en grammar G as category Sets E x t ( D G ) op of con trv a rian t functors from E xt ( D G ) to category of sets Sets . The ob jects of the category are subshea v es F : E xt ( D G ) → Sets (i.e. languages defined b y that grammar) and morphisms are natural transfor ma t io ns of the languages. Let tak e a lo ok on the prop erties of the category . As it is kno wn, ([3] c hapter 1) catego r y Sets C op of subsheaf of sets o n eac h lo cally small cat ego ry C (in particular, the category Sets E x t ( D G ) op ) is top os, and so: • Finitely full and finitely cof ull. • Has exp onential of an y t w o subshea ve s. • Has the sub ob jects classifie r 1 true → Ω. Consider what is the sub ob jects classifier 1 true → Ω on catego r y Sets E x t ( D G ) op . According t o ([3] p. 38 ) subo b jects classifier o n category subshea ve s o f sets Sets C op is constructed b y following w a y: an eac h o b- ject A of category C ma pp ed to set Ω( A ) = { S : S ”— siev e on A } of all siev es o n ob ject A . An eac h morphism f : A → B is mapp ed to the morphism Ω( f ) : Ω( B ) → Ω( A ), whic h maps eac h siev e S B ∈ Ω( B ) on ob ject B to siev e S A ∈ Ω( A ) on ob jec t A by getting the in v erse image of morphism f , – the set Ω( f )( S B ) = { h : hf ∈ S B } . Th us, Ω( f )( S B ) selects that set of sub diagrams of diagra m A , whic h are sub diagrams of diagram B and b elongs to S B . F unctor Ω classifies subfunctor S of functor F by the follow ing wa y . Let m ∈ F ( B ), there ma y b e tw o cases: (1) m ∈ S ( B ). (2) m / ∈ S ( B ). SYNT AX TOPOLO GIES 9 The first case means that sense m , defined o n syn tax construct B by functor F is the same a s the sense on B giv en b y its subfunctor S . In the case, natural transformat io n χ F S : F ( B ) → Ω( B ) maps elemen t m to maximal siev e h B on B , that means the sense, giv en the syn tax construction b y functor F , is the same as the sense that give s the subfunctor S on a ll sub diagra ms of B . In the second case, there is some meaning of syn ta x construction B , giv en b y functor F , whic h do es not give b y functor S . Then χ F S ( B )( m ) defines some siev e on B , whic h really is just a maximal sub diagram A of diagram B , on whic h the sense that derive d fr om t he sense m is equal to some meaning on S ( B ). So, the mean of sub ob jects classifier Ω( B ) in category Sets E x t ( D G ) op is to select the syn tax sub constructions on t he giv en diagra m B , where the senses g iv en by functor and subfunctor are the same. It is interes ting what ar e initial and terminal ob jects in category Sets E x t ( D G ) op . An initial ob ject maps an eac h syntax construct to empt y set o f senses. So, it can b e seen as really formal language where an y syn tax construction do es no t hav e an y meaning. A terminal ob jec t maps a n eac h syn t a x construct to the set consisting of exactly one sense. Suc h the functor can b e in terpreted as unam biguit y la ng uage. The unam biguity language am y b e used to select meanings in other languages. It is needed to define the cases the subshea v es on cat ego ry E xt ( D G ) are shea v es. The sheav es ma y b e in terpreted as languages that satisfy c omp ositionality p rinciple , whic h in our terms can b e formulated by the f o llo wing w ay: Definition 7. An eac h sense of the correct syn tax diagram is uniquely defined b y the senses of all its syn t a x subconstructions. Recall the sheaf definition on Grothendiec k’s top ology ([3] p. 122): Definition 8. Let ( C , J ) b e a site. Subsheaf F : C op → Sets is sheaf, if for eac h ob ject A ∈ O b ( C ) a nd for eac h siev e S ∈ J ( A ) diagra m F ( A ) e / / Q f ∈ S F ( D om ( f )) p / / a / / Q f ,g F ( D om ( g )) where D om ( f ) = C od ( g ), and map e is equalizer of p and a . Maps p and a are defined as follows: • e = { x · f } f = { F ( f )( x ) } f . So that, for eac h x ∈ F ( A ) se- lected the elemen t o f pro duct Q f ∈ S F ( D om ( f )), consisted of im- ages F ( f )( x ). • If x = { x f } f ∈ S – ele men t of pro duct Q f ∈ S F ( D om ( f )), then p ( x ) f ,g = x f g and a ( x ) f ,g = x f · g . So that, the map p is defined via images of f unctor F o n comp ositions f g , and map 10 VLADIMIR LAPSHI N a – via action o f functor F , defined by morphism g on elemen ts x f . In o ur in terpretation, the pro duct Q f ∈ S F ( D om ( f )) is just the collec- tion of senses, selected from eac h subdiag ram A , and e maps eac h sense on diagram A to collection of senses on its sub diagra ms. The mapping is defined b y subsheaf F . And a lso there is the condition that selected collection o f senses, defined on sub diagrams, should b e ag reed in the sense, that if some meaning n on diagram A is mapp ed b y subsheaf F to meaning m on sub diagram D , and meaning m is mapp ed to meaning k on sub diagram D ′ of diagram D , then meaning k uniquely mapp ed b y functor F to meaning n . Subsheaf F is sheaf, if an each family of senses agreed on siev e S has uniquely defined sense on diagram A for each siev e S ∈ J ( A ). As e is equalizer, each sense on diag r am A uniquely glued from some agreed family on its sub diagrams b elong t o eac h siev e S ∈ J ( A ). In Grothendiec k’s top olog y , whic h is defined b y some neigh b ourho od grammar, there are maxim um tw o siev es on eac h ob jec t: maximum siev e and syn tax co ve r for correct dia g ram. But, to subsheaf to b e a shea v e, it is enough to each family of senses agreed on syn tax co ver of a diag ram is glued to the uniquely defined sense on this diagra m. So, to understand the giv en subsheaf is sheaf sufficien tly only to mak e sure that each meanings family on the neigh b ourho o d uniquely glued to the sens e on the diagram. Indeed, if D is a correct syn tax diagra m and D ′ – its cor r ect sub diagram, then each sense on D ′ uniquely glued from senses o n its neigh b ourho o ds. So, t o F b e a sheaf it’s needed this sense should b e mapp ed to that meaning on diagram D , whic h glued from meanings on its neigh b ourho ods. So, it is true for following: Prop osition 3. Let D = { A, S, C } b e a category of syn tax diagrams, G = { G a : a ∈ A } – neigh b ourho od grammar, E xt ( D G ) – category of correct syn tax diagra ms on category D and J G – syn tax top olog y defined b y grammar G . Subsheaf of senses F on category E xt ( D G ) is sheaf if and o nly if each sense on correct syn tax diag ram D is uniquely defined b y each agreed family of senses on elemen ts of its syn tax co v er. It is clear that the definition of sheaf on syn tax top ology is exactly the reforma lize of comp ositionality principle. And more, the definition 3 mak es t he comp o sitionalit y principle “lo cal”, reducing its conditions to b e true only on syn tax co v ers. The subob jects classifier Ω in category of shea ves of senses on cate- gory E xt ( D G ) as usually maps an eac h o b ject to set of closed in the giv en syn tax top ology siev es o n the giv en ob ject. Siev e S on ob ject A is named as closed in Grothendiec k’s top ology J , if for eac h morphism f : C od ( f ) = C , if f ∗ ( S ) ∈ J ( D om ( f )), then f ∈ S . So that, if set of morphisms g , whose comp ositions f g with morphism f b elong to siev e SYNT AX TOPOLO GIES 11 S a r e the cov ering fa mily in J , then morphism f also should b elong to siev e S . In category E xt ( D G ) a siev e is closed if tog ether with eac h sub diagram it con tains and all p o ssible syn tax cov ers of this sub dia- gram. This is t he analog of principal siev e in top olog y on the sets. The classification of sheaf is doing ob viously: an eac h elemen t x ∈ F ( C ) is mapp ed to set of morphisms { f | C od ( f ) = C and x · f ∈ P ( D om ( f )) } . This set is the siev e and it is closed one if P is sheaf. Category Sets E x t ( D G ) op is an elemen tary top os ([3] prop. 4 p. 14 3 ). In particularly , Sets E x t ( D G ) op con tains all finite limit and colimits. F or example, catego ry Sets E x t ( D G ) op con tains bo th forma l and ambiguit y languages, that are, accordingly , initial and terminal ob jects in this category . 6. Conclusion Category Sets E x t ( D G ) op lik es to see a con v enien t mathematical to ol for studying b oth syn ta x and seman tic prop erties of la nguages. The giv en in the article connection b etw een neighbourho od grammars a nd Grothendiec k’s top ologies a llows to apply metho ds of top ology and category theory to study the languages. The problems are needed to b e study in future lik e to be follow s: • Study the cases when it is p oss ible to define neighbourho od grammars basing on an arbitra ry Gr othendiec k’s top ology on site ( C , J ). • Analyse the syn tax complexit y of languages basing on the geo- metrical complexit y o f theirs syn tax diagra ms. • Study in more details the relations b et w een languages defined b y the give n neighbourho od grammar as w ell a s the relations b e- t w een categories of shea ves of senses defined b y differen t neigh- b ourho o d grammars. Reference s [1] Borschev V., Homy ako v M. Neighb ourho o d gr ammars and tr anslation mo dels. Part one. N eighb ourho o d gr ammars. // Moscow: Nauc hno-technic hesk ay a in- formacsiya, seria 2, 1 970, num b er 3, p. 39-4 4 . [2] Borschev V., Ho myak ov M. Ax iomatic appr o ach to description of formal lan- guages. In c ol le ction Mathematic al linguistic. // Moscow: Nauk a, 19 73, p. 5-47. [3] Mac L a ne S., Mo erdijk I. She aves in Ge ometric and L o gic. A First In tr o duction to T op os the ory. // Springer-V erlag : New Y or k, 19 92, 62 9 . [4] Johnstone P . T op os The ory. // Academic Press: London, 1977. [5] Lapshin V. Syntax diagr ams as a formalism for rep r esentation of syntactic r e- lations of formal languages. : in printing. [6] Mac La ne S. Cate gories for the Working Mathematician. / / Springer-V erlag : New-Y o rk, 1971. [7] Shreider Y. Neighb our ho o d mo del of a language. Pr o c e e ding symp osium ab out gener ative gr ammars. // T artu: September 19 67.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment