TWiki> KitWiki Web>FinnishActivities>HfstHome>HfstOtherAsSimpleSymbols (2008-10-01, AnssiYliJyra) EditAttach

This page is an extension of page HfstOtherAsSimpleSymbol contributed by Kimmo Koskenniemi. This page is being completely rewritten elsewhere, in HfstOtherAsSimpleSymbol.

This page is devoted to a particular and simple interpretation for `identity-other`

(alias `=`

or `=:=`

) and `nonidentity-other`

(alias `?`

as a member of pairs such as `?:?`

, `?:a`

, and `a:?`

) and the corresponding implementation and consequences. The interpretation is in short:

- "other" is interpreted against the known or listed pairs rather than known or listed symbols.
- The symbols
`=`

and`?`

make the set of listed pairs complete:- The symbol
`=`

is used for those pairs`a:b`

that satisfy`a=b`

and that have otherwise not been listed. - The symbol
`?`

is used for those pairs`a:b`

that satisfy`a≠b`

and that have otherwise not been listed or covered by more restricted means. - If the set of listed pairs is closed under projection (
`a:b→a:a∧b:b`

), the interpretation of`=`

is similar to transition label`?`

in XFST transducers. - If the set of listed pairs is also closed under Cartesian product of the input and output alphabets, the interpretation of
`?:?`

is similar to transition label`?:?`

in XFST transducers.

- The symbol
- In FSTs, symbols
`=`

and`?`

are**like any other symbols**in their input and output alphabets. FSAs neither use`?`

nor pairs`a:b`

that satisfy`a≠b`

. - The interpretation of symbols
`=`

and`?`

are external to the machine and thus not coded in the transition or elsewhere in the machine. - The (pair) alphabet can contain pairs that are not used in transitions (e.g. as the result of the compilation of expression
`[^a]`

into FSA).

- The output projection of relation
`{ ?:? ?:A B:B }`

is`{ ? A B, B A B}`

.- In the relation
`{ ?:? ?:A B:B }`

, symbol pair`?:A`

corresponds to all pairs`a:A`

where`a≠A`

, and

symbol pair`?:?`

corresponds to all those pairs`a:b`

,`a≠b`

, not covered by pairs`?:A`

and`B:B`

. - In particular, pair
`?:?`

covers pairs`?:?`

,`?:B`

, and`B:?`

, but neither`?:A`

(because this was listed) nor`A:A`

(because`?:?`

covers only non-identity pairs). - This causes the production of two strings in the output projection.

- In the relation
- Two things happen in in the alphabet of FST1 under composition
`FST1 o FST2`

.- Because the class denoted by
`?:?`

contains some pairs with known symbols, they need to be "extracted" from`?:?`

into pairs that contain such symbols in the output tape.- For example, if the pair alphabet of FST1 is
`{ {?:?} {?:A} {B:B} }`

, it becomes extended as`{ {?:?,?:B} {?:A} {B:B} }`

. - This enforces the following
*property*: The resulting pair alphabet does not contain pair`?:?`

or it contains a pair`a:b`

only if it also contains pair`?:b`

. - If FSTs are represented in a tabular format where each column corresponds to different pairs used as labels, then
`=`

and`?:?`

could be interpreted as the`otherwise`

cases. By iterating over all the possible pairs`a:b`

and looking for the most specific column for the pair, we find transitions for every`a:b`

. For example, if we have column set`{{B:B}, {?:A} {?:?} }`

(note the order of columns), then`C:C`

and`C:B`

belong to the last column, but`C:A`

belongs to the center column.

- For example, if the pair alphabet of FST1 is
- The
*join*of output alphabet of FST1 and input alphabet of FST2 is computed. For example, if the pair alphabet of FST1 is`{ {?:?,?:B} {?:A} {B:B} }`

and the pair alphabet of FST2 is`{ {A:A}, {B:B}, {C:C} }`

, the pair alphabet of FST1 becomes`{ {?:?, ?:C}, {?:B}, {?:A}, {B:B} }`

.

- Because the class denoted by

- Iteration, inversion and reversion of FSTs (and FSAs if applicable) are produced without special treatment of symbols
`=`

and`?`

. - If the alphabets of FSAs including (
`=`

) or the pair alphabets of FSTs are identical (including`=`

and pairs with`?`

), then- the FST/FSA operations of union, concatenation, shuffle (and intersection if applicable) apply (without any special treatment of symbols
`=`

and`?`

). - the FSA operations of complementation apply (without any special treatment of symbols
`=`

).

- the FST/FSA operations of union, concatenation, shuffle (and intersection if applicable) apply (without any special treatment of symbols
- (check!) Output (input) projection of FST can be computed if the pair alphabet of FST do not use pairs
`?:?`

or it contains a pair`a:b`

only if it also contains pair`?:b`

(`b:?`

). - Composition of FST1 and FST2 can be computed without special treatment of symbols
`=`

and`?`

if- the output alphabet of FST1 and the input alphabet of FST2 do not use symbol
`?`

and they otherwise agree, or, - (check!) the pair alphabet of FST1 do not use pairs
`?:?`

or it contains a pair`a:b`

only if it also contains pair`?:b`

and

the pair alphabet of FST2 do not use pairs`?:?`

or it contains a pair`a:b`

only if it also contains pair`a:?`

.

- the output alphabet of FST1 and the input alphabet of FST2 do not use symbol
- If the alphabets of FSAs or FSTs fail to agree as above, the corresponding alphabets must be
**harmonized**by adding some transitions for symbols from the other automaton as described below. The interpretations of symbols`=`

and`?`

are thus deferred, partly to possible later operations where harmonization is needed, and partly to the**execution**of a FSA as a recognizer or FST as a transducer.

- One can use the SFST and OpenFST calculi as they are,
**no reworking of the internals**is necessary. - It will be easier to
**include further finite-state engines**in HFST in future. - Two-level rules (and other relating transducers) will be freed from the requirement of a predefined set of allowed pairs.
- The core of the HFST interface will be simpler, more general, and straight-forward.
- All stages refer to finite and known characters. No need to operate with infinite or truly unknown symbols (in definitions and operations) until at run-time when it is no more a problem (just match the symbol not in the known alphabet with a
`?`

transition and a`=`

transition). - XFST behaviour is close enough.
- A complete alphabet stays complete even after harmonization.
- Only one kind of harmonization. No separation with pair harmonization and symbol harmonization.
- The symbol
`?`

has only one interpretation. - More flexibility to combine composition and intersection topologies.
- Concrete pairs such as
`a:?`

often provide an efficient representation for the combinations of input symbol`a`

with all known output symbols, whereas XFST needs always heavy quadratic listings. - In contrast to XFST, does not assume that the pair alphabets are closed under projection, which gives the freedom to choose different input and output alphabets.
- When the known pairs are listed in the pair alphabet, there is no need to use transitions that combine known symbols but behave like
`=`

or like a`?`

-combination. This can reduce the number of transitions significantly in comparison to XFST. - The disjunction of
`=`

and`?`

equals to the meaning of`<.>`

in AFST, which conveys more compatibility. - It would be possible and enjoyable to contruct proofs that show that the sufficient conditions are maintained during harmonization and operations.
- It seems that even complementation of two-tape FSAs (special FSTs) preserves the pair alphabet as compact and is thus efficient as required by the TWOL-level rule compilation methods.
- When we use two different symbols
`= and =?`

, we do not need to consider`?`

different from`?:?`

as done in XFST networks. - When we use two different symbols
`= and =?`

, we can maintain the identity constraint of`=`

even when used as`=:=`

in labels of OpenFST and SFST transducers. - The "ANY" symbol or "ANY:ANY" pair that are often needed in regular expressions compile from elementary expressions to an FSA with transition on symbol
`=`

and an FST with parallel transitions on pairs`=:=`

and`?:?`

. Other uses of "ANY" are obtained by the correspondence between the operations in expressions and operation on networks.

- To harmonize FSA1, compute S12 as the difference of the concrete alphabet of FSA2 and FSA1 (counting
`=`

as a single symbol). - FOR EACH transition
`t`

from Qi to Qj in FSA1 with label`=`

, add a transition from Qi to Qj with each label in S12. - Note that if there are no
`=`

transitions in FSA1, nothing will be added. - Harmonize FSA2 similarly.

- To harmonize FST1, compute P12 as the difference of the concrete pair alphabet of FST2 and FST1 (counting
`=:==s, =?:?`

,`a:?`

,`?:a`

as single pairs). - FOR EACH transition
`t`

from Qi to Qj in FST1 with label`=`

, add a transition from Qi to Qj with each label`a:b∈P12`

, where`a=b`

and`a≠?`

. - FOR EACH transition
`t`

from Qi to Qj in FST1 with label`a:b`

containing`?`

, add a transition from Qi to Qj with each label`a:b∈P12`

, where`a≠b`

or`a=?`

or`b=?`

. - Note that if there are no
`=`

in transitions of FST1, nothing will be added. - Harmonize FST2 similarly.

- Clarification: output projection removes the input tape and replaces it with a copy of the output tape (the result is an FST), or it simply removes the input tape (the result is an FSA). Input projection is defined in a similar way.
- To harmonize FST1:
- Compute the set S1 of those symbols
`a`

that are output symbols of FST1 but whose pair`?:a`

is not in the pair alphabet of FST1. (For such symbols, the pair`?:?`

in the pair alphabet covers the combination`?:a`

.) - FOR EACH transition
`t`

from Qi to Qj in FST1 with label`?:?`

, add a transition from Qi to Qj with each label`?:a`

, where`a∈S1`

.- This is motivated by the fact that
`?:?`

is interpreted externally by the harmonization. - Pair
`?:?`

shoud act as`?:a`

unless`?:a`

is mentioned in the pair alphabet of FST1. - Note that if there are no
`?:?`

in transitions of FST1, nothing will be added.

- This is motivated by the fact that
- FOR EACH transition
`t`

from Qi to Qj in FST1 with label`a:?`

, add a transition from Qi to Qj with each label`a:b`

where`a≠b`

,`a,b≠?`

and`a:b`

was not in the pair alphabet of FST1 prior to this harmonization.- This is motivated by the fact that
`a:?`

stands for`a:b`

if`a:b`

is not explicitly listed in the pair alphabet. - Note that if there are no
`a:?`

in transitions of FST1, nothing will be added.

- This is motivated by the fact that

- Compute the set S1 of those symbols

- To harmonize FST1:
- Harmonize FST1 for output projection.
- Compute S21 as the difference of the concrete input alphabet of FST2 and output alphabet of FST1 (counting
`=`

as a single symbol). - FOR EACH transition
`t`

from Qi to Qj in FST1 with label`=:=`

, add a transition from Qi to Qj with each label`a:a`

such that`a∈S21`

.- Note that if there are no
`=:=`

in transitions of FST1, nothing will be added.

- Note that if there are no

- To harmonize FST2:
- Inverse FST1 and FST2, and exchange the names FST1 and FST2, harmonize FST1, exchange the names of FSTs again, inverse FSTs again.

- To harmonize FST1:
- Compute S21 as the difference of the concrete input alphabet of FST2 and output alphabet of FST1 (counting
`=`

as a single symbol). - Compute the set S1 of those symbols
`a`

that are output symbols of FST1 and input symbols of FST2 but whose pair`?:a`

is not in the pair alphabet of FST1. - FOR EACH transition
`t`

from Qi to Qj in FST1 with label`=:=`

, add a transition from Qi to Qj with each label`a:a`

such that`a∈S21`

.- Note that if there are no
`=:=`

in transitions of FST1, nothing will be added.

- Note that if there are no
- FOR EACH transition
`t`

from Qi to Qj in FST1 with label`?:?`

, add transition from Qi to Qj with each`?:a`

such that`a∈S1`

.- Note that if there are no
`?:?`

in transitions of FST1, nothing will be added.

- Note that if there are no
- FOR EACH transition
`t`

from Qi to Qj in FST1 with label`a:?`

, where`a≠?`

, add a transition from Qi to Qj with each label`a:b`

where`a≠b`

and`a:b`

was not in the pair alphabet of FST1 prior to this harmonization.

- Compute S21 as the difference of the concrete input alphabet of FST2 and output alphabet of FST1 (counting
- To harmonize FST2:
- Inverse FST1 and FST2, and exchange the names FST1 and FST2, harmonize FST1, exchange the names of FSTs again, inverse FSTs again.

-- AnssiYliJyra - 28 Sep 2008

Topic revision: r9 - 2008-10-01 - AnssiYliJyra

**TWiki Reference**

- ATasteOfTWiki
- TextFormattingRules
- TWikiVariables
- FormattedSearch
- TWikiDocGraphics
- InstalledPlugins
- TWikiReferenceManual

Copyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback