1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
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 |
|
* The skolem lemma utility. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "theory/skolem_lemma.h" |
17 |
|
|
18 |
|
#include "expr/skolem_manager.h" |
19 |
|
|
20 |
|
namespace cvc5 { |
21 |
|
namespace theory { |
22 |
|
|
23 |
251 |
SkolemLemma::SkolemLemma(TrustNode lem, Node k) : d_lemma(lem), d_skolem(k) |
24 |
|
{ |
25 |
251 |
Assert(lem.getKind() == TrustNodeKind::LEMMA); |
26 |
251 |
} |
27 |
|
|
28 |
1303 |
SkolemLemma::SkolemLemma(Node k, ProofGenerator* pg) : d_lemma(), d_skolem(k) |
29 |
|
{ |
30 |
2606 |
Node lem = getSkolemLemmaFor(k); |
31 |
1303 |
d_lemma = TrustNode::mkTrustLemma(lem, pg); |
32 |
1303 |
} |
33 |
|
|
34 |
1554 |
Node SkolemLemma::getSkolemLemmaFor(Node k) |
35 |
|
{ |
36 |
3108 |
Node w = SkolemManager::getWitnessForm(k); |
37 |
1554 |
Assert(w.getKind() == kind::WITNESS); |
38 |
3108 |
TNode tx = w[0][0]; |
39 |
3108 |
TNode tk = k; |
40 |
3108 |
return w[1].substitute(tx, tk); |
41 |
|
} |
42 |
|
|
43 |
|
} // namespace theory |
44 |
27735 |
} // namespace cvc5 |