Vcsn  2.2
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/expression.hh>
6 
7 namespace vcsn
8 {
9  namespace dyn
10  {
11  namespace detail
12  {
14  template <typename Context, typename Identities>
16  {
17  const auto& c = ctx->as<Context>();
18  auto rs = vcsn::make_expressionset(c, ids);
19  return dyn::make_expression(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 dyn::make_expression(rs, rs.zero());
29  }
30  }
31  }
32 } // namespace vcsn
An expressionset can implement several different sets of identities on expressions.
Definition: identities.hh:21
Definition: a-star.hh:8
expression expression_zero(const context &ctx, rat::identities ids)
Bridge.
Definition: constant.hh:24
std::shared_ptr< const detail::context_base > context
A dyn::context.
Definition: fwd.hh:43
auto rs
Definition: lift.hh:151
expressionset< Context > make_expressionset(const Context &ctx, rat::identities identities={})
Shorthand to expressionset constructor.
static dyn::context ctx(const driver &d)
Get the context of the driver.
Definition: parse.cc:82
std::shared_ptr< detail::expression_base > expression
Definition: expression.hh:92
expression expression_one(const context &ctx, rat::identities ids)
Bridge.
Definition: constant.hh:15
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
expression make_expression(const ExpSet &rs, const typename ExpSet::value_t &r)
Definition: expression.hh:97