17 template <
typename LabelSet,
typename WeightSet>
26 using kind_t =
typename labelset_t::kind_t;
37 using label_t =
typename labelset_t::value_t;
39 using weight_t =
typename weightset_t::value_t;
56 :
context(std::make_shared<const labelset_t>(ls),
57 std::make_shared<const weightset_t>(ws))
64 std::swap(
ls_, that.ls_);
65 std::swap(
ws_, that.ws_);
86 auto ls = labelset_t::make(is);
88 while (isspace(is.peek()))
90 auto ws = weightset_t::make(is);
131 static constexpr
bool
134 return labelset_t::has_one();
144 template <
typename LabelSet,
typename WeightSet>
157 template <
typename... ValueSets>
167 template <
typename ValueSet>
175 template <
typename ValueSet1,
typename ValueSet2,
typename ValueSet3,
178 meet(
const ValueSet1& vs1,
const ValueSet2& vs2,
const ValueSet3& vs3,
180 -> decltype(
meet(
meet(vs1, vs2), vs3, vs...))
182 return meet(
meet(vs1, vs2), vs3, vs...);
193 template <
typename LS1,
typename WS1,
194 typename LS2,
typename WS2>
218 template <
typename LhsLabelSet,
typename LhsWeightSet,
219 typename RhsLabelSet,
typename RhsWeightSet>
226 auto ls =
meet(*a.labelset(), *
b.labelset());
227 auto ws =
join(*a.weightset(), *
b.weightset());
Ctx make_context(const std::string &name)
Build a context from its name.
std::string type(const automaton &a)
The implementation type of a.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
context & operator=(context &&that)
decltype(meet(std::declval< ValueSets >()...)) meet_t
std::ostream & print_set(std::ostream &o, format fmt={}) const
std::shared_ptr< const labelset_t > labelset_ptr
auto join(const ValueSet &vs) -> ValueSet
The join of a single valueset.
A structure that implements the computation of join(V1, V2).
Print as a parsable type string.
decltype(join(std::declval< ValueSets >()...)) join_t
The type of the join of the ValueSets.
const weightset_ptr & weightset() const
typename labelset_t::value_t label_t
Type of transition labels, and type of expression atoms.
context(const context &that)
typename labelset_t::kind_t kind_t
static constexpr bool has_one()
join_t< WS1, WS2 > weightset_t
typename weightset_t::value_t weight_t
Type of weights.
context(const labelset_ptr &ls, const weightset_ptr &ws)
An input/output format for valuesets.
static context make(std::istream &is)
Build from the description in is.
const labelset_ptr & labelset() const
auto meet(const expressionset< Ctx1 > &a, const expressionset< Ctx2 > &b) -> expressionset< meet_t< Ctx1, Ctx2 >>
The meet of two expressionsets.
Print as is. For instance, don't try to escape labels.
join_t< LS1, LS2 > labelset_t
context(const labelset_t &ls={}, const weightset_t &ws={})
Build a context.
Print as rich UTF-8 text, escaped.
full_context_t weightset_t
Provide a variadic mul on top of a binary mul(), and one().
static type join(const context< LS1, WS1 > &ctx1, const context< LS2, WS2 > &ctx2)
Print as plain (ASCII) text, escaped.
static symbol sname()
The name of this context, built from its parameters.
char eat(std::istream &is, char c)
Check lookahead character and advance.
std::shared_ptr< const weightset_t > weightset_ptr