From 4b6621be20b90f9caf5847886ddf7fb62f2add5d Mon Sep 17 00:00:00 2001 From: Haniel Barbosa Date: Wed, 23 Jun 2021 17:01:13 -0300 Subject: [PATCH] [parser] [hol] Fix parser check for allowing functions when HOL is enabled (#6790) Fixes #6526 --- src/parser/smt2/smt2.cpp | 5 +++-- test/regress/CMakeLists.txt | 1 + test/regress/regress0/ho/issue6526.smt2 | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/regress/regress0/ho/issue6526.smt2 diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp index 282b72974..8c011aece 100644 --- a/src/parser/smt2/smt2.cpp +++ b/src/parser/smt2/smt2.cpp @@ -764,12 +764,13 @@ void Smt2::checkLogicAllowsFreeSorts() void Smt2::checkLogicAllowsFunctions() { - if (!d_logic.isTheoryEnabled(theory::THEORY_UF)) + if (!d_logic.isTheoryEnabled(theory::THEORY_UF) && !isHoEnabled()) { parseError( "Functions (of non-zero arity) cannot " "be declared in logic " - + d_logic.getLogicString() + ". Try adding the prefix HO_."); + + d_logic.getLogicString() + + ". Try including UF or adding the prefix HO_."); } } diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 6706ed4f6..53e050191 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -632,6 +632,7 @@ set(regress_0_tests regress0/ho/issue4477.smt2 regress0/ho/issue4990-care-graph.smt2 regress0/ho/issue5233-part1-usort-owner.smt2 + regress0/ho/issue6526.smt2 regress0/ho/ite-apply-eq.smt2 regress0/ho/lambda-equality-non-canon.smt2 regress0/ho/match-middle.smt2 diff --git a/test/regress/regress0/ho/issue6526.smt2 b/test/regress/regress0/ho/issue6526.smt2 new file mode 100644 index 000000000..07dfbc0d3 --- /dev/null +++ b/test/regress/regress0/ho/issue6526.smt2 @@ -0,0 +1,5 @@ +; COMMAND-LINE: +; EXPECT: sat +(set-logic HO_NIA) +(declare-fun x (Int) Bool) +(check-sat) \ No newline at end of file -- 2.30.2