diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-08-16 16:58:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-16 16:58:06 -0500 |
commit | 013c1535ea821a42b1aebd0491c85a594f728a70 (patch) | |
tree | d9f2e91a52406edf66967faccad550631cd9e4a5 /src/preprocessing/passes/apply_to_const.h | |
parent | b2e2572b41dfeca41c72dc34b46632e04d1e933f (diff) | |
parent | 4e62cdade61514f268b96e78e2f82ad12dfcad07 (diff) |
Merge branch 'master' into moveKindedmoveKinded
Diffstat (limited to 'src/preprocessing/passes/apply_to_const.h')
-rw-r--r-- | src/preprocessing/passes/apply_to_const.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/preprocessing/passes/apply_to_const.h b/src/preprocessing/passes/apply_to_const.h new file mode 100644 index 000000000..9d5072023 --- /dev/null +++ b/src/preprocessing/passes/apply_to_const.h @@ -0,0 +1,51 @@ +/********************* */ +/*! \file apply_to_const.h + ** \verbatim + ** Top contributors (to current version): + ** Haniel Barbosa + ** This file is part of the CVC4 project. + ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS + ** in the top-level source directory) and their institutional affiliations. + ** All rights reserved. See the file COPYING in the top-level source + ** directory for licensing information.\endverbatim + ** + ** \brief The ApplyToConst preprocessing pass + ** + ** Rewrites applies to constants + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H +#define __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H + +#include <unordered_map> + +#include "expr/node.h" +#include "preprocessing/preprocessing_pass.h" +#include "preprocessing/preprocessing_pass_context.h" + +namespace CVC4 { +namespace preprocessing { +namespace passes { + +using NodeMap = std::unordered_map<Node, Node, NodeHashFunction>; + +class ApplyToConst : public PreprocessingPass +{ + public: + ApplyToConst(PreprocessingPassContext* preprocContext); + + protected: + PreprocessingPassResult applyInternal( + AssertionPipeline* assertionsToPreprocess) override; + + private: + Node rewriteApplyToConst(TNode n, NodeMap& cache); +}; + +} // namespace passes +} // namespace preprocessing +} // namespace CVC4 + +#endif /* __CVC4__PREPROCESSING__PASSES__APPLY_TO_CONST_H */ |