summaryrefslogtreecommitdiff
path: root/src/theory/fp/theory_fp_rewriter.h
blob: ec042dfe921af40de555ebfa6c9602e63ce29e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*********************                                                        */
/*! \file theory_fp_rewriter.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Martin Brain
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2019 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 [[ Add one-line brief description here ]]
 **
 ** [[ Add lengthier description here ]]
 ** \todo document this file
 **/

#include "cvc4_private.h"

#ifndef __CVC4__THEORY__FP__THEORY_FP_REWRITER_H
#define __CVC4__THEORY__FP__THEORY_FP_REWRITER_H

#include "theory/rewriter.h"

namespace CVC4 {
namespace theory {
namespace fp {

typedef RewriteResponse (*RewriteFunction) (TNode, bool);

class TheoryFpRewriter {
 protected :
  static RewriteFunction preRewriteTable[kind::LAST_KIND];
  static RewriteFunction postRewriteTable[kind::LAST_KIND];
  static RewriteFunction constantFoldTable[kind::LAST_KIND]; 


 public:

  static RewriteResponse preRewrite(TNode node);
  static RewriteResponse postRewrite(TNode node);


  /**
   * Rewrite an equality, in case special handling is required.
   */
  static Node rewriteEquality(TNode equality) {
    // often this will suffice
    return postRewrite(equality).node;
  }

  static void init();

  /**
   * Shut down the rewriter.
   */
  static inline void shutdown() {
    // nothing to do
  }

};/* class TheoryFpRewriter */

}/* CVC4::theory::fp namespace */
}/* CVC4::theory namespace */
}/* CVC4 namespace */

#endif /* __CVC4__THEORY__FP__THEORY_FP_REWRITER_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback