summaryrefslogtreecommitdiff
path: root/src/prop
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2021-11-12 06:14:49 -0800
committerGitHub <noreply@github.com>2021-11-12 08:14:49 -0600
commitad340126a7adbb9840cca1d082c57b43995987a4 (patch)
treeda06599c2691f063b770b2b1ba7e2ccf87f26cc6 /src/prop
parent5cfbb67e228daf76835b7fd0a95d214859be030e (diff)
Remove `ConstantMap<Rational>` (#7635)
This is in preparation of having two different kinds (CONST_RATIONAL and CONST_INT) share the same payload. To do so, we cannot rely on ConstantMap<Rational> anymore to map the payload type to a kind. This commit extends support in the mkmetakind script to deal with such payloads by adding a + suffix to the type. The commit also does some minor refactoring of NodeManager::mkConst() and NodeManager::mkConstInternal() to support setting the kind explicitly. Finally, the commit addresses all instances where mkConst<Rational>() is used, including the API.
Diffstat (limited to 'src/prop')
-rw-r--r--src/prop/proof_cnf_stream.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/prop/proof_cnf_stream.cpp b/src/prop/proof_cnf_stream.cpp
index d09854bce..61a1a298c 100644
--- a/src/prop/proof_cnf_stream.cpp
+++ b/src/prop/proof_cnf_stream.cpp
@@ -20,6 +20,8 @@
#include "theory/builtin/proof_checker.h"
#include "util/rational.h"
+using namespace cvc5::kind;
+
namespace cvc5 {
namespace prop {
@@ -171,7 +173,7 @@ void ProofCnfStream::convertAndAssertAnd(TNode node, bool negated)
for (unsigned i = 0, size = node.getNumChildren(); i < size; ++i)
{
// Create a proof step for each n_i
- Node iNode = nm->mkConst<Rational>(i);
+ Node iNode = nm->mkConst<Rational>(CONST_RATIONAL, i);
d_proof.addStep(node[i], PfRule::AND_ELIM, {node}, {iNode});
Trace("cnf") << "ProofCnfStream::convertAndAssertAnd: AND_ELIM " << i
<< " added norm " << node[i] << "\n";
@@ -230,7 +232,7 @@ void ProofCnfStream::convertAndAssertOr(TNode node, bool negated)
for (unsigned i = 0, size = node.getNumChildren(); i < size; ++i)
{
// Create a proof step for each (not n_i)
- Node iNode = nm->mkConst<Rational>(i);
+ Node iNode = nm->mkConst<Rational>(CONST_RATIONAL, i);
d_proof.addStep(
node[i].notNode(), PfRule::NOT_OR_ELIM, {node.notNode()}, {iNode});
Trace("cnf") << "ProofCnfStream::convertAndAssertOr: NOT_OR_ELIM " << i
@@ -685,7 +687,7 @@ SatLiteral ProofCnfStream::handleAnd(TNode node)
if (added)
{
Node clauseNode = nm->mkNode(kind::OR, node.notNode(), node[i]);
- Node iNode = nm->mkConst<Rational>(i);
+ Node iNode = nm->mkConst<Rational>(CONST_RATIONAL, i);
d_proof.addStep(clauseNode, PfRule::CNF_AND_POS, {}, {node, iNode});
Trace("cnf") << "ProofCnfStream::handleAnd: CNF_AND_POS " << i
<< " added " << clauseNode << "\n";
@@ -745,7 +747,7 @@ SatLiteral ProofCnfStream::handleOr(TNode node)
if (added)
{
Node clauseNode = nm->mkNode(kind::OR, node, node[i].notNode());
- Node iNode = nm->mkConst<Rational>(i);
+ Node iNode = nm->mkConst<Rational>(CONST_RATIONAL, i);
d_proof.addStep(clauseNode, PfRule::CNF_OR_NEG, {}, {node, iNode});
Trace("cnf") << "ProofCnfStream::handleOr: CNF_OR_NEG " << i << " added "
<< clauseNode << "\n";
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback