28 #include <string_view> 75 auto outprops =
kError & (inprops1 | inprops2);
99 outprops |=
kError & (inprops1 | inprops2);
100 const bool empty1 = delayed;
101 const bool empty2 = delayed;
117 outprops |= kAccessible & inprops2;
119 if (!delayed || inprops2 & kAccessible) {
132 bool distinct_psubsequential_labels) {
135 ((
kNoIEpsilons & inprops) && distinct_psubsequential_labels) ||
136 (has_subsequential_label && distinct_psubsequential_labels)) {
142 if ((inprops &
kNoIEpsilons) && distinct_psubsequential_labels) {
149 if ((inprops & kNoIEpsilons) && has_subsequential_label) {
237 outprops |= inprops &
kError;
253 bool epsilon_on_call,
bool epsilon_on_return,
254 bool out_epsilon_on_call,
bool out_epsilon_on_return,
255 bool replace_transducer,
bool no_empty_fsts,
256 bool all_ilabel_sorted,
bool all_olabel_sorted,
257 bool all_negative_or_dense) {
259 uint64_t outprops = 0;
260 for (
auto inprop : inprops) outprops |=
kError & inprop;
262 for (
auto inprop : inprops) {
266 outprops |= access_props;
270 for (
auto inprop : inprops) {
276 if (!(inprop &
kString))
string =
false;
279 if (
string) outprops |=
kString;
281 bool acceptor = !replace_transducer;
282 bool ideterministic = !epsilon_on_call && epsilon_on_return;
283 bool no_iepsilons = !epsilon_on_call && !epsilon_on_return;
285 bool unweighted =
true;
286 for (
size_t i = 0; i < inprops.size(); ++i) {
287 if (!(inprops[i] &
kAcceptor)) acceptor =
false;
290 if (!(inprops[i] &
kAcyclic)) acyclic =
false;
291 if (!(inprops[i] &
kUnweighted)) unweighted =
false;
292 if (i != root && !(inprops[i] & kNoIEpsilons)) ideterministic =
false;
308 if (all_ilabel_sorted && epsilon_on_return &&
309 (!epsilon_on_call || all_negative_or_dense)) {
319 if (all_olabel_sorted && out_epsilon_on_return &&
320 (!out_epsilon_on_call || all_negative_or_dense)) {
328 static constexpr
auto outprops =
334 return outprops & inprops;
343 if (has_superinitial) outprops |=
kWeighted & inprops;
351 if (added_start_epsilon) {
398 outprops |=
kError & (inprops1 | inprops2);
400 bool empty1 = delayed;
401 bool empty2 = delayed;
406 if (!empty1 && !empty2) {
418 if (!delayed || inprops2 & kAccessible) {
432 "expanded",
"mutable",
"error",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
435 "acceptor",
"not acceptor",
"input deterministic",
436 "non input deterministic",
"output deterministic",
437 "non output deterministic",
"input/output epsilons",
438 "no input/output epsilons",
"input epsilons",
"no input epsilons",
439 "output epsilons",
"no output epsilons",
"input label sorted",
440 "not input label sorted",
"output label sorted",
"not output label sorted",
441 "weighted",
"unweighted",
"cyclic",
"acyclic",
"cyclic at initial state",
442 "acyclic at initial state",
"top sorted",
"not top sorted",
"accessible",
443 "not accessible",
"coaccessible",
"not coaccessible",
"string",
444 "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