SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Simplifier.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tuple>
4 
5 #include "DuplicateSimplifier.h"
6 #include "MergeSimplifier.h"
7 #include "SingletonSimplifier.h"
8 
9 namespace smtrat {
10 namespace expression {
11 namespace simplifier {
12 
13  typedef std::tuple<
14  MergeSimplifier,
15  DuplicateSimplifier,
16  SingletonSimplifier
18 
19  template<std::size_t chainID = std::tuple_size<SimplifierChain>::value - 1>
22  const ExpressionContent* operator()(const ExpressionContent* _ec, const SimplifierChain& _chain) const {
23  const ExpressionContent* tmp = std::get<chainID>(_chain)(_ec);
24  if (tmp == nullptr) tmp = _ec;
25  return recurse(tmp, _chain);
26  }
27  };
28  template<>
30  const ExpressionContent* operator()(const ExpressionContent* _ec, const SimplifierChain& _chain) const {
31  const ExpressionContent* tmp = std::get<0>(_chain)(_ec);
32  if (tmp == nullptr) tmp = _ec;
33  return tmp;
34  }
35  };
36 
37 
38  class Simplifier {
39  private:
40 
43 
44  public:
45  const ExpressionContent* operator()(const ExpressionContent* _ec) const {
46  const ExpressionContent* res = mCaller(_ec, mChain);
47  if (res != _ec) return res;
48  return nullptr;
49  }
50  };
51 
52 }
53 }
54 }
const ExpressionContent * operator()(const ExpressionContent *_ec) const
Definition: Simplifier.h:45
std::tuple< MergeSimplifier, DuplicateSimplifier, SingletonSimplifier > SimplifierChain
Definition: Simplifier.h:17
Class to create the formulas for axioms.
const ExpressionContent * operator()(const ExpressionContent *_ec, const SimplifierChain &_chain) const
Definition: Simplifier.h:30
const ExpressionContent * operator()(const ExpressionContent *_ec, const SimplifierChain &_chain) const
Definition: Simplifier.h:22
SimplifierChainCaller< chainID-1 > recurse
Definition: Simplifier.h:21