GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/preprocessing/passes/quantifiers_preprocess.cpp Lines: 15 15 100.0 %
Date: 2021-05-22 Branches: 26 50 52.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_rewriter.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
9459
QuantifiersPreprocess::QuantifiersPreprocess(PreprocessingPassContext* preprocContext)
34
9459
    : PreprocessingPass(preprocContext, "quantifiers-preprocess"){};
35
36
7321
PreprocessingPassResult QuantifiersPreprocess::applyInternal(
37
    AssertionPipeline* assertionsToPreprocess)
38
{
39
7321
  size_t size = assertionsToPreprocess->size();
40
59879
  for (size_t i = 0; i < size; ++i)
41
  {
42
105116
    Node prev = (*assertionsToPreprocess)[i];
43
105116
    TrustNode trn = quantifiers::QuantifiersRewriter::preprocess(prev);
44
52558
    if (!trn.isNull())
45
    {
46
32
      Node next = trn.getNode();
47
16
      assertionsToPreprocess->replace(i, Rewriter::rewrite(next));
48
16
      Trace("quantifiers-preprocess") << "*** Pre-skolemize " << prev << endl;
49
32
      Trace("quantifiers-preprocess")
50
16
          << "   ...got " << (*assertionsToPreprocess)[i] << endl;
51
    }
52
  }
53
54
7321
  return PreprocessingPassResult::NO_CONFLICT;
55
}
56
57
58
}  // namespace passes
59
}  // namespace preprocessing
60
28191
}  // namespace cvc5