SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
MergeSimplifier.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "BaseSimplifier.h"
4 #include "../ExpressionPool.h"
5 
6 namespace smtrat {
7 namespace expression {
8 namespace simplifier {
9 
11  const ExpressionContent* simplify(const NaryExpression& expr) const {
12  if (expr.type == IFF) return nullptr;
13  bool simplified = false;
14  Expressions expressions;
15  for (auto it = expr.expressions.begin(); it != expr.expressions.end(); it++) {
16  if (it->is_nary()) {
17  const NaryExpression& ne = it->getNary();
18  if (ne.type != expr.type) continue;
19  expressions.insert(expressions.end(), ne.expressions.begin(), ne.expressions.end());
20  simplified = true;
21  } else {
22  expressions.push_back(*it);
23  }
24  }
25  if (simplified) {
26  return ExpressionPool::create(expr.type, std::move(expressions));
27  }
28  return nullptr;
29  }
30  };
31 
32 }
33 }
34 }
const ExpressionContent * create(carl::Variable::Arg var)
std::vector< Expression > Expressions
Class to create the formulas for axioms.
const ExpressionContent * simplify(const NaryExpression &expr) const