1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/********************* */
/*! \file trust_substitutions.cpp
** \verbatim
** Top contributors (to current version):
** Andrew Reynolds
** This file is part of the CVC4 project.
** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
** in the top-level source directory and their institutional affiliations.
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
** \brief Trust substitutions
**/
#include "theory/trust_substitutions.h"
#include "theory/rewriter.h"
namespace CVC4 {
namespace theory {
TrustSubstitutionMap::TrustSubstitutionMap(context::Context* c,
ProofNodeManager* pnm)
: d_subs(c)
{
}
void TrustSubstitutionMap::addSubstitution(TNode x, TNode t, ProofGenerator* pg)
{
d_subs.addSubstitution(x, t);
}
TrustNode TrustSubstitutionMap::apply(Node n, bool doRewrite)
{
Node ns = d_subs.apply(n);
if (doRewrite)
{
ns = Rewriter::rewrite(ns);
}
return TrustNode::mkTrustRewrite(n, ns, nullptr);
}
void TrustSubstitutionMap::addSubstitutionSolved(TNode x, TNode t, TrustNode tn)
{
if (!isProofEnabled() || tn.getGenerator() == nullptr)
{
// no generator or not proof enabled, nothing to do
addSubstitution(x, t, nullptr);
return;
}
// NOTE: can try to transform tn.getProven() to (= x t) here
addSubstitution(x, t, nullptr);
}
SubstitutionMap& TrustSubstitutionMap::get() { return d_subs; }
bool TrustSubstitutionMap::isProofEnabled() const { return false; }
} // namespace theory
} // namespace CVC4
|