GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/arith/nl/ext/factoring_check.h Lines: 1 1 100.0 %
Date: 2021-11-07 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Gereon Kremer, Andrew Reynolds
4
 *
5
 * This file is part of the cvc5 project.
6
 *
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.
11
 * ****************************************************************************
12
 *
13
 * Check for factoring lemma.
14
 */
15
16
#ifndef CVC5__THEORY__ARITH__NL__EXT__FACTORING_CHECK_H
17
#define CVC5__THEORY__ARITH__NL__EXT__FACTORING_CHECK_H
18
19
#include <vector>
20
21
#include "expr/node.h"
22
#include "smt/env_obj.h"
23
24
namespace cvc5 {
25
26
class CDProof;
27
28
namespace theory {
29
namespace arith {
30
namespace nl {
31
32
struct ExtState;
33
34
9693
class FactoringCheck : protected EnvObj
35
{
36
 public:
37
  FactoringCheck(Env& env, ExtState* data);
38
39
  /** check factoring
40
   *
41
   * Returns a set of valid theory lemmas, based on a
42
   * lemma schema that states a relationship between monomials
43
   * with common factors that occur in the same constraint.
44
   *
45
   * Examples:
46
   *
47
   * x*z+y*z > t => ( k = x + y ^ k*z > t )
48
   *   ...where k is fresh and x*z + y*z > t is a
49
   *      constraint that occurs in the current context.
50
   */
51
  void check(const std::vector<Node>& asserts,
52
             const std::vector<Node>& false_asserts);
53
54
 private:
55
  /** Basic data that is shared with other checks */
56
  ExtState* d_data;
57
58
  /** maps nodes to their factor skolems */
59
  std::map<Node, Node> d_factor_skolem;
60
61
  Node d_zero;
62
  Node d_one;
63
64
  /**
65
   * Introduces a new purification skolem k for n and adds k=n as lemma.
66
   * If proof is not nullptr, it proves this lemma via MACRO_SR_PRED_INTRO.
67
   */
68
  Node getFactorSkolem(Node n, CDProof* proof);
69
};
70
71
}  // namespace nl
72
}  // namespace arith
73
}  // namespace theory
74
}  // namespace cvc5
75
76
#endif