1 /********************* */
2 /*! \file trust_substitutions.cpp
4 ** Top contributors (to current version):
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2020 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
12 ** \brief Trust substitutions
15 #include "theory/trust_substitutions.h"
17 #include "theory/rewriter.h"
22 TrustSubstitutionMap::TrustSubstitutionMap(context::Context
* c
,
23 ProofNodeManager
* pnm
)
28 void TrustSubstitutionMap::addSubstitution(TNode x
, TNode t
, ProofGenerator
* pg
)
30 d_subs
.addSubstitution(x
, t
);
33 TrustNode
TrustSubstitutionMap::apply(Node n
, bool doRewrite
)
35 Node ns
= d_subs
.apply(n
);
38 ns
= Rewriter::rewrite(ns
);
40 return TrustNode::mkTrustRewrite(n
, ns
, nullptr);
43 void TrustSubstitutionMap::addSubstitutionSolved(TNode x
, TNode t
, TrustNode tn
)
45 if (!isProofEnabled() || tn
.getGenerator() == nullptr)
47 // no generator or not proof enabled, nothing to do
48 addSubstitution(x
, t
, nullptr);
51 // NOTE: can try to transform tn.getProven() to (= x t) here
52 addSubstitution(x
, t
, nullptr);
55 SubstitutionMap
& TrustSubstitutionMap::get() { return d_subs
; }
57 bool TrustSubstitutionMap::isProofEnabled() const { return false; }