Vcsn  2.4
Be Rational
constant.hh
Go to the documentation of this file.
1 #pragma once
2 
4 #include <vcsn/dyn/context.hh>
5 #include <vcsn/dyn/value.hh>
6 
7 namespace vcsn
8 {
9  namespace dyn
10  {
11  namespace detail
12  {
14  template <typename Context, typename Identities>
15  expression expression_one(const context& ctx, identities ids)
16  {
17  const auto& c = ctx->as<Context>();
18  auto rs = vcsn::make_expressionset(c, ids);
19  return {rs, rs.one()};
20  }
21 
23  template <typename Context, typename Identities>
25  {
26  const auto& c = ctx->as<Context>();
27  auto rs = vcsn::make_expressionset(c, ids);
28  return {rs, rs.zero()};
29  }
30 
32  template <typename Context>
34  {
35  const auto& c = ctx->as<Context>();
36  auto ws = *c.weightset();
37  return {ws, ws.one()};
38  }
39 
41  template <typename Context>
43  {
44  const auto& c = ctx->as<Context>();
45  auto ws = *c.weightset();
46  return {ws, ws.zero()};
47  }
48  }
49  }
50 } // namespace vcsn
expression expression_zero(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:24
auto rs
Definition: lift.hh:152
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
auto make_expressionset(const context< LabelSet, WeightSet > &ctx, rat::identities ids={}) -> expressionset< context< LabelSet, WeightSet >>
Shorthand to expressionset constructor.
auto & as()
Downcast to the exact type.
Definition: context.hh:36
weight weight_one(const context &ctx)
Bridge.
Definition: constant.hh:33
Definition: a-star.hh:8
weight weight_zero(const context &ctx)
Bridge.
Definition: constant.hh:42
Template-less root for contexts.
Definition: context.hh:16
A dyn Value/ValueSet.
Definition: fwd.hh:23
expression expression_one(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:15
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25