8 #include <boost/optional.hpp> 9 #include <boost/range/join.hpp> 11 #include <vcsn/config.hh> 35 template <
typename Enable =
void,
typename... ValueSets>
48 template <
typename... ValueSets>
63 template <
typename... ValueSets>
70 template <
typename... ValueSets>
77 template <std::size_t... I>
81 template <std::
size_t I>
110 : sets_(
std::move(vs))
114 : sets_(
std::move(ls)...)
122 static auto res =
symbol{sname_(indices)};
127 static constexpr std::size_t
size()
129 return sizeof...(ValueSets);
133 template <
typename Value>
136 return size_(v, indices);
139 static constexpr
bool 142 return is_commutative_(indices);
145 static constexpr
bool 148 return is_idempotent_(indices);
157 auto res = make_(is, indices);
172 return std::get<I>(sets());
192 return std::get<I>(
v);
200 return this->open_(o, indices);
204 template <
typename... Args>
207 return this->value_(args, indices);
211 template <
typename... Args>
219 template <
typename... LS1,
typename... LS2>
231 constexpr
auto in = 0;
234 return compose_(ls1, l1, ls2, l2,
241 return this->genset_(indices);
248 return this->pregenerators_(indices);
256 return pregenerators().skip_first();
258 return pregenerators();
263 return is_free_(indices);
267 template <
typename... Args>
269 word(
const std::tuple<Args...>&
v)
const 272 return this->word_(
v, indices);
276 template <
typename Fun>
280 return map_impl_(std::forward<Fun>(fun), indices);
287 return equal_(l, r, indices);
291 template <
typename LhsValue,
typename RhsValue>
300 template <
typename LhsValue,
typename RhsValue>
302 less(
const LhsValue& l,
const RhsValue&
r)
312 return less_(l,
r, indices);
318 return special_(indices);
324 return is_special_(l, indices);
330 return is_zero_(l, indices);
333 static constexpr
bool 336 return has_lightening_weights_(indices);
339 static constexpr
bool 342 return has_one_(indices);
345 static constexpr
bool 348 return is_expressionset_(indices);
351 static constexpr
bool 354 return is_letterized_(indices);
358 template <std::size_t... I>
370 template <
typename Indices = indices_t>
371 static auto one() -> decltype(one_(Indices{}))
373 return one_(Indices{});
379 return is_one_(l, indices);
385 return show_one_(indices);
398 return is_valid_(l, indices);
406 [](
const auto& vs,
const auto& l,
const auto& r)
416 template <
typename LhsValue,
typename RhsValue>
418 mul(
const LhsValue& l,
const RhsValue&
r)
const 421 return this->mul_(l,
r, indices);
429 [](
const auto& vs,
const auto& l,
const auto& r)
431 return vs.lgcd(l, r);
440 [](
const auto& vs,
const auto& l,
const auto& r)
442 return vs.rdivide(l, r);
446 boost::optional<value_t>
450 auto res = map_(l, r,
451 [&valid](
const auto& vs,
const auto& l,
const auto& r)
453 if (
auto res = vs.maybe_rdivide(l, r))
473 [](
const auto& vs,
const auto& l,
const auto& r)
475 return vs.ldivide(l, r);
479 boost::optional<value_t>
483 auto res = map_(l, r,
484 [&valid](
const auto& vs,
const auto& l,
const auto& r)
486 if (
auto res = vs.maybe_ldivide(l, r))
508 return this->lnormalize_here_(v, indices);
516 [](
const auto& vs,
const auto& v)
527 template <
typename Value>
531 return this->delimit_(l, indices);
535 template <
typename Value>
539 return this->undelimit_(l, indices);
549 template <
typename Value>
553 return this->transpose_(l, indices);
559 return hash_(v, indices);
571 return v ? one() : zero();
575 template <
typename... VS>
580 return this->conv_(vs, v, indices);
584 template <
typename... VS>
589 return conv(*vs.labelset(), vs.get_value(v));
593 template <
typename VS>
595 conv(
const VS& vs,
const typename VS::value_t&
v)
const 597 return this->partial_identity_(vs, v, indices);
602 conv(std::istream& i,
bool quoted =
true)
const 604 constexpr
auto has_label_one
610 template <
typename Fun>
611 void convs(std::istream& i, Fun&& fun)
const 625 return this->print_set_(o, fmt, indices);
636 fmt.delimit() ?
"(" :
"",
637 fmt.is_for_labels() ?
"|" :
",",
638 fmt.delimit() ?
")" :
"",
643 template <std::size_t... I>
646 std::string
res =
"lat<";
647 const char *sep =
"";
658 template <std::size_t... I>
659 static constexpr
bool 662 return all_<valueset_t<I>::is_commutative()...>();
665 template <std::size_t... I>
666 static constexpr
bool 669 return all_<valueset_t<I>::is_idempotent()...>();
672 template <std::size_t... I>
675 #if VCSN_HAVE_CORRECT_LIST_INITIALIZER_ORDER 676 return self_t{(eat_separator_<I>(i),
680 ((eat_separator_<
sizeof...(ValueSets)-1 -I>(i),
681 valueset_t<
sizeof...(ValueSets)-1 -I>::make(i))...);
685 template <std::size_t... I>
688 using swallow =
int[];
689 (
void) swallow { set<I>().open(o)... };
696 template <
typename Value, std::
size_t I>
705 template <
typename Value, std::
size_t I>
706 static constexpr
auto size_(
const Value&, ...)
712 template <
typename Value, std::size_t... I>
715 return std::max({size_<Value, I>(
v, 0)...});
718 template <
typename... Args, std::size_t... I>
721 return value_t{set<I>().value(std::get<I>(args))...};
724 template <
typename... LS1,
typename... LS2,
725 std::size_t... I1, std::size_t... I2>
732 return value_t{std::get<I1>(l1)..., std::get<I2>(l2)...};
735 template <std::size_t... I>
742 template <std::size_t... I>
749 template <std::size_t... I>
750 static constexpr
bool 753 return all_<valueset_t<I>::is_free()...>();
756 template <
typename... Args, std::size_t... I>
760 return word_t{set<I>().word(std::get<I>(l))...};
763 template <std::size_t... I>
774 template <
typename LhsValue,
typename RhsValue, std::size_t... I>
782 std::get<I>(l)))...})
790 template <std::size_t... I>
800 template <std::size_t... I>
807 template <std::size_t... I>
817 template <std::size_t... I>
829 template <
typename Indices = indices_t>
830 static auto zero() -> decltype(zero_(Indices{}))
832 return zero_(Indices{});
836 template <std::size_t... I>
840 for (
auto n: {set<I>().is_zero(std::get<I>(l))...})
846 template <std::size_t... I>
847 static constexpr
bool 850 return all_<valueset_t<I>::has_lightening_weights()...>();
853 template <std::size_t... I>
854 static constexpr
bool 857 return all_<valueset_t<I>::has_one()...>();
860 template <std::size_t... I>
861 static constexpr
bool 864 return all_<valueset_t<I>::is_expressionset()...>();
867 template <std::size_t... I>
868 static constexpr
bool 874 template <std::size_t... I>
884 template <std::size_t... I>
894 template <std::size_t... I>
898 for (
auto n: {set<I>().
is_valid(std::get<I>(l))...})
905 template <
typename Fun, std::size_t... I>
909 return std::make_tuple(fun(set<I>())...);
913 template <
typename Fun>
917 return map_impl_(v, std::forward<Fun>(fun), indices);
920 template <
typename Fun, std::size_t... I>
924 return value_t{fun(set<I>(), std::get<I>(v))...};
928 template <
typename Fun>
932 return map_impl_(l, r, std::forward<Fun>(fun), indices);
935 template <
typename Fun, std::size_t... I>
939 return value_t{fun(set<I>(), std::get<I>(l), std::get<I>(r))...};
942 template <
typename LhsValue,
typename RhsValue, std::size_t... I>
947 return word_t{set<I>().mul(std::get<I>(l), std::get<I>(
r))...};
950 template <std::size_t... I>
955 for (
auto v: {std::get<I>(vs)...})
956 res = set<0>().
lgcd(res,
v);
957 using swallow =
int[];
958 (
void) swallow { (set<0>().ldivide_here(res, std::get<I>(vs)), 0)... };
962 template <
typename Value, std::size_t... I>
966 return Value{set<I>().delimit(std::get<I>(l))...};
969 template <
typename Value, std::size_t... I>
973 return Value{set<I>().undelimit(std::get<I>(l))...};
976 template <
typename... VS, std::size_t... I>
982 return value_t{set<I>().
conv(vs.template set<I>(), std::get<I>(
v))...};
985 template <
typename VS, std::size_t... I>
996 conv_(std::istream& i,
bool quoted, std::true_type)
const 1002 return conv_(i, quoted, std::false_type{});
1007 conv_(std::istream& i,
bool quoted, std::false_type)
const 1009 bool par = i.peek() ==
'(';
1018 template <std::size_t... I>
1022 #if VCSN_HAVE_CORRECT_LIST_INITIALIZER_ORDER 1023 return value_t{(eat_separator_<I>(i),
1024 set<I>().conv(i, quoted))...};
1026 constexpr
auto S =
sizeof...(ValueSets)-1;
1029 set<S - I>().
conv(i, quoted))...);
1037 template <std::
size_t I>
1042 eat(i, i.peek() ==
',' ?
',' :
'|');
1043 while (isspace(i.peek()))
1048 template <std::size_t... I>
1059 using swallow =
int[];
1062 (o << (I == 0 ? pre : sep),
1063 set<I>().print(std::get<I>(l), o, fmt),
1071 template <std::size_t... I>
1076 const char *sep =
"";
1077 const char *close =
"";
1098 using swallow =
int[];
1101 (o << (I == 0 ?
"" : sep),
1102 set<I>().print_set(o, fmt),
1109 template <
typename Value, std::size_t... I>
1113 return Value{set<I>().
transpose(std::get<I>(l))...};
1117 template <std::size_t... I>
1121 return self_t{
meet(set<I>(), rhs.template set<I>())...};
1129 return lhs.meet_(rhs, indices);
1151 mutable bool open__ =
false;
1155 template <std::size_t... I>
1160 #if VCSN_HAVE_CORRECT_LIST_INITIALIZER_ORDER 1161 return letter_t{(eat_separator_<I>(i),
1162 set<I>().get_letter(i, quoted))...};
1164 constexpr
auto S =
sizeof...(ValueSets)-1;
1167 set<S - I>().get_letter(i, quoted))...);
1172 template <
typename Value, std::size_t... I>
1181 template <
typename Value,
typename... Defaults, std::size_t... I>
1184 const std::tuple<Defaults...>& def,
seq<I...>)
const 1186 this->set<I>().letters_of_padded(std::get<I>(
v),
1187 std::get<I>(def))...))
1190 set<I>().letters_of_padded(std::get<I>(
v),
1191 std::get<I>(def))...);
1195 template <std::size_t... I>
1198 -> decltype(this->get_letter_(i, quoted, indices))
1200 bool par = i.peek() ==
'(';
1203 auto res = get_letter_(i, quoted, indices);
1214 template <
typename Value>
1217 -> decltype(letters_of_(
v, indices))
1219 return letters_of_(
v, indices);
1227 template <
typename Value,
typename... Defaults>
1230 -> decltype(this->letters_of_padded_(
v, def, indices))
1232 return letters_of_padded_(
v, def, indices);
1236 template <
typename... ValueSets>
1248 template <
typename T1,
typename T2>
1256 template <
typename... T1,
typename... T2>
1264 template <
typename... LabelSets>
1269 template <std::size_t... I>
1275 template <std::size_t... I>
1290 template <std::size_t... I>
1299 template <
typename... LabelSets>
1301 std::enable_if_t<tupleset<LabelSets...>::has_one()>>
1312 template <
typename... LabelSets>
1314 std::enable_if_t<!tupleset<LabelSets...>::has_one()>>
1326 template <
typename LabelSet>
1337 template <
typename... LabelSets>
1343 template <std::size_t... I>
1356 template <
typename... VS1,
typename... VS2>
1359 static_assert(
sizeof...(VS1) ==
sizeof...(VS2),
1360 "join: tuplesets must have the same sizes");
1366 template <std::size_t... I>
1370 return {
::vcsn::join(lhs.template set<I>(), rhs.template set<I>())...};
1376 return join(lhs, rhs,
1382 template <
typename... VS1,
typename VS2>
1390 template <std::size_t... I>
1400 return join(lhs, rhs,
1412 template <
size_t Tape,
typename LabelSet>
1417 template <
size_t Tape,
typename LabelSet>
1421 template <
size_t Tape,
typename... LabelSets>
1425 using type =
typename valueset_t::template project_t<Tape>;
1429 template <
size_t Tape,
typename Context>
1433 using type =
typename valueset_t::template project_t<Tape>;
1442 template <
size_t Tape,
typename Context>
1449 template <
typename... ValueSet>
1454 template <
typename... ValueSets>
1457 constexpr
static auto value =
sizeof...(ValueSets);
1466 template <
typename... LabelSet,
1467 typename RandomGenerator = std::default_random_engine>
1468 typename tupleset<LabelSet...>::value_t
1470 RandomGenerator& gen = RandomGenerator())
1477 template <
typename... LabelSet,
1479 typename RandomGenerator = std::default_random_engine>
1480 typename tupleset<LabelSet...>::value_t
1482 RandomGenerator& gen,
1487 return ls.tuple(
random_label(ls.template set<I>(), gen)...);
static bool equal_(const value_t &l, const value_t &r, seq< I... >)
bool is_letter(const value_t &) const
std::tuple< typename ValueSets::word_t... > word_t
Aut transpose(const transpose_automaton< Aut > &aut)
The transpose of a transpose automaton is the original automaton.
Print as a parsable type string.
static constexpr bool has_one_(seq< I... >)
static constexpr auto size_(const Value &,...) -> size_t
The size of the Ith element, if its valueset does not feature a size() function.
tupleset< ValueSets... > make_tupleset(const ValueSets &... vss)
static std::string sname_(seq< I... >)
std::ostream & print_set(std::ostream &o, format fmt={}) const
weightset_mixin< detail::r_impl > r
genset_ptr genset() const
const valuesets_t & sets() const
The componants valuesets, as a tuple.
auto map_impl_(Fun f, const std::tuple< Ts... > &ts, index_sequence< I... >)
auto meet(const expressionset< Ctx1 > &a, const expressionset< Ctx2 > &b) -> expressionset< meet_t< Ctx1, Ctx2 >>
The meet of two expressionsets.
typename detail::weightset_t_of_impl< base_t< ValueSet > >::type weightset_t_of
auto map(Fun &&fun) const
Run a function per set, and return the tuple of results.
auto compose(const tupleset< LS1... > &ls1, const typename tupleset< LS1... >::value_t &l1, const tupleset< LS2... > &ls2, const typename tupleset< LS2... >::value_t &l2) const -> std::enable_if_t< are_labelsets_composable< tupleset< LS1... >, tupleset< LS2... >>
Compose, aka join in the world of databases.
friend self_t meet(const self_t &lhs, const b &)
The meet with the B weightset.
value_t value_(const std::tuple< Args... > &args, seq< I... >) const
static type join(const vs1_t &lhs, const vs2_t &rhs, index_sequence< I... >)
tupleset_impl(ValueSets... ls)
bool is_valid(const Aut &aut)
Value transpose(const Value &l) const
Transpose a word_t or a value_t.
tupleset< LabelSet... >::value_t random_label_(const tupleset< LabelSet... > &ls, RandomGenerator &gen, detail::index_sequence< I... >)
Implementation detail for random label from tupleset.
static constexpr bool is_commutative()
boost::optional< value_t > maybe_rdivide(const value_t &l, const value_t &r) const
value_t map_(const value_t &v, Fun &&fun) const
Apply a unary function pointwise, and return the tuple of results.
static std::size_t hash_(const value_t &v, seq< I... >)
typename valueset_t::template project_t< Tape > type
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
static bool equal(const value_t &l, const value_t &r)
Whether l equals r.
A traits so that tupleset may define types that may exist.
auto mul_(const LhsValue &l, const RhsValue &r, seq< I... >) const -> word_t
valuesets_t sets_
The tupled valuesets.
auto project(const value_t &v) const
The I-th component of the value.
auto map_impl_(Fun &&fun, seq< I... >) const
Run a nullary function pointwise, and return the tuple of results.
typename labelset_types< ValueSets... >::word_t word_t
A tuple of words if meaningful, void otherwise.
value_t conv(const nullableset< tupleset< VS... >> &vs, const typename nullableset< tupleset< VS... >>::value_t &v) const
Convert a value from nullableset<tupleset<...>> to value_t.
static constexpr bool is_free()
value_t conv_(std::istream &i, bool quoted, seq< I... >) const
static auto letters_of(const Value &v) -> decltype(letters_of_(v, indices))
Iterate over the letters of v.
char eat(std::istream &is, char c)
Check lookahead character and advance.
tupleset_impl(valuesets_t vs)
const valueset_t< I > & project() const
The Ith component valueset.
std::tuple< typename ValueSets::genset_ptr... > genset_ptr
static constexpr bool is_labelset
A traits to compute the letterized context.
Request the set implementation (bool weights).
typename valueset_t::template project_t< Tape > type
letterized_t< LabelSet > make_letterized(const LabelSet &ls)
static value_t conv(self_t, value_t v)
value_t partial_identity_(const VS &vs, const typename VS::value_t &v, seq< I... >) const
bool is_special(const Aut &aut, transition_t_of< Aut > t)
Whether this transition is from pre or to post.
static constexpr bool is_letterized()
context join(const context &c1, const context &c2)
Bridge.
ValueSet::value_t lgcd(const ValueSet &vs, const typename ValueSet::value_t &lhs, const typename ValueSet::value_t &rhs)
Left-division of values.
static constexpr bool has_lightening_weights()
static self_t make(std::istream &is)
Build from the description in is.
constant< type_t::one, Context > one
static bool is_special_(const value_t &l, seq< I... >)
auto mul(const LhsValue &l, const RhsValue &r) const -> word_t
The product (possibly concatenation) of l and r.
static type value(const labelset_t &ls)
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
value_t map_impl_(const value_t &l, const value_t &r, Fun &&fun, seq< I... >) const
static type join(const vs1_t &lhs, const vs2_t &rhs)
The resulting valueset.
std::set< letter_t, vcsn::less< tupleset< ValueSets... >, letter_t > > letters_t
auto word(const std::tuple< Args... > &v) const -> word_t
Convert to a word.
static type value(const LabelSet &ls)
auto conv(const ValueSet &vs, const std::string &str, Args &&... args) -> decltype(vs.conv(std::declval< std::istream &>(), std::forward< Args >(args)...))
Parse str via vs.conv.
static bool show_one_(seq< I... >)
std::ostream & print_(const value_t &l, std::ostream &o, format fmt, const char *pre, const char *sep, const char *post, seq< I... >) const
auto tuple(const Auts &... as)
Build the (accessible part of the) tuple.
static size_t size(const Value &v)
Get the max of the sizes of the tapes.
static bool is_one_(const value_t &l, seq< I... >)
value_t add(const value_t &l, const value_t &r) const
Pointwise addition.
A ValueSet which is a Cartesian product of ValueSets.
static auto zero_(seq< I... >) -> decltype(value_t
static type value(const tupleset< LabelSet > &ls)
auto letters_of_padded_(const Value &v, const std::tuple< Defaults... > &def, seq< I... >) const -> decltype(zip_with_padding(def, this->set< I >().letters_of_padded(std::get< I >(v), std::get< I >(def))...))
Must be declared before, as we use its result in decltype.
constant< type_t::zero, Context > zero
static auto size_(const Value &v, int) -> decltype(valueset_t< I >::size(std::get< I >(v)))
The size of the Ith element, if its valueset features a size() function.
Print as rich UTF-8 text, escaped.
An input/output format for valuesets.
std::tuple< typename ValueSets::value_t... > word_t
Same as value_t.
typename std::tuple_element< I, T >::type tuple_element_t
C++14.
Provide a variadic mul on top of a binary mul(), and one().
value_t conv(const tupleset< VS... > &vs, const typename tupleset< VS... >::value_t &v) const
Convert a value from tupleset<...> to value_t.
std::ostream & print_set_(std::ostream &o, format fmt, seq< I... >) const
tuple_element_t< I, valuesets_t > valueset_t
The Ith valueset type.
bool open(bool o) const
Whether unknown letters should be added, or rejected.
value_t star(const value_t &v) const
Pointwise star.
static constexpr bool has_one()
static type join(const vs1_t &lhs, const vs2_t &rhs, index_sequence< I... >)
LabelSet::letters_t conv_label_class_(const LabelSet &ls, std::istream &i)
Read a set of letters (hence, guaranteed in order, and unique).
friend self_t meet(const self_t &lhs, const self_t &rhs)
The meet with another tupleset.
auto generators() const
The generators. Meaningful for labelsets only.
auto make_gcc_tuple(Ts &&... ts) -> decltype(reverse_tuple(std::make_tuple(std::forward< Ts >(ts)...)))
Same as make_tuple, unless the evaluation of arguments if right-to-left, in which case reverse the re...
static constexpr bool is_letterized_(seq< I... >)
std::integral_constant< bool, B > bool_constant
auto join(const ValueSet &vs) -> ValueSet
The join of a single valueset.
zip_sequences_padded< zip_sequences< Sequences... > > zip_with_padding(const std::tuple< typename Sequences::value_type... > &pad, const Sequences &... seq)
static value_t special_(seq< I... >)
value_t rdivide(const value_t &l, const value_t &r) const
Pointwise right division (l / r).
std::tuple< typename ValueSets::value_t... > value_t
A tuple of values.
From a labelset, its non-nullable labelset.
static bool is_special(const value_t &l)
A structure that implements the computation of join(V1, V2).
punched_sequence< tupleset< LS2... >::size(), in > indices2_t
typename labelset_types< ValueSets... >::letter_t letter_t
A tuple of base letters if meaningful, void otherwise.
Build the static sequence of size_t [0, N[.
static constexpr bool is_idempotent()
auto get_letter(std::istream &i, bool quoted=true) const -> decltype(this->get_letter_(i, quoted, indices))
Provide a range that allows to iterate over the cross product of the provided ranges.
Implementation of labels are nullables (letter or empty).
static auto less(const LhsValue &l, const RhsValue &r) -> bool
Whether l < r.
typename labelset_types< ValueSets... >::genset_ptr genset_ptr
A tuple of generators if meaningful, void otherwise.
auto pregenerators() const
The pregenerators. Meaningful for labelsets only.
cross_sequences< Sequences... > cross(Sequences &&... seqs)
auto in(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions arriving to state s.
static type value(const labelset_t &ls, index_sequence< I... >)
punched_sequence< tupleset< LS1... >::size(), out > indices1_t
valueset_t< I > project_t
The type of the I-th tape valueset.
auto get_letter_(std::istream &i, bool quoted, seq< I... >) const -> letter_t
Must be declared before, as we use its result in decltype.
value_t lgcd(const value_t &l, const value_t &r) const
Pointwise left GCD.
static type value(const labelset_t &ls)
static constexpr bool is_commutative_(seq< I... >)
static constexpr bool is_expressionset()
genset_ptr genset_(seq< I... >) const
static labelset_t labelset(const tupleset< LabelSets... > &ls)
static constexpr bool has_lightening_weights_(seq< I... >)
bool is_zero(const value_t &l) const
static bool is_one(const value_t &l)
static labelset_t labelset_(const tupleset< LabelSets... > &ls, seq< I... >)
static constexpr std::size_t size()
Number of tapes.
static type value(const labelset_t &ls)
letter_t value_type
To be iterable.
The smallest nullableset which includes LabelSet.
word_t word_(const std::tuple< Args... > &l, seq< I... >) const
static void eat_separator_(std::istream &i)
Read the separator from the input stream i if I is not 0.
bool is_valid_(const value_t &l, seq< I... >) const
Print as plain (ASCII) text, escaped.
static constexpr bool is_letterized_(seq< I... >)
static auto less_(const LhsValue &l, const RhsValue &r, seq< I... >) -> bool
friend self_t meet(const b &, const self_t &rhs)
The meet with the B weightset.
bool is_zero_(const value_t &l, seq< I... >) const
static auto letters_of_(const Value &v, seq< I... >) -> decltype(zip(valueset_t< I >::letters_of(std::get< I >(v))...))
Must be declared before, as we use its result in decltype.
static auto compare(const LhsValue &l, const RhsValue &r) -> int
Three-way comparison between l and r.
static auto one() -> decltype(one_(Indices
A tuple of ones.
value_t map_(const value_t &l, const value_t &r, Fun &&fun) const
Apply a binary function pointwise, and return the tuple of results.
auto pregenerators_(seq< I... >) const
The type of the resulting apparent LabelSet when keeping only tape Tape.
void swap(config::value &first, config::value &second)
static constexpr star_status_t star_status()
Value undelimit(const Value &l) const
Remove first and last characters, that must be "special".
typename project_labelset_impl< Tape, LabelSet >::type project_labelset
The type of the resulting apparent LabelSet when keeping only tape Tape.
self_t meet_(const self_t &rhs, seq< I... >) const
The intersection with another tupleset.
bool open_(bool o, seq< I... >) const
value_t conv_(const tupleset< VS... > &vs, const typename tupleset< VS... >::value_t &v, seq< I... >) const
Value undelimit_(const Value &l, seq< I... >) const
Print as is. For instance, don't try to escape labels.
static self_t make_(std::istream &i, seq< I... >)
typename labelset_types< ValueSets... >::letters_t letters_t
A set of letters if meaningful, void otherwise.
Value delimit(const Value &l) const
Add the special character first and last.
value_t compose_(const tupleset< LS1... > &, const typename tupleset< LS1... >::value_t &l1, const tupleset< LS2... > &, const typename tupleset< LS2... >::value_t &l2, seq< I1... >, seq< I2... >) const
void convs(std::istream &i, Fun &&fun) const
Fun: (label_t) -> void.
auto letters_of_padded(const Value &v, const std::tuple< Defaults... > &def) const -> decltype(this->letters_of_padded_(v, def, indices))
Iterate over the letters of v.
void hash_combine(std::size_t &seed, const T &v)
Functor to compare Values of ValueSets.
valueset_t< 0 >::value_t lnormalize_here(value_t &v) const
Eliminate the LGCD between all the tapes.
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
zip_sequences< Sequences... > zip(Sequences &&... seqs)
static type join(const vs1_t &lhs, const vs2_t &rhs)
The resulting valueset.
Value delimit_(const Value &l, seq< I... >) const
static auto zero() -> decltype(zero_(Indices
A tuple of zeros.
std::ostream & print(const value_t &l, std::ostream &o=std::cout, format fmt={}) const
value_t conv_(std::istream &i, bool quoted, std::false_type) const
Read a tuple in the stream, possibly parenthesized.
static constexpr bool is_expressionset_(seq< I... >)
static constexpr bool is_free_(seq< I... >)
Whether a ValueSet, or a context, is multitape.
value_t conv_(std::istream &i, bool quoted, std::true_type) const
When the valuesets are labelsets and support one, accept the empty string to denote one...
void print_(std::ostream &o, const T &arg, long)
Serialize arg into o.
static size_t size_(const Value &v, seq< I... >)
std::tuple< typename ValueSets::letter_t... > letter_t
std::tuple< ValueSets... > valuesets_t
std::enable_if_t<!is_letterized_t< labelset_t_of< Aut > >{}, bool > is_letterized(const Aut &aut)
bool is_valid(const value_t &l) const
value_t value(const std::tuple< Args... > &args) const
Construct a value.
Whether two labelsets are composable.
boost::optional< value_t > maybe_ldivide(const value_t &l, const value_t &r) const
value_t map_impl_(const value_t &v, Fun &&fun, seq< I... >) const
static auto one_(seq< I... >) -> decltype(value_t
Value transpose_(const Value &l, seq< I... >) const
value_t conv(std::istream &i, bool quoted=true) const
Read one label from i, return the corresponding value.
value_t conv(b, b::value_t v) const
valueset_t< 0 >::value_t lnormalize_here_(value_t &vs, seq< I... >) const
value_t tuple(Args &&... args) const
Construct a value.
static constexpr bool is_idempotent_(seq< I... >)
expressionset< Context >::value_t random_label(const expressionset< Context > &rs, RandomGenerator &gen=RandomGenerator())
Random label from expressionset: limited to a single label.
value_t conv(const VS &vs, const typename VS::value_t &v) const
Convert a single tape expression to multitape.
static size_t hash(const value_t &v)
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
value_t ldivide(const value_t &l, const value_t &r) const
Pointwise left division (l \ r).