-void constant::print(const print_context & c, unsigned level) const
-{
- if (is_a<print_tree>(c)) {
- c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
- << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
- << std::endl;
- } else if (is_a<print_latex>(c)) {
- c.s << TeX_name;
- } else if (is_a<print_python_repr>(c)) {
- c.s << class_name() << "('" << name << "'";
- if (TeX_name != "\\mbox{" + name + "}")
- c.s << ",TeX_name='" << TeX_name << "'";
- c.s << ')';
- } else
- c.s << name;
+void constant::do_print(const print_context & c, unsigned level) const
+{
+ c.s << name;
+}
+
+void constant::do_print_tree(const print_tree & c, unsigned level) const
+{
+ c.s << std::string(level, ' ') << name << " (" << class_name() << ")" << " @" << this
+ << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
+ << std::endl;
+}
+
+void constant::do_print_latex(const print_latex & c, unsigned level) const
+{
+ c.s << TeX_name;
+}
+
+void constant::do_print_python_repr(const print_python_repr & c, unsigned level) const
+{
+ c.s << class_name() << "('" << name << "'";
+ if (TeX_name != "\\mathrm{" + name + "}")
+ c.s << ",TeX_name='" << TeX_name << "'";
+ c.s << ')';
+}
+
+bool constant::info(unsigned inf) const
+{
+ if (inf == info_flags::polynomial)
+ return true;
+ if (inf == info_flags::real)
+ return domain==domain::real || domain==domain::positive ;
+ if (inf==info_flags::positive || inf==info_flags::nonnegative)
+ return domain == domain::positive;
+ else
+ return inherited::info(inf);