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_);
74 static auto res =
symbol{
"context<"
86 auto ls = labelset_t::make(is);
88 while (isspace(is.peek()))
90 auto ws = weightset_t::make(is);
116 static constexpr
bool
119 return labelset_t::has_one();
129 template <
typename LabelSet,
typename WeightSet>
142 template <
typename... ValueSets>
152 template <
typename ValueSet>
160 template <
typename ValueSet1,
typename ValueSet2,
typename ValueSet3,
163 meet(
const ValueSet1& vs1,
const ValueSet2& vs2,
const ValueSet3& vs3,
165 -> decltype(
meet(
meet(vs1, vs2), vs3, vs...))
167 return meet(
meet(vs1, vs2), vs3, vs...);
178 template <
typename LS1,
typename WS1,
179 typename LS2,
typename WS2>
203 template <
typename LhsLabelSet,
typename LhsWeightSet,
204 typename RhsLabelSet,
typename RhsWeightSet>
211 auto ls =
meet(*a.labelset(), *
b.labelset());
212 auto ws =
join(*a.weightset(), *
b.weightset());
std::shared_ptr< const weightset_t > weightset_ptr
static symbol sname()
The name of this context, built from its parameters.
context & operator=(context &&that)
typename labelset_t::value_t label_t
Type of transition labels, and type of expression atoms.
std::ostream & print_set(std::ostream &o, format fmt={}) const
A structure that implements the computation of join(V1, V2).
std::string type(const automaton &a)
The implementation type of a.
auto join(const ValueSet &vs) -> ValueSet
The join of a single valueset.
context(const context &that)
std::istringstream is
The input stream: the specification to translate.
char eat(std::istream &is, char c)
Check lookahead character and advance.
decltype(meet(std::declval< ValueSets >()...)) meet_t
typename labelset_t::kind_t kind_t
context(const labelset_ptr &ls, const weightset_ptr &ws)
const weightset_ptr & weightset() const
Provide a variadic mul on top of a binary mul(), and one().
decltype(join(std::declval< ValueSets >()...)) join_t
The type of the join of the ValueSets.
std::shared_ptr< const labelset_t > labelset_ptr
join_t< WS1, WS2 > weightset_t
static constexpr bool has_one()
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
Ctx make_context(const std::string &name)
context(const labelset_t &ls={}, const weightset_t &ws={})
Build a context.
auto meet(const expressionset< Ctx1 > &a, const expressionset< Ctx2 > &b) -> expressionset< meet_t< Ctx1, Ctx2 >>
The meet of two expressionsets.
const labelset_ptr & labelset() const
join_t< LS1, LS2 > labelset_t
static type join(const context< LS1, WS1 > &ctx1, const context< LS2, WS2 > &ctx2)
typename weightset_t::value_t weight_t
Type of weights.
full_context_t weightset_t
static context make(std::istream &is)
Build from the description in is.