GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/arith/arith_rewriter.h Lines: 3 3 100.0 %
Date: 2021-03-22 Branches: 1 4 25.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file arith_rewriter.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Dejan Jovanovic, Andrew Reynolds, Tim King
6
 ** This file is part of the CVC4 project.
7
 ** Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 ** in the top-level source directory and their institutional affiliations.
9
 ** All rights reserved.  See the file COPYING in the top-level source
10
 ** directory for licensing information.\endverbatim
11
 **
12
 ** \brief Rewriter for arithmetic.
13
 **
14
 ** Rewriter for the theory of arithmetic.  This rewrites to the normal form for
15
 ** arithmetic. See theory/arith/normal_form.h for more information.
16
 **/
17
18
#include "cvc4_private.h"
19
20
#ifndef CVC4__THEORY__ARITH__ARITH_REWRITER_H
21
#define CVC4__THEORY__ARITH__ARITH_REWRITER_H
22
23
#include "theory/arith/rewrites.h"
24
#include "theory/theory_rewriter.h"
25
26
namespace CVC4 {
27
namespace theory {
28
namespace arith {
29
30
17987
class ArithRewriter : public TheoryRewriter
31
{
32
 public:
33
  RewriteResponse preRewrite(TNode n) override;
34
  RewriteResponse postRewrite(TNode n) override;
35
36
 private:
37
  static Node makeSubtractionNode(TNode l, TNode r);
38
  static Node makeUnaryMinusNode(TNode n);
39
40
  static RewriteResponse preRewriteTerm(TNode t);
41
  static RewriteResponse postRewriteTerm(TNode t);
42
43
  static RewriteResponse rewriteVariable(TNode t);
44
  static RewriteResponse rewriteConstant(TNode t);
45
  static RewriteResponse rewriteMinus(TNode t, bool pre);
46
  static RewriteResponse rewriteUMinus(TNode t, bool pre);
47
  static RewriteResponse rewriteDiv(TNode t, bool pre);
48
  static RewriteResponse rewriteIntsDivMod(TNode t, bool pre);
49
  static RewriteResponse rewriteIntsDivModTotal(TNode t, bool pre);
50
51
  static RewriteResponse preRewritePlus(TNode t);
52
  static RewriteResponse postRewritePlus(TNode t);
53
54
  static RewriteResponse preRewriteMult(TNode t);
55
  static RewriteResponse postRewriteMult(TNode t);
56
57
  static RewriteResponse postRewriteIAnd(TNode t);
58
59
  static RewriteResponse preRewriteTranscendental(TNode t);
60
  static RewriteResponse postRewriteTranscendental(TNode t);
61
62
  static RewriteResponse preRewriteAtom(TNode t);
63
  static RewriteResponse postRewriteAtom(TNode t);
64
65
  static bool isAtom(TNode n);
66
67
7858561
  static inline bool isTerm(TNode n) {
68
7858561
    return !isAtom(n);
69
  }
70
  /** return rewrite */
71
  static RewriteResponse returnRewrite(TNode t, Node ret, Rewrite r);
72
}; /* class ArithRewriter */
73
74
}/* CVC4::theory::arith namespace */
75
}/* CVC4::theory namespace */
76
}/* CVC4 namespace */
77
78
#endif /* CVC4__THEORY__ARITH__ARITH_REWRITER_H */