GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/preprocessing/passes/sygus_inference.h Lines: 1 1 100.0 %
Date: 2021-05-22 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner
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
 * SygusInference.
14
 */
15
16
#ifndef CVC5__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_
17
#define CVC5__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_
18
19
#include <vector>
20
#include "expr/node.h"
21
22
#include "preprocessing/preprocessing_pass.h"
23
24
namespace cvc5 {
25
namespace preprocessing {
26
namespace passes {
27
28
/** SygusInference
29
 *
30
 * A preprocessing utility that turns a set of (quantified) assertions into a
31
 * single SyGuS conjecture. If this is possible, we solve for this single Sygus
32
 * conjecture using a separate copy of the SMT engine. If sygus successfully
33
 * solves the conjecture, we plug the synthesis solutions back into the original
34
 * problem, thus obtaining a set of model substitutions under which the
35
 * assertions should simplify to true.
36
 */
37
18918
class SygusInference : public PreprocessingPass
38
{
39
 public:
40
  SygusInference(PreprocessingPassContext* preprocContext);
41
42
 protected:
43
  /**
44
   * Either replaces all uninterpreted functions in assertions by their
45
   * interpretation in a sygus solution, or leaves the assertions unmodified.
46
   */
47
  PreprocessingPassResult applyInternal(
48
      AssertionPipeline* assertionsToPreprocess) override;
49
  /** solve sygus
50
   *
51
   * Returns true if we can recast the input problem assertions as a sygus
52
   * problem and successfully solve it using a separate call to an SMT engine.
53
   *
54
   * We fail if either a sygus conjecture that corresponds to assertions cannot
55
   * be inferred, or the sygus conjecture we infer is infeasible.
56
   *
57
   * If this function returns true, then we add all uninterpreted symbols s in
58
   * assertions to funs and their corresponding solution to sols.
59
   */
60
  bool solveSygus(const std::vector<Node>& assertions,
61
                  std::vector<Node>& funs,
62
                  std::vector<Node>& sols);
63
};
64
65
}  // namespace passes
66
}  // namespace preprocessing
67
}  // namespace cvc5
68
69
#endif /* CVC5__PREPROCESSING__PASSES__SYGUS_INFERENCE_H_ */