GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/skolem_lemma.cpp Lines: 14 14 100.0 %
Date: 2021-03-23 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
239
SkolemLemma::SkolemLemma(TrustNode lem, Node k) : d_lemma(lem), d_skolem(k)
23
{
24
239
  Assert(lem.getKind() == TrustNodeKind::LEMMA);
25
239
}
26
27
1227
SkolemLemma::SkolemLemma(Node k, ProofGenerator* pg) : d_lemma(), d_skolem(k)
28
{
29
2454
  Node lem = getSkolemLemmaFor(k);
30
1227
  d_lemma = TrustNode::mkTrustLemma(lem, pg);
31
1227
}
32
33
1466
Node SkolemLemma::getSkolemLemmaFor(Node k)
34
{
35
2932
  Node w = SkolemManager::getWitnessForm(k);
36
1466
  Assert(w.getKind() == kind::WITNESS);
37
2932
  TNode tx = w[0][0];
38
2932
  TNode tk = k;
39
2932
  return w[1].substitute(tx, tk);
40
}
41
42
}  // namespace theory
43
26685
}  // namespace CVC4