summaryrefslogtreecommitdiff
path: root/src/parser/tptp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-09 14:33:01 -0500
committerGitHub <noreply@github.com>2020-03-09 14:33:01 -0500
commite337310b9f5df6b7ecd0f2e351b9c0e4265e8e69 (patch)
tree649fee3d9e18e01e4933ceef7099b6ed10d17457 /src/parser/tptp
parent9f77ec44decf18fe23c738988281373795dcca0d (diff)
Clean up more uses of ExprManager in parsers (#3932)
Towards parser migration. Beyond Datatypes, there are still a handful of calls to the ExprManager in the parsers. This eliminates a few missing cases from TPTP and also inlines the access of ExprManager in the places its used.
Diffstat (limited to 'src/parser/tptp')
-rw-r--r--src/parser/tptp/tptp.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/parser/tptp/tptp.cpp b/src/parser/tptp/tptp.cpp
index a21cc6785..51b852eac 100644
--- a/src/parser/tptp/tptp.cpp
+++ b/src/parser/tptp/tptp.cpp
@@ -69,20 +69,19 @@ Tptp::~Tptp() {
}
void Tptp::addTheory(Theory theory) {
- ExprManager * em = getExprManager();
switch(theory) {
case THEORY_CORE:
//TPTP (CNF and FOF) is unsorted so we define this common type
{
std::string d_unsorted_name = "$$unsorted";
- d_unsorted = api::Sort(em->mkSort(d_unsorted_name));
+ d_unsorted = d_solver->mkUninterpretedSort(d_unsorted_name);
preemptCommand(
new DeclareTypeCommand(d_unsorted_name, 0, d_unsorted.getType()));
}
// propositionnal
- defineType("Bool", em->booleanType());
- defineVar("$true", em->mkConst(true));
- defineVar("$false", em->mkConst(false));
+ defineType("Bool", d_solver->getBooleanSort());
+ defineVar("$true", d_solver->mkTrue());
+ defineVar("$false", d_solver->mkFalse());
addOperator(api::AND);
addOperator(api::EQUAL);
addOperator(api::IMPLIES);
@@ -312,12 +311,11 @@ api::Term Tptp::applyParseOp(ParseOp& p, std::vector<api::Term>& args)
isBuiltinKind = true;
}
assert(kind != api::NULL_EXPR);
- ExprManager* em = getExprManager();
+ const Options& opts = d_solver->getExprManager()->getOptions();
// Second phase: apply parse op to the arguments
if (isBuiltinKind)
{
- if (!em->getOptions().getUfHo()
- && (kind == api::EQUAL || kind == api::DISTINCT))
+ if (!opts.getUfHo() && (kind == api::EQUAL || kind == api::DISTINCT))
{
// need --uf-ho if these operators are applied over function args
for (std::vector<api::Term>::iterator i = args.begin(); i != args.end();
@@ -352,7 +350,7 @@ api::Term Tptp::applyParseOp(ParseOp& p, std::vector<api::Term>& args)
unsigned arity = argt.getFunctionArity();
if (args.size() - 1 < arity)
{
- if (!em->getOptions().getUfHo())
+ if (!opts.getUfHo())
{
parseError("Cannot partially apply functions unless --uf-ho is set.");
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback