Improve error for higher-order logic (#8207)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 3 Mar 2022 03:51:42 +0000 (21:51 -0600)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 03:51:42 +0000 (03:51 +0000)
Makes the error more informative when a higher-order function variable is encountered.
Fixes cvc5/cvc5-projects#450.

src/theory/uf/theory_uf.cpp

index 9058a57f3772d65d98c1355425c29d204cfc8407..e22698bc0b31b840d24eea9a85614c1026968bab 100644 (file)
@@ -221,7 +221,15 @@ TrustNode TheoryUF::ppRewrite(TNode node, std::vector<SkolemLemma>& lems)
     if (!isHol)
     {
       std::stringstream ss;
-      ss << "Partial function applications are only supported with "
+      if (k == kind::HO_APPLY)
+      {
+        ss << "Partial function applications";
+      }
+      else
+      {
+        ss << "Function variables";
+      }
+      ss << " are only supported with "
             "higher-order logic. Try adding the logic prefix HO_.";
       throw LogicException(ss.str());
     }