74 case RelationalNode::Op::GT:
return "GT";
75 case RelationalNode::Op::LT:
return "LT";
76 case RelationalNode::Op::GEQ:
return "GEQ";
77 case RelationalNode::Op::LEQ:
return "LEQ";
78 case RelationalNode::Op::NEQ:
return "NEQ";
79 case RelationalNode::Op::EQ:
return "EQ";
84 if (ep.is_neg_infinity)
return "-inf";
85 if (ep.is_pos_infinity)
return "+inf";
86 if (ep.value)
return ep.value->to_string();
91 result += iv.lower.is_open ?
"(" :
"[";
95 result += iv.upper.is_open ?
")" :
"]";
100 const std::string&
sym) {
105 auto signs = props.get_signs(
sym);
106 for (
Sign s : signs) {
117 const auto bounds = props.get_bounds(
sym);
124 if (props.is_transcendental(
sym)) {
125 out <<
"TRANSCENDENTAL " <<
sym <<
"\n";
135 for (
const auto& [
variable, period] : props.get_period_decls(
sym)) {
136 out <<
"PERIODIC " <<
sym <<
" " <<
variable <<
" "
137 << period.to_string() <<
"\n";
142 const std::string&
sym) {
143 auto cont_decls = props.get_continuity_decls(
sym);
144 for (
const auto& decl : cont_decls) {
145 if (decl.is_differentiable) {
146 out <<
"DIFFERENTIABLE " <<
sym <<
" "
149 out <<
"CONTINUOUS " <<
sym <<
" "
154 auto mono_decls = props.get_monotonicity_decls(
sym);
155 for (
const auto& decl : mono_decls) {
156 out <<
"MONOTONICITY " <<
sym <<
" " << decl.variable <<
" "
164std::string AssumptionContext::serialize()
const {
165 std::ostringstream out;
167 for (
int scope_idx = 0; scope_idx < static_cast<int>(scope_stack_.size()); ++scope_idx) {
168 out <<
"SCOPE " << scope_idx <<
"\n";
169 const auto& scope = scope_stack_[scope_idx];
170 const auto& props = scope.properties;
171 auto symbols = props.get_all_symbols();
172 for (
const auto&
sym : symbols) {
173 serialize_symbol_properties(out, props,
sym);
175 for (
const auto&
sym : symbols) {
178 const auto& relations = scope.relations.get_relations();
179 for (
const auto i : scope.relations.declaration_order_) {
180 const auto& rel = relations[i];
181 std::string lhs_str = rel.lhs.to_string();
182 std::string rhs_str = rel.rhs.to_string();
184 <<
" " << rhs_str <<
"\n";
186 for (
const auto& cond : scope.conditionals) {
187 std::string cond_str = cond.condition.to_string();
188 std::string concl_str = cond.conclusion.to_string();
189 out <<
"CONDITIONAL (" << cond_str <<
") => (" << concl_str <<
")\n";
AssumptionContext class with scoped push/pop management.
std::string parity_to_string(Parity p)
std::string sign_to_string(Sign s)
std::string interval_to_string(const Interval &iv)
std::string relop_to_string(RelationalNode::Op op)
void serialize_symbol_intervals(std::ostream &out, const PropertyStore &props, const std::string &sym)
std::string endpoint_to_string(const Endpoint &ep)
std::string monotonicity_to_string(Monotonicity m)
std::string boundedness_to_string(Boundedness b)
std::string definiteness_to_string(Definiteness d)
std::string finiteness_to_string(Finiteness f)
void serialize_symbol_properties(std::ostream &out, const PropertyStore &props, const std::string &sym)
std::string domain_str(Domain domain)
const std::string & variable
Domain
Mathematical domain hierarchy (least specific → most specific). Complex ⊃ Real ⊃ Algebraic ⊃ Rational...
@ Complex
Complex numbers (default, least specific)
Boundedness
Boundedness classification for symbols.
@ Unbounded
Symbol is unbounded
@ Unknown
Boundedness not determined
@ Bounded
Symbol has finite bounds
Monotonicity
Monotonicity classification for functions over intervals.
@ NonDecreasing
Non-decreasing (weakly increasing)
@ Decreasing
Strictly decreasing
@ Unknown
Monotonicity not determined
@ NonIncreasing
Non-increasing (weakly decreasing)
@ Increasing
Strictly increasing
Definiteness
Matrix definiteness classification.
@ NegativeSemiDefinite
All eigenvalues non-positive
@ NegativeDefinite
All eigenvalues negative
@ PositiveSemiDefinite
All eigenvalues non-negative
@ PositiveDefinite
All eigenvalues positive
@ Unknown
Definiteness not determined
@ Indefinite
Mixed eigenvalue signs
const ExprPtr RelationOp op
ExprResult sym(const std::string &name)
Finiteness
Finiteness classification for limits and sequences.
@ Finite
Has a finite value or limit
@ Unknown
Finiteness not determined
@ Divergent
Diverges to infinity or oscillates
Parity
Integer parity classification.
@ Unknown
Parity not determined
Sign
Sign classification for symbols and expressions.