SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
BaseSimplifier.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <boost/variant.hpp>
4 
5 namespace smtrat {
6 namespace expression {
7 namespace simplifier {
8 
9  struct BaseSimplifier: public boost::static_visitor<const ExpressionContent*> {
10  const ExpressionContent* operator()(const carl::Variable& expr) const {
11  return simplify(expr);
12  }
13  const ExpressionContent* operator()(const ITEExpression& expr) const {
14  return simplify(expr);
15  }
17  return simplify(expr);
18  }
19  const ExpressionContent* operator()(const UnaryExpression& expr) const {
20  return simplify(expr);
21  }
22  const ExpressionContent* operator()(const BinaryExpression& expr) const {
23  return simplify(expr);
24  }
25  const ExpressionContent* operator()(const NaryExpression& expr) const {
26  return simplify(expr);
27  }
28 
29  const ExpressionContent* operator()(const ExpressionContent* _ec) const {
30  const ExpressionContent* res = boost::apply_visitor(*this, _ec->content);
31  if (res == _ec) return nullptr;
32  return res;
33  }
34 
35  protected:
36 
37  virtual const ExpressionContent* simplify(const carl::Variable&) const {
38  return nullptr;
39  }
40  virtual const ExpressionContent* simplify(const ITEExpression&) const {
41  return nullptr;
42  }
43  virtual const ExpressionContent* simplify(const QuantifierExpression&) const {
44  return nullptr;
45  }
46  virtual const ExpressionContent* simplify(const UnaryExpression&) const {
47  return nullptr;
48  }
49  virtual const ExpressionContent* simplify(const BinaryExpression&) const {
50  return nullptr;
51  }
52  virtual const ExpressionContent* simplify(const NaryExpression&) const {
53  return nullptr;
54  }
55 
56 
57  };
58 
59 }
60 }
61 }
Class to create the formulas for axioms.
const ExpressionContent * operator()(const carl::Variable &expr) const
const ExpressionContent * operator()(const BinaryExpression &expr) const
const ExpressionContent * operator()(const ExpressionContent *_ec) const
const ExpressionContent * operator()(const QuantifierExpression &expr) const
const ExpressionContent * operator()(const ITEExpression &expr) const
virtual const ExpressionContent * simplify(const ITEExpression &) const
virtual const ExpressionContent * simplify(const carl::Variable &) const
virtual const ExpressionContent * simplify(const UnaryExpression &) const
virtual const ExpressionContent * simplify(const QuantifierExpression &) const
virtual const ExpressionContent * simplify(const NaryExpression &) const
const ExpressionContent * operator()(const UnaryExpression &expr) const
virtual const ExpressionContent * simplify(const BinaryExpression &) const
const ExpressionContent * operator()(const NaryExpression &expr) const