14a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// properties.h
24a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
34a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Licensed under the Apache License, Version 2.0 (the "License");
44a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// you may not use this file except in compliance with the License.
54a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// You may obtain a copy of the License at
64a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
74a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//      http://www.apache.org/licenses/LICENSE-2.0
84a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
94a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Unless required by applicable law or agreed to in writing, software
104a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// distributed under the License is distributed on an "AS IS" BASIS,
114a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
124a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// See the License for the specific language governing permissions and
134a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// limitations under the License.
144a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
154a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// \file
164a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST property bits.
174a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
184a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project#ifndef FST_LIB_PROPERTIES_H__
194a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project#define FST_LIB_PROPERTIES_H__
204a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
214a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project#include "fst/lib/compat.h"
224a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
234a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectnamespace fst {
244a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
254a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// The property bits here assert facts about an FST. If individual
264a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// bits are added, then the composite properties below, the property
274a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// functions and property names in properties.cc, and
284a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// TestProperties() in test-properties.h should be updated.
294a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
304a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
314a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// BINARY PROPERTIES
324a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
334a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// For each property below, there is a single bit. If it is set,
344a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// the property is true. If it is not set, the property is false.
354a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
364a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
374a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// The Fst is an ExpandedFst
384a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kExpanded =          0x0000000000000001ULL;
394a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
404a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// The Fst is a MutableFst
414a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kMutable =           0x0000000000000002ULL;
424a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
434a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
444a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// TRINARY PROPERTIES
454a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
464a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// For each of these properties below there is a pair of property bits
474a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// - one positive and one negative. If the positive bit is set, the
484a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// property is true. If the negative bit is set, the property is
494a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// false. If neither is set, the property has unknown value. Both
504a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// should never be simultaneously set. The individual positive and
514a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// negative bit pairs should be adjacent with the positive bit
524a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// at an odd and lower position.
534a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
544a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabel == olabel for each arc
554a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAcceptor =          0x0000000000010000ULL;
564a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabel != olabel for some arc
574a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotAcceptor =       0x0000000000020000ULL;
584a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
594a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabels unique leaving each state
604a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kIDeterministic =    0x0000000000040000ULL;
614a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabels not unique leaving some state
624a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNonIDeterministic = 0x0000000000080000ULL;
634a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
644a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// olabels unique leaving each state
654a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kODeterministic =    0x0000000000100000ULL;
664a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// olabels not unique leaving some state
674a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNonODeterministic = 0x0000000000200000ULL;
684a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
694a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has input/output epsilons
704a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kEpsilons =          0x0000000000400000ULL;
714a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has no input/output epsilons
724a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNoEpsilons =        0x0000000000800000ULL;
734a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
744a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has input epsilons
754a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kIEpsilons =         0x0000000001000000ULL;
764a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has no input epsilons
774a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNoIEpsilons =       0x0000000002000000ULL;
784a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
794a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has output epsilons
804a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kOEpsilons =         0x0000000004000000ULL;
814a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has no output epsilons
824a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNoOEpsilons =       0x0000000008000000ULL;
834a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
844a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabels sorted wrt < for each state
854a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kILabelSorted =      0x0000000010000000ULL;
864a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// ilabels not sorted wrt < for some state
874a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotILabelSorted =   0x0000000020000000ULL;
884a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
894a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// olabels sorted wrt < for each state
904a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kOLabelSorted =      0x0000000040000000ULL;
914a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// olabels not sorted wrt < for some state
924a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotOLabelSorted =   0x0000000080000000ULL;
934a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
944a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Non-trivial arc or final weights
954a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kWeighted =          0x0000000100000000ULL;
964a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Only trivial arc and final weights
974a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kUnweighted =        0x0000000200000000ULL;
984a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
994a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has cycles
1004a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kCyclic =            0x0000000400000000ULL;
1014a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has no cycles
1024a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAcyclic =           0x0000000800000000ULL;
1034a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1044a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has cycles containing the initial state
1054a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kInitialCyclic =     0x0000001000000000ULL;
1064a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST has no cycles containing the initial state
1074a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kInitialAcyclic =    0x0000002000000000ULL;
1084a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1094a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST is topologically sorted
1104a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kTopSorted =         0x0000004000000000ULL;
1114a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// FST is not topologically sorted
1124a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotTopSorted =      0x0000008000000000ULL;
1134a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1144a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// All states reachable from the initial state
1154a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAccessible =        0x0000010000000000ULL;
1164a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Not all states reachable from the initial state
1174a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotAccessible =     0x0000020000000000ULL;
1184a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1194a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// All states can reach a final state
1204a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kCoAccessible =      0x0000040000000000ULL;
1214a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Not all states can reach a final state
1224a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotCoAccessible =   0x0000080000000000ULL;
1234a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1244a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// If NumStates() > 0, then state 0 is initial, state NumStates()-1 is
1254a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// final, there is a transition from each non-final state i to
1264a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// state i+1, and there are no other transitions.
1274a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kString =            0x0000100000000000ULL;
1284a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1294a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Not a string FST
1304a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNotString =         0x0000200000000000ULL;
1314a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1324a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
1334a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// COMPOSITE PROPERTIES
1344a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
1354a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1364a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties of an empty machine
1374a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1384a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNullProperties
1394a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kAcceptor | kIDeterministic | kODeterministic | kNoEpsilons |
1404a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNoIEpsilons | kNoOEpsilons | kILabelSorted | kOLabelSorted |
1414a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kUnweighted | kAcyclic | kInitialAcyclic | kTopSorted |
1424a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kAccessible | kCoAccessible | kString;
1434a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1444a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST is copied
1454a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kCopyProperties
1464a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kAcceptor | kNotAcceptor | kIDeterministic | kNonIDeterministic |
1474a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kODeterministic | kNonODeterministic | kEpsilons | kNoEpsilons |
1484a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kIEpsilons | kNoIEpsilons | kOEpsilons | kNoOEpsilons |
1494a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kILabelSorted | kNotILabelSorted | kOLabelSorted |
1504a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotOLabelSorted | kWeighted | kUnweighted | kCyclic | kAcyclic |
1514a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kInitialCyclic | kInitialAcyclic | kTopSorted | kNotTopSorted |
1524a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kAccessible | kNotAccessible | kCoAccessible | kNotCoAccessible |
1534a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kString | kNotString;
1544a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1554a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST start state is set
1564a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kSetStartProperties
1574a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kExpanded | kMutable | kAcceptor | kNotAcceptor | kIDeterministic |
1584a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNonIDeterministic | kODeterministic | kNonODeterministic |
1594a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kEpsilons | kNoEpsilons | kIEpsilons | kNoIEpsilons | kOEpsilons |
1604a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNoOEpsilons | kILabelSorted | kNotILabelSorted | kOLabelSorted |
1614a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotOLabelSorted | kWeighted | kUnweighted | kCyclic | kAcyclic |
1624a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kTopSorted | kNotTopSorted | kCoAccessible | kNotCoAccessible;
1634a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1644a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST final weight is set
1654a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kSetFinalProperties
1664a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kExpanded | kMutable | kAcceptor | kNotAcceptor | kIDeterministic |
1674a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNonIDeterministic | kODeterministic | kNonODeterministic |
1684a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kEpsilons | kNoEpsilons | kIEpsilons | kNoIEpsilons | kOEpsilons |
1694a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNoOEpsilons | kILabelSorted | kNotILabelSorted | kOLabelSorted |
1704a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotOLabelSorted | kCyclic | kAcyclic | kInitialCyclic |
1714a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kInitialAcyclic | kTopSorted | kNotTopSorted | kAccessible |
1724a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotAccessible;
1734a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1744a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST state is added
1754a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAddStateProperties
1764a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kExpanded | kMutable | kAcceptor | kNotAcceptor | kIDeterministic |
1774a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNonIDeterministic | kODeterministic | kNonODeterministic |
1784a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kEpsilons | kNoEpsilons | kIEpsilons | kNoIEpsilons | kOEpsilons |
1794a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNoOEpsilons | kILabelSorted | kNotILabelSorted | kOLabelSorted |
1804a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotOLabelSorted | kWeighted | kUnweighted | kCyclic | kAcyclic |
1814a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kInitialCyclic | kInitialAcyclic | kTopSorted | kNotTopSorted |
1824a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNotAccessible | kNotCoAccessible | kNotString;
1834a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1844a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST arc is added
1854a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAddArcProperties = kExpanded | kMutable | kNotAcceptor |
1864a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kNonIDeterministic | kNonODeterministic | kEpsilons | kIEpsilons |
1874a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kOEpsilons | kNotILabelSorted | kNotOLabelSorted | kWeighted |
1884a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kCyclic | kInitialCyclic | kNotTopSorted | kAccessible | kCoAccessible;
1894a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1904a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST arc is set
1914a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kSetArcProperties = kExpanded | kMutable;
1924a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
1934a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when FST states are deleted
1944a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kDeleteStatesProperties
1954a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kExpanded | kMutable | kAcceptor | kIDeterministic |
1964a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kODeterministic | kNoEpsilons | kNoIEpsilons | kNoOEpsilons |
1974a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kILabelSorted | kOLabelSorted | kUnweighted | kAcyclic |
1984a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kInitialAcyclic | kTopSorted;
1994a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2004a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when FST arcs are deleted
2014a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kDeleteArcsProperties
2024a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  = kExpanded | kMutable | kAcceptor | kIDeterministic |
2034a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kODeterministic | kNoEpsilons | kNoIEpsilons | kNoOEpsilons |
2044a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kILabelSorted | kOLabelSorted | kUnweighted | kAcyclic |
2054a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project    kInitialAcyclic | kTopSorted |  kNotAccessible | kNotCoAccessible;
2064a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2074a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST's states are reordered
2084a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kStateSortProperties = kExpanded | kMutable | kAcceptor |
2094a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotAcceptor | kIDeterministic | kNonIDeterministic |
2104a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kODeterministic | kNonODeterministic | kEpsilons | kNoEpsilons |
2114a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kIEpsilons | kNoIEpsilons | kOEpsilons | kNoOEpsilons |
2124a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kILabelSorted | kNotILabelSorted | kOLabelSorted | kNotOLabelSorted
2134a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  | kWeighted | kUnweighted | kCyclic | kAcyclic | kInitialCyclic |
2144a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialAcyclic | kAccessible | kNotAccessible | kCoAccessible |
2154a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotCoAccessible;
2164a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2174a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST's arcs are reordered
2184a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kArcSortProperties =
2194a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kExpanded | kMutable | kAcceptor | kNotAcceptor | kIDeterministic |
2204a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNonIDeterministic | kODeterministic | kNonODeterministic |
2214a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kEpsilons | kNoEpsilons | kIEpsilons | kNoIEpsilons | kOEpsilons |
2224a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNoOEpsilons | kWeighted | kUnweighted | kCyclic | kAcyclic |
2234a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialCyclic | kInitialAcyclic | kTopSorted | kNotTopSorted |
2244a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kAccessible | kNotAccessible | kCoAccessible | kNotCoAccessible |
2254a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kString | kNotString;
2264a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2274a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST's input labels are changed.
2284a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kILabelInvariantProperties =
2294a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kExpanded | kMutable | kODeterministic | kNonODeterministic |
2304a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kOEpsilons | kNoOEpsilons | kOLabelSorted | kNotOLabelSorted |
2314a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kWeighted | kUnweighted | kCyclic | kAcyclic | kInitialCyclic |
2324a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialAcyclic | kTopSorted | kNotTopSorted | kAccessible |
2334a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotAccessible | kCoAccessible | kNotCoAccessible | kString | kNotString;
2344a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2354a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST's output labels are changed.
2364a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kOLabelInvariantProperties =
2374a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kExpanded | kMutable | kIDeterministic | kNonIDeterministic |
2384a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kIEpsilons | kNoIEpsilons | kILabelSorted | kNotILabelSorted |
2394a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kWeighted | kUnweighted | kCyclic | kAcyclic | kInitialCyclic |
2404a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialAcyclic | kTopSorted | kNotTopSorted | kAccessible |
2414a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotAccessible | kCoAccessible | kNotCoAccessible | kString | kNotString;
2424a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2434a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when an FST's weights are changed.
2444a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// This assumes that the set of states that are non-final is not changed.
2454a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kWeightInvariantProperties =
2464a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kExpanded | kMutable | kAcceptor | kNotAcceptor | kIDeterministic |
2474a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNonIDeterministic | kODeterministic | kNonODeterministic |
2484a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kEpsilons | kNoEpsilons | kIEpsilons | kNoIEpsilons | kOEpsilons |
2494a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNoOEpsilons | kILabelSorted | kNotILabelSorted | kOLabelSorted |
2504a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotOLabelSorted | kCyclic | kAcyclic | kInitialCyclic | kInitialAcyclic |
2514a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kTopSorted | kNotTopSorted | kAccessible | kNotAccessible | kCoAccessible |
2524a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotCoAccessible | kString | kNotString;
2534a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2544a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when a superfinal state is added
2554a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// and an FSTs final weights are directed to it via new transitions.
2564a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kAddSuperFinalProperties  = kExpanded | kMutable | kAcceptor |
2574a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotAcceptor | kNonIDeterministic | kNonODeterministic | kEpsilons |
2584a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kIEpsilons | kOEpsilons | kNotILabelSorted | kNotOLabelSorted |
2594a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kWeighted | kUnweighted | kCyclic | kAcyclic | kInitialCyclic |
2604a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialAcyclic | kNotTopSorted | kNotAccessible | kCoAccessible |
2614a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotCoAccessible | kNotString;
2624a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2634a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// Properties that are preserved when a superfinal state is removed
2644a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// and the epsilon transitions directed to it are made final weights.
2654a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kRmSuperFinalProperties  = kExpanded | kMutable | kAcceptor |
2664a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotAcceptor | kIDeterministic | kODeterministic | kNoEpsilons |
2674a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNoIEpsilons | kNoOEpsilons | kILabelSorted | kOLabelSorted |
2684a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kWeighted | kUnweighted | kCyclic | kAcyclic | kInitialCyclic |
2694a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kInitialAcyclic | kTopSorted | kAccessible | kCoAccessible |
2704a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kNotCoAccessible | kString;
2714a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2724a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// All binary properties
2734a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kBinaryProperties =  0x0000000000000003ULL;
2744a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2754a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// All trinary properties
2764a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kTrinaryProperties = 0x00003fffffff0000ULL;
2774a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2784a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
2794a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// COMPUTED PROPERTIES
2804a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
2814a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2824a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// 1st bit of trinary properties
2834a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kPosTrinaryProperties =
2844a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kTrinaryProperties & 0x5555555555555555ULL;
2854a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2864a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// 2nd bit of trinary properties
2874a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kNegTrinaryProperties =
2884a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project  kTrinaryProperties & 0xaaaaaaaaaaaaaaaaULL;
2894a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2904a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// All properties
2914a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectconst uint64 kFstProperties = kBinaryProperties | kTrinaryProperties;
2924a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2934a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
2944a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project// PROPERTY FUNCTIONS and STRING NAMES (defined in properties.cc)
2954a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project//
2964a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
2974a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ClosureProperties(uint64 inprops, bool star, bool delayed = false);
2984a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ComplementProperties(uint64 inprops);
2994a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ComposeProperties(uint64 inprops1, uint64 inprops2);
3004a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ConcatProperties(uint64 inprops1, uint64 inprops2,
3014a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project                        bool delayed = false);
3024a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 DeterminizeProperties(uint64 inprops);
3034a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 DifferenceProperties(uint64 inprops1, uint64 inprops2);
3044a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 FactorWeightProperties(uint64 inprops);
3054a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 IntersectProperties(uint64 inprops1, uint64 inprops2);
3064a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 InvertProperties(uint64 inprops);
3074a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ProjectProperties(uint64 inprops, bool project_input);
3084a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 RelabelProperties(uint64 inprops);
3094a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ReplaceProperties(const vector<uint64>& inprops);
3104a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ReverseProperties(uint64 inprops);
3114a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 ReweightProperties(uint64 inprops);
3124a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 RmEpsilonProperties(uint64 inprops, bool delayed = false);
3134a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 SynchronizeProperties(uint64 inprops);
3144a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectuint64 UnionProperties(uint64 inprops1, uint64 inprops2, bool delayed = false);
3154a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
3164a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Projectextern const char *PropertyNames[];
3174a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
3184a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project}  // namespace fst
3194a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project
3204a68b3365c8c50aa93505e99ead2565ab73dcdb0The Android Open Source Project#endif  // FST_LIB_PROPERTIES_H__
321