File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/88/c88-1009_metho.xml
Size: 17,941 bytes
Last Modified: 2025-10-06 14:12:07
<?xml version="1.0" standalone="yes"?> <Paper uid="C88-1009"> <Title>Feature Graphs and Abstract Data Types: A Unifying Approach</Title> <Section position="3" start_page="40" end_page="40" type="metho"> <SectionTitle> 2. Featuregraphs </SectionTitle> <Paragraph position="0"> A feature graph is a directed graph with a distinguished root node. The edges of the graph are called features. An atomic graph is just a symbol; it contains no features. A complex graph is a set of feature-value pairs where each value is either an atomic graph or again a complex one. Two paths starting at the root and ending at the same node are said to co-.refer. Feature graph unification is a binary eperation taking two graphs and returning\[ a graph containing exactly the informat J.on of both graphs if they are unifiabl~. ~, and fails otherwise. An atomic graph is unifiable only with itself and the empty graph. A complex graph G~ is unifiable with the, empty graph, and G~ is unifiable with a complex graph G2 if for all features in both G: and G2 the respective vahles are unifiab\](~deg Several notations for feature graphs have been suggesteddeg The graphical representation of</Paragraph> </Section> <Section position="4" start_page="40" end_page="42" type="metho"> <SectionTitle> NP </SectionTitle> <Paragraph position="0"> could al~o be represented in matrix form:</Paragraph> <Paragraph position="2"> in the matrix notation coreference is indicated by numbers enclosed in brackets.</Paragraph> <Paragraph position="3"> Another notation, which for instance is employed in PATR, uses special equations indicati\[Lg coreference of paths and atomic values aL the end of of paths, respectively:</Paragraph> <Paragraph position="5"> In the following we will discuss an equatJon~l representation of feature graphs in greater detail. This representation will be oriented towards the equational specification of abstract data types, thus making ~.vai lable the powerful machinery developed for such specificationsdeg Above we did not make a clear distinction between the syntax for describing feature graphs and feature graphs as semantical objects. In fact, such a distinction has been omitted to a large extent in the literature.</Paragraph> <Paragraph position="6"> The situation changed with approaches that formalize the concepts of feature graphs since such a distinction is essential for a formal treatment (see e.g. \[KR 86\], \[Jo 87\]). In the area of ADT specifications the strict separation of the syntactic and the semantic level has ulways beet* a central aspect. Our ADT-.based approach to feature graphs adopts this two-level view in a natural way: Feature graph specifications are the syntactical means to describe feature graphs which are the models (or structures) of such specifications.</Paragraph> <Section position="1" start_page="40" end_page="42" type="sub_section"> <SectionTitle> 3._Equational Specifications 3oi ADT Specifications: Syntax and Semantics </SectionTitle> <Paragraph position="0"> We introduce the basic notions of abstract data type specifications. More detailed information can be gathered in \[GTW 78\] or \[EM 85\].</Paragraph> <Paragraph position="1"> A s.~gt_ure is a pair Z = <S, O> where S is a set of sorts and O = <O > a family of sets of ~erators w.r.t. S. We write op: s~ ...s~ -> s for an operator whose i-th argument is of sort s~ and which delivers a result of sort s. The well-fermed terms w.r.t. Z and S-sorted variables V form an S-indexed family Tz (V), and an equation over ~ and V is of the form i = r where 1 and r are terms of the same sort. An al~@hraic ~gcifiqation is a pair SP = <Z, E> where Z is a signature and E is a set of equations over Z and some family of variables V.</Paragraph> <Paragraph position="2"> Besides these syntactical concepts of ADT specifications we provide the basic semantical concepts of heterogenous algebras: Given a signature ~ = <S, O>, a ~-algebra A consists of a family of sets A = < A, > .... and for each operator op e O .... there is a function opA : A, ---> A~ . A satisfies an equation 1 = r if for each assignment of values from A to the variables of 1 and r the evaluation of 1 and r in A yields the same element of A. A is a <Z,E>-algebra if A satisfies every e ~ E.</Paragraph> <Paragraph position="3"> We say that E semantically implies an equation e if every <~,E>-algebra satisfies e. It is well-known that this model-theoretic notion of satisfaction coincides with the proof-theoretic notion of deduction (Birkhoff theorem) where e can be proved from E iff e can be deduced from E using the rules of the equational calculus (e.g. \[EM 85\]). We let E e denote the deductive closure of E.</Paragraph> <Paragraph position="4"> The following theorem is one of the central results of ADT theory and forms the basis fo\]:&quot; defining the semantics of a specification.</Paragraph> <Paragraph position="5"> Theorem: For each algebraic specification SP = <~, E> there is an initial algebra Tsp satisfying the equations in E.</Paragraph> <Paragraph position="6"> T~, is the so-called ~uotient term alqebr ~ consisting of congruence classes - obtained by factorization according to the equations in E - of constant terms over Z. The initial algebra Tsp is 'the ADT specified by SP. It can be characterized informally by two conditions: all its elements are denoted by some ground term (&quot;no junk&quot;), and it satisfies a ground equation e iff every other <Z,E>-algebra also satisfies e (&quot;no confusion&quot;). 3,2 Feature Graph Specifications Feature graphs can be seen as particular algebraic specifications (see also \[Pe 87\]): There are only constants (representing atomic values) and unary functions (representing the features) in the signature. We assume that ATOMS is the set of all atomic values and FEATURES is set of all features occuring in the feature graphs; both sets may be infinite in general. An equation s = t is given for paths having the same final node, or for paths ending at an atomic value.</Paragraph> <Paragraph position="7"> For instance, consider the feature graph %/ Following e.g. Pereira and Shieber (\[PS 84}) this feature graph can be described by the</Paragraph> <Paragraph position="9"> leaving the root symbol of the feature graph implicit and using the order for the attributes as in the examples of Section 2.</Paragraph> <Paragraph position="10"> However, in equational ADT specifications it is essential to state explicitly to which objects an equation can be applied.</Paragraph> <Paragraph position="11"> For simplicitly, we first assume that we have only one sort which we call &quot;universe&quot;, and that we have a variable x of sort &quot;universe'. By using a functional notation for the attributes and thus the reverse order of the attributes as compared to e.g. \[PS 84\], we would arrive at the specification sorts universe functions a: -> universe f,g,h: universe -> universe</Paragraph> <Paragraph position="13"> However, by simply introducing a universally quantified variable x of sort &quot;universe&quot; we run into problems: From</Paragraph> <Paragraph position="15"> by using the usual rules of the equational calculus and substituting f(x) for x in equation (2). The problem is that x should be quantified only over all objects described by the original feature graph. But f(x) is not neccessarily in this set, so we must find a way of avoiding such a substitution. A simple way of achieving this is to switch to another signature with an additional sort, say &quot;soi', denoting the &quot;sort of interest&quot; and comprising all objects described by a feature graph.</Paragraph> <Paragraph position="16"> The sort &quot;sol&quot; is then a subsort of sort &quot;universe'. This could be expressed by extending the algebraic specifications to include also subsort relationships, thus moving from many-sorted specifications (as described in Section 3.1) to so-called order-sorted specifications (e.g. \[GM 87\]).</Paragraph> <Paragraph position="17"> Here, we want to stick to the simpler case of many-sorted specifications.</Paragraph> <Paragraph position="18"> A subsort relationship in a many-sorted setting is expressed by an inclusion function which we will. denote by i: soi -> universe in our case. In order to avoid problems with empty sorts (\[GM 87\], \[EM 85\]) we assume that there is a constant &quot;const&quot; of sort &quot;sol'. For the rest of this paper we also assume that x is a variable of sort &quot;seA'. Thus~ the feature graph above gi~es rise to the feature fg-signature Z and a set of equations over Z and {x}.</Paragraph> <Paragraph position="19"> With the definitions above it shoud be obvious how to transform any feature graph G into a fg-specification ~(G): The signature of ~(G) contains all atoms and features occuring in G as constants resp. unary functions, and for any co-referring paths or any path ending with an atomic value there is an equation in ~(G). Thus, we have a well-defined function ~: Feature graphs -> fg-specifications making available the machinery that has been developed for algebraic specifications.</Paragraph> </Section> </Section> <Section position="5" start_page="42" end_page="44" type="metho"> <SectionTitle> 4. Consistency_ </SectionTitle> <Paragraph position="0"> In \[PS 84\] the only inconsistency considered is an equation of the form a ~ b where a and b are distinct constants. Such a situation Js called constant clash in \[Pe 87\] where additionally a constant L_cpmP!exf~lash is considered. Such a clash is &quot;any set of two equations e~ and e2 in which e~ equates some path p to some other path or atomic value and e2 equates a strict prefix of p to a constant&quot; \[Pe 87\].</Paragraph> <Paragraph position="1"> Whereas \[PS 84\] also consider cyclic feature graphs, Kasper and Rounds (\[KR 86\]), ~ome PATR-II implementations, and also the STUF formalism described in \[Us 86\], only allow for 99~fclic feature graphs. We will show that the absence of cycles in a feature graph car~ also be expressed as a consistency condition on the corresponding fg-specification.</Paragraph> <Paragraph position="2"> Below we use the machinery of abstract data types in order to define several notions of semantical, consistency for a feature grap\[b.</Paragraph> <Paragraph position="3"> Finest W(-: introduce a rio_tat:ior% A texfa</Paragraph> <Paragraph position="5"> Note that the notation f. ( . . . (f~ (t)) . .. ) reflects -the usual mathematical notation for function composition, whei'eas the ~)ath notation amp Loyed for feature graphs as sketched :i(l Section 2 uses the reverse order</Paragraph> <Paragraph position="7"> for all a, b ~. Atoms(Z) with a ~: b we have : u cons tagt/<'.omp.\].ex cons.isten tiff for all a~ b ~ Atoms(Z) and a\]\] pl, p2,</Paragraph> <Paragraph position="9"> for all p~ q ~ Features(Z) / there exists an element o ~ A,o+- with: p~(q~(i^(o))) + q^(i^(o)) SP is .g_grn}italrt cons:Lste.l-tt , cor~staL~t/gpmplgx collsiste_lJt or&quot; .gcycliq iff there is at least one mode\], of SP having the respective propert? .</Paragraph> <Paragraph position="10"> The above definition of\[ censJstency of a fg-specifi~ation SP suggests that one has to search through the entire (:lass of models of SP in or, let to determJ ne whether SP :i s consistent or net. The fol ).owing theorem shows the power ef initial models in the sense of shrinking the search space: only the initial model has to be considered.</Paragraph> <Paragraph position="11"> Theorem : The fg- speei ficaT-ion SP is constant consistent, constant/complex consistent, or acyclic iff the initial algebra Ts~, has the respective property.</Paragraph> <Paragraph position="12"> The above pz:opert:ies can be proven for the initial model by using the deductive closure E* of a set of equations E.</Paragraph> <Paragraph position="13"> Theoz'em : The initial algeblTa \[I,',3 ~ of the fg-spec\[fication SP is u constant consistent iff for all a, b ~ Atoms(Z) with a + b We have: a :: 'b ~/ E* ~i coiL.~tar~t/complex consistent iff for all a~ b C/ Atom:3(};) and all</Paragraph> <Paragraph position="15"> The equivalences established by these two theorems show us that the consistency of a fg-specification <Z, E> can be tested by inspecting tile deductive closure E* for the absence of certain equations, depending on which consistency aspects one is interested ill. Since E* may be too large for performing these tests efficiently it would be desirable to be able to perform the consistency tests on E only. ill the next section we develop a completion procedure for the set of equations E which transforms E into a normalized set E&quot; such that it Js sufficient to check E'. The complet.io~), procedure thus provides a simple and fast decision procedure for our consistency constraints.</Paragraph> <Paragraph position="16"> 5o _Ti)9 completion pr~cedure Our completion procedure is a variant of the Knuth-Bendix algorithm (\[KB 70\]) which J.s a well-known method for testing properties of rewrite rule systems and for transforming equations into a set of rewrite rules, which then constitute a decision procedure for the equality, in general, there are some problems with the Knuth-Bendix algorithm: \]it may not terminate, or it may terminate with failure. However, we csn show that due to the restricted form of equations these problems do not occur when dealing with fg-specifications.</Paragraph> <Paragraph position="17"> We first define an order relation ~ on the set T~ ({x}) of terms over an fg-signature Z. We assume that ATOMS (resp. FEATURES) is linearly ordered by ~^To~ (resp. ~ .... u~:~). Then we order T~ ({x}) using the lexicographic ordering induced by NA~oMs and N~^TunE~ : Let a, b ~ ATOMS, f~, g~ e FEATURES, and t T~ ({x}). a <,r b if a <^'roM~ b</Paragraph> <Paragraph position="19"> -<-T is the reflexive and transitive closure of <.~.</Paragraph> <Paragraph position="20"> Let SP : <Z,E> be a fg-specification. We assume that E does not contain any trivia\] equations of the form t :: t (otherwise we can just eliminate such equations from E).</Paragraph> <Paragraph position="21"> Le~na: For all 1 = r ~ E we have either 1 <~ r or r <.~ \]..</Paragraph> <Paragraph position="22"> Thus, without loss of generality, we assume that r <T 1 for all 1. = r s E (otherwise we can just exchange the lefthand and the righthand side of the equation). We call E a directed set of equations and we may write 1-> r instead of 1 = r.</Paragraph> <Paragraph position="23"> C~letion algorithm CP Transform E into a directed set of equations and apply successively any of the two following rules until none is applicable any more: \[\] LHS reduction: If there are two different equations (I) p(1) -> r (2) 1 -> r' in E then: Delete equation (I) from E If r <T p(r') then add p(r') -> r to E - If p(r') <~ r then add r -> p(r') to E \[Note: Nothing is added if p(r') and r are identical!\] * RHS__!'9_d&quot; u c t ion !_ If there are two different equations (I) 1 -> p(l') (2) 1&quot; -> r in E then: - Delete equation (I) from E i. e. E and E&quot; have the same deductive closure.</Paragraph> <Paragraph position="24"> This theorem assures that the completion procedure performs only syntactical modifications on the fg-specifications, but does not change their meaning. So we can use SP&quot; in order to test the consistency constraints of SP. The next theorem shows that stepping from SP to SP&quot; simplifies this task: instead of inspecting the deductive closure E* it suffices to inspect the set of The proof of this theorem is based on the fact that E&quot; is a confluent and terminating set of rewrite rules. Since the atoms are smaller than any non-atomic term with respect to the term order <~, for any equation a --> t in E&quot; with an atom a, t must also be an atom~ Therefore, any equation holding between atoms must be contained directly in E', implying the constant consistency property of the theorem. The other parts of 'the theorem follow from similar observations.</Paragraph> </Section> <Section position="6" start_page="44" end_page="44" type="metho"> <SectionTitle> 6. Unification </SectionTitle> <Paragraph position="0"> In Section 2 we presented three different notations for feature graphs, and in 3.2~ we introduced a translation ~ from feature graphs to fg-specifications. On the other hand, it is straightforward to transform a fg-specification SP into a feature graph C: The atoms and features of G are those occuring in the signature of SP and PShe equations of E reflect the coreferring paths resp. paths ending with an atomic value in Gdeg We denote this transformation by ~-~ : fg-specifications -> feature graphs Although ~-I (SP) and ~-i (CP(SP)) may be syntactically different since CP(SP)) contains equations in a reduced normal form, the two graphs are equivalent in the sense of feature graph unification: they are unifiab\].e with exactly the same feature graphs.</Paragraph> <Paragraph position="1"> Besides giving a basis for a simple consistency test and providing a normal form presentation for fg-specifications the completion procedure CP also provides the basis for a precise mathematical definition of feature graph unification. This is true regardless which consistency concept for feature graphs one wants to apply, e.g. J.f one wants to allow cyclic graphs or only acyclic ones. Thus, let X-consistent be either &quot;constant consistent&quot;, &quot;constant/complex consistent&quot;, &quot;acyclic&quot;, or any combination thereof. Let GI and G2 be feature graphs.</Paragraph> <Paragraph position="3"/> </Section> class="xml-element"></Paper>