summaryrefslogtreecommitdiff
path: root/src/theory/subs_minimize.h
blob: 55e57b9210adc0b30e4b5d36760e4b9f81895f91 (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
/*********************                                                        */
/*! \file subs_minimize.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Andrew Reynolds
 ** 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 Substitution minimization.
 **/

#include "cvc4_private.h"

#ifndef __CVC4__THEORY__SUBS_MINIMIZE_H
#define __CVC4__THEORY__SUBS_MINIMIZE_H

#include <vector>

#include "expr/node.h"

namespace CVC4 {
namespace theory {

/** SubstitutionMinimize
 *
 * This class is used for finding a minimal substitution under which an
 * evaluation holds.
 */
class SubstitutionMinimize
{
 public:
  SubstitutionMinimize();
  ~SubstitutionMinimize() {}
  /** find
   *
   * If n { vars -> subs } rewrites to target, this method returns true, and
   * vars[i1], ..., vars[in] are added to rewVars, such that
   * n { vars[i_1] -> subs[i_1], ..., vars[i_n] -> subs[i_n] } also rewrites to
   * target.
   *
   * If n { vars -> subs } does not rewrite to target, this method returns
   * false.
   */
  static bool find(Node n,
                   Node target,
                   const std::vector<Node>& vars,
                   const std::vector<Node>& subs,
                   std::vector<Node>& reqVars);

 private:
  /** is singular arg
   *
   * Returns true if
   *   <k>( ... t_{arg-1}, n, t_{arg+1}...) = c
   * always holds for some constant c.
   */
  static bool isSingularArg(Node n, Kind k, unsigned arg);
};

}  // namespace theory
}  // namespace CVC4

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