summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-25 20:52:10 -0600
committerGitHub <noreply@github.com>2020-02-25 20:52:10 -0600
commit808bb1bd855799535a1b690865dc873793a37f7f (patch)
tree178d9bb00cccf12c11c6f7284dc66e0d6c8827ec /src/parser
parent9301607b58a3b74dcea73c500c6391d6a51093f8 (diff)
Embed mkAssociative utilities within the API. (#3801)
Towards parser/API migration.
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/parser.cpp16
-rw-r--r--src/parser/parser.h10
-rw-r--r--src/parser/smt2/smt2.cpp4
-rw-r--r--src/parser/tptp/tptp.cpp4
4 files changed, 2 insertions, 32 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 447fb5d76..663be7f1f 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -515,22 +515,6 @@ Expr Parser::mkHoApply(Expr expr, std::vector<Expr>& args)
return expr;
}
-api::Term Parser::mkChain(api::Kind k, const std::vector<api::Term>& args)
-{
- if (args.size() == 2)
- {
- // if this is the case exactly 1 pair will be generated so the
- // AND is not required
- return d_solver->mkTerm(k, args[0], args[1]);
- }
- std::vector<api::Term> children;
- for (size_t i = 0, nargsmo = args.size() - 1; i < nargsmo; i++)
- {
- children.push_back(d_solver->mkTerm(k, args[i], args[i + 1]));
- }
- return d_solver->mkTerm(api::AND, children);
-}
-
bool Parser::isDeclared(const std::string& name, SymbolType type) {
switch (type) {
case SYM_VARIABLE:
diff --git a/src/parser/parser.h b/src/parser/parser.h
index 0c1f3822b..8447eb4dc 100644
--- a/src/parser/parser.h
+++ b/src/parser/parser.h
@@ -678,16 +678,6 @@ public:
*/
Expr mkHoApply(Expr expr, std::vector<Expr>& args);
- /** make chain
- *
- * Given a kind k and argument terms t_1, ..., t_n, this returns the
- * conjunction of:
- * (k t_1 t_2) .... (k t_{n-1} t_n)
- * It is expected that k is a kind denoting a predicate, and args is a list
- * of terms of size >= 2 such that the terms above are well-typed.
- */
- api::Term mkChain(api::Kind k, const std::vector<api::Term>& args);
-
/**
* Add an operator to the current legal set.
*
diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp
index 7b7e9dd82..88d8b527b 100644
--- a/src/parser/smt2/smt2.cpp
+++ b/src/parser/smt2/smt2.cpp
@@ -1897,9 +1897,7 @@ Expr Smt2::applyParseOp(ParseOp& p, std::vector<Expr>& args)
|| kind == kind::LEQ || kind == kind::GEQ)
{
/* "chainable", but CVC4 internally only supports 2 args */
- api::Term ret =
- mkChain(intToExtKind(kind), api::exprVectorToTerms(args));
- return ret.getExpr();
+ return em->mkChain(kind, args);
}
}
diff --git a/src/parser/tptp/tptp.cpp b/src/parser/tptp/tptp.cpp
index bf699ae3c..2b1edf15b 100644
--- a/src/parser/tptp/tptp.cpp
+++ b/src/parser/tptp/tptp.cpp
@@ -326,9 +326,7 @@ Expr Tptp::applyParseOp(ParseOp& p, std::vector<Expr>& args)
|| kind == kind::LEQ || kind == kind::GEQ)
{
/* "chainable", but CVC4 internally only supports 2 args */
- api::Term ret =
- mkChain(intToExtKind(kind), api::exprVectorToTerms(args));
- return ret.getExpr();
+ return em->mkChain(kind, args);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback