GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/sygus/template_infer.h Lines: 2 2 100.0 %
Date: 2021-03-23 Branches: 1 2 50.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file template_infer.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds
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 utility for inferring templates for invariant problems
13
 **/
14
15
#include "cvc4_private.h"
16
17
#ifndef CVC4__THEORY__QUANTIFIERS__SYGUS__TEMPLATE_INFER_H
18
#define CVC4__THEORY__QUANTIFIERS__SYGUS__TEMPLATE_INFER_H
19
20
#include <map>
21
22
#include "expr/node.h"
23
#include "theory/quantifiers/sygus/transition_inference.h"
24
25
namespace CVC4 {
26
namespace theory {
27
namespace quantifiers {
28
29
/**
30
 * This class infers templates for an invariant-to-synthesize based on the
31
 * template mode. It uses the transition inference to choose a template.
32
 */
33
class SygusTemplateInfer
34
{
35
 public:
36
2190
  SygusTemplateInfer() {}
37
2188
  ~SygusTemplateInfer() {}
38
  /**
39
   * Initialize this class for synthesis conjecture q. If applicable, the
40
   * templates for functions-to-synthesize for q are accessible by the
41
   * calls below afterwards.
42
   */
43
  void initialize(Node q);
44
  /**
45
   * Get template for program prog. This returns a term of the form t[x] where
46
   * x is the template argument (see below)
47
   */
48
  Node getTemplate(Node prog) const;
49
  /**
50
   * Get the template argument for program prog. This is a variable which
51
   * indicates the position of the function/predicate to synthesize.
52
   */
53
  Node getTemplateArg(Node prog) const;
54
55
 private:
56
  /** The quantified formula we initialized with */
57
  Node d_quant;
58
  /** transition relation pre and post version per function to synthesize  */
59
  std::map<Node, Node> d_trans_pre;
60
  std::map<Node, Node> d_trans_post;
61
  /** the template for each function to synthesize */
62
  std::map<Node, Node> d_templ;
63
  /**
64
   * The template argument for each function to synthesize (occurs in exactly
65
   * one position of its template)
66
   */
67
  std::map<Node, Node> d_templ_arg;
68
  /** transition inference module */
69
  TransitionInference d_ti;
70
};
71
72
}  // namespace quantifiers
73
}  // namespace theory
74
} /* namespace CVC4 */
75
76
#endif