File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/88/p88-1035_metho.xml
Size: 28,258 bytes
Last Modified: 2025-10-06 14:12:12
<?xml version="1.0" standalone="yes"?> <Paper uid="P88-1035"> <Title>Unification of Disjunctive Feature Descriptions</Title> <Section position="4" start_page="286" end_page="286" type="metho"> <SectionTitle> 3 The Problem </SectionTitle> <Paragraph position="0"> The unification problem for disjunctive feature descriptions can be stated as follows: Given two formulae that describe feature structures, find the set of feature structures that satisfy both formulae, if it is nonempty, else announce 'fail'.</Paragraph> <Paragraph position="1"> The simplest way to deal with disjunction is to rewrite any description into disjunctive normal form (DNF). This transformation requires time and space exponential with the number of disjuncts in the initial formula in the worst case. Although the problem of unifying disjunctive descriptions is known to be NP-complete (see \[Kasper 87a\]), methods which avoid this transformation may perform well in most practical cases. The key idea is to keep disjunction local and consider combinations of disjuncts only when they refer to the very same substructure. This strategy, however, is complicated by the fact that feature structures may be graphs with path equivalences and not only trees. Fig. 3 shows an example where unifying a disjunction with a structure containing reentrancy causes parts of the disjunction to be linked to other parts of the structure. The disjunction is e:rported via this reentrancy. Hence, the value of attribute d cannot be represented uniquely. It may be + or -, depending on which disjunct in attribute a is chosen. To represent this information without extra formal devices we have to lift the disjunction one level up. 4</Paragraph> </Section> <Section position="5" start_page="286" end_page="287" type="metho"> <SectionTitle> 4 In this special case we still could keep the disjunction </SectionTitle> <Paragraph position="0"> in the attribute a by inverting the pointer. A pointer (a b) underneath label d would allow us to specify the value of d dependent on the disjunction under a.</Paragraph> </Section> <Section position="6" start_page="287" end_page="288" type="metho"> <SectionTitle> 4 From Description to Effi- </SectionTitle> <Paragraph position="0"/> <Section position="1" start_page="287" end_page="288" type="sub_section"> <SectionTitle> cient Representation </SectionTitle> <Paragraph position="0"> It is interesting to investigate whether FI~' is suitable as an encoding of feature structures, i.e. if it can be used for computational purposes.</Paragraph> <Paragraph position="1"> However, this is clearly not the case for the unrestricted set of formulae of FML', since a given feature structure can be represented by infinitely many different formulae of arbitrary complexity and -- even worse -- because it is also not possible to ascertain whether a given formula represents any feature structure at all without extensive computation.</Paragraph> <Paragraph position="2"> On the other hand, the formulae of FIK.' have some properties that are quite attractive for representing feature structures, such as embedded and general disjunction and the possibility to make use of the law of distributivity for disjunctions.</Paragraph> <Paragraph position="3"> Therefore we have developed an efficiencyoriented normal form F~F, which is suitable as an efficient representation for sets of feature structures. null The formulae are built according to a restricted syntax (Fig. 4, Part A) and have to satisfy condition Cs~j. (Part B). The syntax restricts the use of conjunction and TOP in order to disallow contradictory information in a formula other than TOP. However, even in a formula of the syntax of Part A inconsistence can be introduced by a pointer to a location that is 'blocked' by an atomic value on a higher level. For example in the formula a: (b c) A b:d the path (b c) is blocked since it would require the value of attribute b to be complex in conflict to the atomic value d, thus rendering the formula non-satisfiable. With the additional condition Cs~, such~inconsistencies are excluded. Its explanation in the next section is somewhat technical and is not prerequisite for the overall understanding of our method.</Paragraph> <Paragraph position="4"> Condition Cs .</Paragraph> <Paragraph position="5"> First we have to introduce some terminology.</Paragraph> <Paragraph position="6"> Instance: When every disjunction in a formula is replaced by one of its disjuncts, the result is called an instance of that formula.</Paragraph> <Paragraph position="7"> Realized: A recursive definition of what we call a reafized path in an instance ~b is giver in Fig. 5. The intuitive idea behind this notion is to restrict is realized in ~b, if ~b ~ TOP ! E L is realized in It : ~bt A... A 1, : ~b, (even if/~ {It...In}) l.p is realized in .-. A I : ~b A -.., if p is realized in p is realized in (p'), if pip is realized in the top-level formula pointers in such a way that the path to their destination may not be blocked by the introduction of an atomic value on a prefix of this path. Note that by virtue of the second line of the definition, the last label of the path does not have to actually occur in the formula, if there are other labels. Example: In a: (b c) only the path e and each path of length 1 is realized. Any longer path may be blocked by the introduction of an atomic value at level 1. Thus, the formula violates CENP.</Paragraph> <Paragraph position="8"> a:(b d) A b:(c) A c:(d:x V b:y), on the other hand, is a well-formed gNF formula, since it contains only pointers with realized destinations in every disjunct.</Paragraph> <Paragraph position="9"> The easiest way to satisfy the condition is to introduce for each pointer the value NIL at its destination when building up a formula. With this strategy we actually never have to check this condition, since it is maintained by the unification algorithm described below.</Paragraph> <Paragraph position="10"> The most important properties of formulae in ~.NF are: * For each formula of ~'llL' an equivalent formula in ENF can be found.</Paragraph> <Paragraph position="11"> * Each instance of a formula in C/-~ (besides TOP) denotes exactly one feature structure.</Paragraph> <Paragraph position="12"> * This feature structure can be computed in linear time.</Paragraph> <Paragraph position="13"> The first property can be established by virtue of the unification algorithm given in the next section, which can be used to construct an equivalent glD'formula for an arbitrary formula in FML ~.</Paragraph> <Paragraph position="14"> The next point says: It doesn't matter which disjunct in one disjunction you choose -- you cannot get a contradiction. Disjunctions in gNF are mutually independent. This also implies that TOP is the only formula in ENF that is not satisfiable. To see why this property holds, first consider formulae without pointers. Contradictory information (besides TOP) can only be stated using conjunction. But since we only allow conjunctions of different attributes, inconsistent information cannot be stated in formulae without pointers.</Paragraph> <Paragraph position="15"> Pointers could introduce two sorts of inconsistencies: Since a pointer links two paths, one might assume that inconsistent information could be specified for them. But since conjunction with a pointer is not allowed, only the destination path can carry additional information, thus excluding this kind of inconsistency. On the other hand, pointers imply the existence of the paths they refer to. The condition CB~ r ensures that no information in the formula contradicts the introduction of these implied paths. We can conclude that even formulae containing pointers are consistent.</Paragraph> <Paragraph position="16"> The condition CBN P additionally requires that no extension of a formula, gained by unification with another formula, may contain such contradicting information. A unification algorithm thus can introduce an atomic value into a formula without having to check if it would block the destination path of some pointer.</Paragraph> </Section> </Section> <Section position="7" start_page="288" end_page="291" type="metho"> <SectionTitle> 5 The Unification Procedure </SectionTitle> <Paragraph position="0"> Figure 6 shows an algorithm that takes as input two terms representing formulae in ~-IlF and computes an ElfF-representation of their unification. The representation of the formulae is given by a 1-to-l-mapping between formulae and datastructures, so that we can abstract from the data-structures and write formulae instead. In this sense, the logical connectives A, V, : are used as term-constructors that build more complex data-structures from simpler ones. In addition, we use the operator * to express concatenation of labels or label sequences and write (p) to express the pointer to the location specified by the label sequence p. p : ~ is an abbreviation for a formula where the subformula 4~ is embedded on path p.</Paragraph> <Paragraph position="1"> The auxiliary function unify-aux performs the essential work of the unification. It traverses both formulae in parallel and builds all encountered subformulae into the output formula. The following cases have to be considered: * If one of th~ input formulae specifies a sub-formula at a location where the other input provides no information or if both inputs contain the same subformula at a certain location, this subformula is built into the output without modification.</Paragraph> <Paragraph position="2"> * The next statement handles the case where one input contains a pointer whereas the other conrains a different subformula. Since we regard the destination of the pointer as the representative of the equivalence class of paths, the sub-formula has to be moved to that place. This case requires additional discussion, so we have moved it to the procedure move..Cormula.</Paragraph> <Paragraph position="3"> * In ease of two conjunctions the formulae have to be traversed recursively and all resulting attribute - value pairs have to be built into the output structure. For clarity, this part of the algorithm has been moved to the procedure unify_complex.</Paragraph> <Paragraph position="4"> * The case where one of the input formulae is a disjunction is handled in the procedure uaPS~y.ztisj that is described in Section 5.2.</Paragraph> <Paragraph position="5"> * If none of the previous cases matches (e.g. if the inputs are different atoms or an atom and a complex formula), a failure of the unification has to be announced which is done in the last</Paragraph> <Paragraph position="7"> for all i that appear in both ~ do let Vo,Vl be the values of 1 in Ao,at</Paragraph> <Paragraph position="9"> The most interesting case is the treatment of a pointer. The functional organization of the algorithm does not allow for side effects on remote parts of the top-level formula (nor would this be good programming style), so we had to find a different way to move a suhformula to the destination of the pointer. For that reason, we have defined our procedures so that they return two results: a local result that has to be built into the output formula at the current location (i.e. the path both input formulae are embedded on) and a global result that is used to express 'side effects' of the unification. This global result represents a formula that has to be unified with the top-level result in order to find a formula covering all information contained in the input.</Paragraph> <Paragraph position="10"> This global result is normally set to NIL, but the procedure move.for,,ula must of course produce something different. For the time being, we can assume the preliminary definition of move.formuXa in Figure 7, which will be modified in the next subsection. Here, the local result is the pointer (since we want to keep the information about the path equivalence), whereas the global result is a formula containing the subformula to be moved embedded at its new location.</Paragraph> <Paragraph position="11"> The function tinily_complex unifies conjunctions of label-value-pairs by calling tutify_aux recursively and placing the local results of these unifications at the appropriate locations. Labels that appear only in one argument are built into the output without modification. If any of the recursive unifications fail, a failure has to be announced.</Paragraph> <Paragraph position="12"> The global results from recursive unifications are collected by top-level unification 5. The third argument of unify_aux and unify_complex contains the sequence of labels to the actual location. It is not used in this version but is included in preparation of the more sophisticated treatment of pointers described below.</Paragraph> <Paragraph position="13"> To perform a top-level unification of two formulae, the call to unify.aux is repeated in order to unify the local and global results until either the unification fails or the global result is NIL.</Paragraph> <Paragraph position="14"> Before extending the algorithm to handle disjunction, we will first concentrate on the question how the termination of this repeat-loop can be guaranteed.</Paragraph> <Section position="1" start_page="289" end_page="290" type="sub_section"> <SectionTitle> 5.1 Avoiding Infinite Loops </SectionTitle> <Paragraph position="0"> There are cases where the algorithm in Figure 6 will not terminate if the movement of subformulae is defined as in Figure 7. Consider the unification of a:(b) A b:(a) with a:~. Here, the formula sl.f we Allow the global result to be a //~ o\].fm'm~do.e, this recursicm could be replaced by list-concatenation. However, this would imply modifications in the top-level loop and would slightly complicate the treatmem of disjunction.</Paragraph> <Paragraph position="1"> will be moved along the pointers infinitely often and the repeat-loop in unify will never terminate.</Paragraph> <Paragraph position="2"> An algorithm that terminates for arbitrary input must include precautions to avoid the introduction of cyclic pointer chains or it has to recognize such cycles and handle them in a special way.</Paragraph> <Paragraph position="3"> When working with pointers, the standard technique to avoid cycles is to follow pointer chains to their end and to install a new pointer only to a location that does not yet contain an outgoing pointer. For different reasons, dereferencing is not the method of choice in the context of our treatment of disjunction (see \[Eisele 87\] for details). However, there are different ways to avoid cyclic movements. A total order '<p' on all possible locations (i.e. all paths) can be defined such that, if we allow movements only from greater to smaller locations, cycles can be avoided. A pointer from a greater to a smaller location in this order will be called a positive pointer, a pointer from a smaller to a greater location will be called negative. But we have to be careful about chosing the right order; not any order will prevent the algorithm from an infinite loop.</Paragraph> <Paragraph position="4"> For instance, it would not be adequate to move a formula along a pointer from a location p to its extension p * q, since the pointer itself would block the way to its destination. (The equivalence class contains (p), (p q), (p q q)... and it makes no sense to choose the last one as a representative).</Paragraph> <Paragraph position="5"> Since cyclic feature structures can be introduced inadvertently and should not lead to an infinite loop in the unification, the first condition the order '<p' has to fulfill is: p<ppq if q#~ The order must be defined in a way that positive pointers can not lead to even indirect cycles.</Paragraph> <Paragraph position="6"> This is guaranteed if the condition p <p q =~ rps <p rqs holds for arbitrary paths p, q, r and s.</Paragraph> <Paragraph position="7"> We get an order with the required properties if we compare, in the first place, the length of the paths and use a lexicographic order <t for paths of the same length. A formal statement of this definition is given in Figure 8.</Paragraph> <Paragraph position="8"> Note that positive pointers can turn into negative ones when the structure containing them is moved, as the following example shows: a:b:c:d:(a b e) U a:b:c:(f) pos. pos.</Paragraph> <Paragraph position="10"> However, we can be pragmatic about this point; the purpose of ordering is the avoidance of cyclic movements. Towards this end, we only have to avoid using negative pointers, not writing them down.</Paragraph> <Paragraph position="11"> To avoid movement along a negative pointer, we now make use of the actual location that is provided by the third argument of unify-aux and unify_complex and as the second argument of move.~ormula.</Paragraph> <Paragraph position="12"> * If the pointer is positive we proceed as usual. * If it points to the actual location, it can be ignored (i.e. treated as NIL). This case occurs, when the same path equivalence is stated more than once in the input.</Paragraph> <Paragraph position="13"> * If the pointer is negative, it is inverted by in- null stalling at its destination a pointer to the actual position.</Paragraph> </Section> <Section position="2" start_page="290" end_page="291" type="sub_section"> <SectionTitle> 5.2 Incorporating Disjunction </SectionTitle> <Paragraph position="0"> The procedure unify-disj in Figure 10 has four arguments: the formula to unify with the disjunction (which also can be a disjunction), both disjuncts, and the actual location. In the first two statements, the unifications of the formula A with the disjuncts B and C are performed independently. We can distinguish three main cases:</Paragraph> <Paragraph position="2"> Figure 10: Unification with a Disjunction formula, a disjunction is returned as local result and the common global result of both disjuncts is taken as the global result for the disjunction. null * If both unifications have different global results, we can not return a disjunction as local result, since remote parts of the resulting formula depend on the choice of the disjunct at the actual location. This case arrives if one or both disjuncts have outgoing pointers and if one of these pointers has been actually used to move a subformula to its destination.</Paragraph> <Paragraph position="3"> The last point describes exactly the case where the scope of a disjunction has to be extended to a higher level due to the interaction between disjunction and path equivalence, as was shown in be to return a disjunction as global result where the disjuncts are the global results unified with the corresponding local result embedded at the actual position. However, it is not always necessary to return a top-level disjunction in such a situation. If the global effect of a disjunction concerns only locations 'close' to the location of the disjunction, we get two global results that differ only in an embedded substructure. To minimize the 'lifting' of the disjunction, we can assume a procedure pack that takes two formulae X and Y and returns a formula equivalent to X V Y where the disjunction is embedded at the lowest possible level.</Paragraph> <Paragraph position="4"> Although the procedure pack can be defined in a straightforward manner, we refrain from a formal specification, since the discussion in the next section will show how the same effect can be achieved in a different way.</Paragraph> </Section> </Section> <Section position="8" start_page="291" end_page="292" type="metho"> <SectionTitle> 6 Implementation </SectionTitle> <Paragraph position="0"> We now have given a complete specification of a unification algorithm for formulae in ENF. However, there are a couple of modifications that can be applied to it in order to improve its efficiency.</Paragraph> <Paragraph position="1"> The improvements described in this section are all part of our actual implementation.</Paragraph> <Paragraph position="2"> Unification of Two Pointers If both arguments are pointers, the algorithm in Figure 6 treats one of them in the sarne way as an arbitrary formula and tries to move it to the destination of the other pointer. Although this treatment is correct, some of the necessary computations can be avoided if this case is treated in a special way. Both pointer destinations and the actual location should be compared and pointers to the smallest of these three paths should be installed at the other locations.</Paragraph> <Paragraph position="3"> Special Treatment of Atomic Formulae In most applications, we do not care about the equivalence of two paths if they lead to the same atom. Under this assumption, when moving an atomic formula along a pointer, the pointer itself can be replaced by the atom without loss of information. This helps to reduce the amount of global information that has to be handled.</Paragraph> <Section position="1" start_page="291" end_page="292" type="sub_section"> <SectionTitle> Ordering Labels </SectionTitle> <Paragraph position="0"> The unification of conjunctions that contain many labels can be accelerated by keeping the labels sorted according to some order (e.g. <a). This avoids searching one formula for each label that occurs in the other.</Paragraph> <Paragraph position="1"> Organisation of the Global Results on a Stack In the algorithm described so far, the global result of a unification is collected, but is - apart from disjunction - not used before the traversal of the input formulae is finished. When formulae containing many pointers are unified, the repeated traversal of the top-level formula slows down the unification, and may lead to the construction of many intermediate results that are discarded later (after having been copied partially).</Paragraph> <Paragraph position="2"> To improve this aspect of the algorithm, we have chosen a better representation of the global result. Instead of one formula, we represent it as a stack of formulae where the first element holds information for the actual location and the last element holds information for the top-level formula. Each time a formula has to be moved along a pointer, its destination is compared with the actual location and the common prefix of the paths is discarded. From the remaining part of the actual location we can determine the first element on the stack where this information can be stored. The rest of the destination path indicates how the information has to be represented at that location.</Paragraph> <Paragraph position="3"> When returning from the recursion, the first element on the stack can be popped and the information in it can be used immediately.</Paragraph> <Paragraph position="4"> This does not only improve efficiency, but has also an effect on the treatment of disjunction. Instead of trying to push down a top-level disjunction to the lowest possible level, we climb up the stacks returned by the recursive unifications and collect the subformulae until the rests of the stacks are identical. In this way, 'lifting' disjunctions can be limited to the necessary amount without using a function like pack.</Paragraph> </Section> <Section position="2" start_page="292" end_page="292" type="sub_section"> <SectionTitle> Practical Experiences </SectionTitle> <Paragraph position="0"> In order to be compatible with existing software, the algorithm has been implemented in PROLOG.</Paragraph> <Paragraph position="1"> It has been extended to the treatment of unification in an LFG framework where indirectly specified labels (e.g in the equation (1&quot; (lpcase)) -- J. ), set values and various sorts of constraints have to he considered.</Paragraph> <Paragraph position="2"> This version has been incorporated into an existing grammar development facility for LFGs \[Eisele/D6rre 86,Eisele/Schimpf 87\] and has not only improved efficiency compared to the former treatment of disjunction by backtracking, but also helps to survey a large number of similar results when the grammar being developed contains (too) much disjunction. One version of this system runs on PCs with reasonable performance.</Paragraph> </Section> </Section> <Section position="9" start_page="292" end_page="293" type="metho"> <SectionTitle> 7 Comparison with Other </SectionTitle> <Paragraph position="0"/> <Section position="1" start_page="292" end_page="292" type="sub_section"> <SectionTitle> Approaches 7.1 Asymptotical Complexity </SectionTitle> <Paragraph position="0"> Candidates for a comparison with our algorithm are the naive multiplying-out to DNF, Kasper's representation of general disjunction \[Kasper 87b\], and Karttunen's treatment of value disjunction \[Karttunen 84\], also the improved version in \[Bear 87\]. Since satisfiability of formulae in FNL is known to be an NP-complete problem, we cannot expect better than exponential time complexity in the worst case. Nevertheless it might be interesting to find cases where the asymptotic behaviour of the algorithms differ. The following statements - although somewhat vague - may give an impression of strong and weak points of the different methods. For each given statement we have specific examples, but their presentation or proofs would be beyond the scope of this paper.</Paragraph> <Paragraph position="1"> the Represeatation) * When many disjunctions concern different substructures and do not depend on each other, our representation uses exponentially less space than expansion to DNF.</Paragraph> <Paragraph position="2"> * There are cases where Kasper's representation uses exponentially less space than our representation. This happens when disjunctions interact strongly, but an exponential amount of consistent combinations remain.</Paragraph> <Paragraph position="3"> * Since Karttunen's method enumerates all consistent combinations when several disjunctions concern the same substructure, but allows for local representation in all other cases, his method seems to have a similar space complexity than ours.</Paragraph> <Paragraph position="4"> There are cases where Kasper's method uses exponentially more time than ours. This happens when disjunctions interact so strongly, that only few consistent combinations remain, hut none of the disjunctions can be resolved.</Paragraph> <Paragraph position="5"> When disjunctions interact strongly, hut an exponential amount of consistent combinations remains, our method needs exponential time.</Paragraph> <Paragraph position="6"> An algorithm using Kasper's representation could do better in some of these cases, since it could find out in polynomial time that each of the disjuncts is used in a consistent combination. However, the actual organisation of Kasper's full consistency check introduces exponential time complexity for different reasons.</Paragraph> </Section> <Section position="2" start_page="292" end_page="293" type="sub_section"> <SectionTitle> 7.2 Average Complexity and Con- </SectionTitle> <Paragraph position="0"> clusion It is difficult to find clear results when comparing the average complexity of the different methods, since anything depends on the choice of the exampies. However, we can make the following general observation: All methods have to multiply out disjunctions that are not mutually independent in order to find inconsistencies.</Paragraph> <Paragraph position="1"> Kasper's and Karttunen's methods discard the results of such computations, whereas our algorithm keeps anything that is computed until a contradiction appears. Thus, our method tends to use more space than the others. On the other hand, since Kasper's and Karttunen's methods 'forget' intermediate results, they are sometimes forced to perform identical computations repeatedly.</Paragraph> <Paragraph position="2"> As conclusion we can say that our algorithm sacrifies space in order to save time.</Paragraph> </Section> </Section> <Section position="10" start_page="293" end_page="293" type="metho"> <SectionTitle> 8 Further Work </SectionTitle> <Paragraph position="0"> The algorithm or the underlying representation can still be improved or extended in various respects: null</Paragraph> </Section> class="xml-element"></Paper>