summaryrefslogtreecommitdiff
path: root/src/theory/arith/next_arith_rewriter.h
blob: 7f1ec0fbdf8db26d92eef26947a3bf4eee0d1ebe (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
68
69
70
71
72
73
74
/*********************                                                        */
/*! \file arith_rewriter.h
 ** \verbatim
 ** Original author: taking
 ** Major contributors: mdeters
 ** Minor contributors (to current version): none
 ** This file is part of the CVC4 prototype.
 ** Copyright (c) 2009, 2010  The Analysis of Computer Systems Group (ACSys)
 ** Courant Institute of Mathematical Sciences
 ** New York University
 ** 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 "theory/arith/arith_constants.h"
#include "theory/theory.h"
#include "theory/arith/normal_form.h"

#ifndef __CVC4__THEORY__ARITH__REWRITER_NEXT_H
#define __CVC4__THEORY__ARITH__REWRITER_NEXT_H

namespace CVC4 {
namespace theory {
namespace arith {

class NextArithRewriter{
private:
  ArithConstants* d_constants;

  Node makeSubtractionNode(TNode l, TNode r);
  Node makeUnaryMinusNode(TNode n);

  RewriteResponse preRewriteTerm(TNode t);
  RewriteResponse postRewriteTerm(TNode t);

  RewriteResponse rewriteVariable(TNode t);
  RewriteResponse rewriteConstant(TNode t);
  RewriteResponse rewriteMinus(TNode t, bool pre);
  RewriteResponse rewriteUMinus(TNode t, bool pre);
  RewriteResponse rewriteDivByConstant(TNode t, bool pre);

  RewriteResponse preRewritePlus(TNode t);
  RewriteResponse postRewritePlus(TNode t);

  RewriteResponse preRewriteMult(TNode t);
  RewriteResponse postRewriteMult(TNode t);


  RewriteResponse preRewriteAtom(TNode t);
  RewriteResponse postRewriteAtom(TNode t);
  RewriteResponse postRewriteAtomConstantRHS(TNode t);

public:
  NextArithRewriter(ArithConstants* ac) : d_constants(ac) {}

  RewriteResponse preRewrite(TNode n);
  RewriteResponse postRewrite(TNode n);

private:
  bool isAtom(TNode n) const { return isRelationOperator(n.getKind()); }
  bool isTerm(TNode n) const { return !isAtom(n); }
};


}; /* namesapce arith */
}; /* namespace theory */
}; /* namespace CVC4 */

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