27 #include <string_view> 74 auto outprops =
kError & (inprops1 | inprops2);
98 outprops |=
kError & (inprops1 | inprops2);
99 const bool empty1 = delayed;
100 const bool empty2 = delayed;
116 outprops |= kAccessible & inprops2;
118 if (!delayed || inprops2 & kAccessible) {
131 bool distinct_psubsequential_labels) {
134 ((
kNoIEpsilons & inprops) && distinct_psubsequential_labels) ||
135 (has_subsequential_label && distinct_psubsequential_labels)) {
141 if ((inprops &
kNoIEpsilons) && distinct_psubsequential_labels) {
148 if ((inprops & kNoIEpsilons) && has_subsequential_label) {
236 outprops |= inprops &
kError;
252 bool epsilon_on_call,
bool epsilon_on_return,
253 bool out_epsilon_on_call,
bool out_epsilon_on_return,
254 bool replace_transducer,
bool no_empty_fsts,
255 bool all_ilabel_sorted,
bool all_olabel_sorted,
256 bool all_negative_or_dense) {
258 uint64_t outprops = 0;
259 for (
auto inprop : inprops) outprops |=
kError & inprop;
261 for (
auto inprop : inprops) {
265 outprops |= access_props;
269 for (
auto inprop : inprops) {
275 if (!(inprop &
kString))
string =
false;
278 if (
string) outprops |=
kString;
280 bool acceptor = !replace_transducer;
281 bool ideterministic = !epsilon_on_call && epsilon_on_return;
282 bool no_iepsilons = !epsilon_on_call && !epsilon_on_return;
284 bool unweighted =
true;
285 for (
size_t i = 0; i < inprops.size(); ++i) {
286 if (!(inprops[i] &
kAcceptor)) acceptor =
false;
289 if (!(inprops[i] &
kAcyclic)) acyclic =
false;
290 if (!(inprops[i] &
kUnweighted)) unweighted =
false;
291 if (i != root && !(inprops[i] & kNoIEpsilons)) ideterministic =
false;
307 if (all_ilabel_sorted && epsilon_on_return &&
308 (!epsilon_on_call || all_negative_or_dense)) {
318 if (all_olabel_sorted && out_epsilon_on_return &&
319 (!out_epsilon_on_call || all_negative_or_dense)) {
327 static constexpr
auto outprops =
333 return outprops & inprops;
342 if (has_superinitial) outprops |=
kWeighted & inprops;
350 if (added_start_epsilon) {
397 outprops |=
kError & (inprops1 | inprops2);
399 bool empty1 = delayed;
400 bool empty2 = delayed;
405 if (!empty1 && !empty2) {
417 if (!delayed || inprops2 & kAccessible) {
431 "expanded",
"mutable",
"error",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
434 "acceptor",
"not acceptor",
"input deterministic",
435 "non input deterministic",
"output deterministic",
436 "non output deterministic",
"input/output epsilons",
437 "no input/output epsilons",
"input epsilons",
"no input epsilons",
438 "output epsilons",
"no output epsilons",
"input label sorted",
439 "not input label sorted",
"output label sorted",
"not output label sorted",
440 "weighted",
"unweighted",
"cyclic",
"acyclic",
"cyclic at initial state",
441 "acyclic at initial state",
"top sorted",
"not top sorted",
"accessible",
442 "not accessible",
"coaccessible",
"not coaccessible",
"string",
443 "not string",
"weighted cycles",
"unweighted cycles"};
uint64_t ConcatProperties(uint64_t inprops1, uint64_t inprops2, bool delayed=false)
constexpr uint64_t kCyclic
constexpr uint64_t kNotString
uint64_t RandGenProperties(uint64_t inprops, bool weighted)
constexpr uint64_t kMutable
constexpr uint64_t kWeightedCycles
constexpr uint64_t kWeightInvariantProperties
constexpr uint64_t kOEpsilons
constexpr uint64_t kInitialCyclic
uint64_t ComposeProperties(uint64_t inprops1, uint64_t inprops2)
constexpr uint64_t kCoAccessible
uint64_t RmEpsilonProperties(uint64_t inprops, bool delayed=false)
constexpr uint64_t kNotAccessible
constexpr uint64_t kNotTopSorted
uint64_t ShortestPathProperties(uint64_t props, bool tree=false)
constexpr uint64_t kError
constexpr uint64_t kInitialAcyclic
constexpr uint64_t kUnweightedCycles
constexpr uint64_t kEpsilons
constexpr uint64_t kNotOLabelSorted
constexpr uint64_t kTopSorted
constexpr uint64_t kODeterministic
uint64_t RelabelProperties(uint64_t inprops)
constexpr uint64_t kNonIDeterministic
constexpr uint64_t kNotILabelSorted
uint64_t ReverseProperties(uint64_t inprops, bool has_superinitial)
uint64_t ClosureProperties(uint64_t inprops, bool star, bool delayed=false)
uint64_t UnionProperties(uint64_t inprops1, uint64_t inprops2, bool delayed=false)
constexpr uint64_t kNoOEpsilons
constexpr uint64_t kOLabelSorted
constexpr uint64_t kNotAcceptor
constexpr uint64_t kAcyclic
uint64_t ReplaceProperties(const std::vector< uint64_t > &inprops, size_t root, bool epsilon_on_call, bool epsilon_on_return, bool out_epsilon_on_call, bool out_epsilon_on_return, bool replace_transducer, bool no_empty_fst, bool all_ilabel_sorted, bool all_olabel_sorted, bool all_negative_or_dense)
uint64_t FactorWeightProperties(uint64_t inprops)
constexpr uint64_t kNoEpsilons
uint64_t ReweightProperties(uint64_t inprops, bool added_start_epsilon)
constexpr uint64_t kAccessible
constexpr uint64_t kIDeterministic
constexpr uint64_t kNullProperties
uint64_t ComplementProperties(uint64_t inprops)
constexpr uint64_t kIEpsilons
constexpr uint64_t kILabelSorted
constexpr uint64_t kUnweighted
uint64_t InvertProperties(uint64_t inprops)
uint64_t DeterminizeProperties(uint64_t inprops, bool has_subsequential_label, bool distinct_psubsequential_labels)
constexpr uint64_t kNonODeterministic
const std::string_view PropertyNames[]
constexpr uint64_t kString
uint64_t ProjectProperties(uint64_t inprops, bool project_input)
constexpr uint64_t kNotCoAccessible
constexpr uint64_t kWeighted
constexpr uint64_t kExpanded
uint64_t SynchronizeProperties(uint64_t inprops)
constexpr uint64_t kNoIEpsilons
constexpr uint64_t kAcceptor