GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/preprocessing/passes/quantifiers_preprocess.cpp Lines: 16 16 100.0 %
Date: 2021-09-16 Branches: 27 50 54.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Caleb Donovick, Andrew Reynolds, Gereon Kremer
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
 * Remove rewrite rules, apply pre-skolemization to existential quantifiers.
14
 *
15
 * Calls the quantifier rewriter, removing rewrite rules and applying
16
 * pre-skolemization to existential quantifiers
17
 */
18
19
#include "preprocessing/passes/quantifiers_preprocess.h"
20
21
#include "base/output.h"
22
#include "preprocessing/assertion_pipeline.h"
23
#include "theory/quantifiers/quantifiers_preprocess.h"
24
#include "theory/rewriter.h"
25
26
namespace cvc5 {
27
namespace preprocessing {
28
namespace passes {
29
30
using namespace std;
31
using namespace cvc5::theory;
32
33
9942
QuantifiersPreprocess::QuantifiersPreprocess(PreprocessingPassContext* preprocContext)
34
9942
    : PreprocessingPass(preprocContext, "quantifiers-preprocess"){};
35
36
8169
PreprocessingPassResult QuantifiersPreprocess::applyInternal(
37
    AssertionPipeline* assertionsToPreprocess)
38
{
39
8169
  size_t size = assertionsToPreprocess->size();
40
16338
  quantifiers::QuantifiersPreprocess qp(d_env);
41
61935
  for (size_t i = 0; i < size; ++i)
42
  {
43
107532
    Node prev = (*assertionsToPreprocess)[i];
44
107532
    TrustNode trn = qp.preprocess(prev);
45
53766
    if (!trn.isNull())
46
    {
47
32
      Node next = trn.getNode();
48
16
      assertionsToPreprocess->replace(i, rewrite(next));
49
16
      Trace("quantifiers-preprocess") << "*** Pre-skolemize " << prev << endl;
50
32
      Trace("quantifiers-preprocess")
51
16
          << "   ...got " << (*assertionsToPreprocess)[i] << endl;
52
    }
53
  }
54
55
16338
  return PreprocessingPassResult::NO_CONFLICT;
56
}
57
58
59
}  // namespace passes
60
}  // namespace preprocessing
61
29577
}  // namespace cvc5