GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/quantifiers/sygus/sygus_enumerator_basic.cpp Lines: 1 17 5.9 %
Date: 2021-09-17 Branches: 2 38 5.3 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Aina Niemetz
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
 * Implementation of sygus basic enumerator.
14
 */
15
#include "theory/quantifiers/sygus/sygus_enumerator_basic.h"
16
17
#include "options/datatypes_options.h"
18
#include "theory/rewriter.h"
19
20
using namespace cvc5::kind;
21
using namespace std;
22
23
namespace cvc5 {
24
namespace theory {
25
namespace quantifiers {
26
27
EnumValGeneratorBasic::EnumValGeneratorBasic(TermDbSygus* tds, TypeNode tn)
28
    : d_tds(tds), d_te(tn)
29
{
30
}
31
32
bool EnumValGeneratorBasic::increment()
33
{
34
  ++d_te;
35
  if (d_te.isFinished())
36
  {
37
    d_currTerm = Node::null();
38
    return false;
39
  }
40
  d_currTerm = *d_te;
41
  if (options::sygusSymBreakDynamic())
42
  {
43
    Node nextb = d_tds->sygusToBuiltin(d_currTerm);
44
    nextb = Rewriter::callExtendedRewrite(nextb);
45
    if (d_cache.find(nextb) == d_cache.end())
46
    {
47
      d_cache.insert(nextb);
48
      // only return the current term if not unique
49
    }
50
    else
51
    {
52
      d_currTerm = Node::null();
53
    }
54
  }
55
  return true;
56
}
57
58
}  // namespace quantifiers
59
}  // namespace theory
60
29577
}  // namespace cvc5