Fix corner case of interpolants from conjectures with no free variables (#8853)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Sat, 4 Jun 2022 23:27:22 +0000 (18:27 -0500)
committerGitHub <noreply@github.com>
Sat, 4 Jun 2022 23:27:22 +0000 (23:27 +0000)
Fixes #8852.

src/theory/quantifiers/sygus/sygus_interpol.cpp
test/regress/cli/CMakeLists.txt
test/regress/cli/regress1/issue8852-interpol-no-var.smt2 [new file with mode: 0644]

index 8ce073b93fc488dc2bddac0a6c495ff34186803b..7230e0ce6507777551e0f72efc073d52c448eccd 100644 (file)
@@ -296,7 +296,11 @@ bool SygusInterpol::findInterpol(SolverEngine* subSolver,
 
   // get the grammar type for the interpolant
   Node igdtbv = itp.getAttribute(SygusSynthFunVarListAttribute());
-  Assert(!igdtbv.isNull());
+  // could have no variables, in which case there is nothing to do
+  if (igdtbv.isNull())
+  {
+    return true;
+  }
   Assert(igdtbv.getKind() == kind::BOUND_VAR_LIST);
   // convert back to original
   // must replace formal arguments of itp with the free variables in the
index d13f8ba78d99f05b2fab9c9cc677db8a9c239091..2e961af07406c3c0430e30e585123484cf16bf5b 100644 (file)
@@ -1997,6 +1997,7 @@ set(regress_1_tests
   regress1/issue5739-rtf-processed.smt2
   regress1/issue7902-abd-subsolver-uc.smt2
   regress1/issue7937-difficulty-irr.smt2
+  regress1/issue8852-interpol-no-var.smt2
   regress1/lemmas/clocksynchro_5clocks.main_invar.base.smtv1.smt2
   regress1/lemmas/pursuit-safety-8.smtv1.smt2
   regress1/minimal_unsat_core.smt2
diff --git a/test/regress/cli/regress1/issue8852-interpol-no-var.smt2 b/test/regress/cli/regress1/issue8852-interpol-no-var.smt2
new file mode 100644 (file)
index 0000000..cf5e032
--- /dev/null
@@ -0,0 +1,6 @@
+; COMMAND-LINE: --produce-interpolants
+; EXPECT: (define-fun A () Bool false)
+(set-logic ALL)
+(declare-fun a () Int)
+(assert (<= 1 0))
+(get-interpolant A (> a 0))