GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/skolem_lemma.cpp Lines: 14 14 100.0 %
Date: 2021-03-22 Branches: 25 76 32.9 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file skolem_lemma.cpp
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 The skolem lemma utility
13
 **/
14
15
#include "theory/skolem_lemma.h"
16
17
#include "expr/skolem_manager.h"
18
19
namespace CVC4 {
20
namespace theory {
21
22
237
SkolemLemma::SkolemLemma(TrustNode lem, Node k) : d_lemma(lem), d_skolem(k)
23
{
24
237
  Assert(lem.getKind() == TrustNodeKind::LEMMA);
25
237
}
26
27
1219
SkolemLemma::SkolemLemma(Node k, ProofGenerator* pg) : d_lemma(), d_skolem(k)
28
{
29
2438
  Node lem = getSkolemLemmaFor(k);
30
1219
  d_lemma = TrustNode::mkTrustLemma(lem, pg);
31
1219
}
32
33
1456
Node SkolemLemma::getSkolemLemmaFor(Node k)
34
{
35
2912
  Node w = SkolemManager::getWitnessForm(k);
36
1456
  Assert(w.getKind() == kind::WITNESS);
37
2912
  TNode tx = w[0][0];
38
2912
  TNode tk = k;
39
2912
  return w[1].substitute(tx, tk);
40
}
41
42
}  // namespace theory
43
26676
}  // namespace CVC4