Fix case of non-constant value for sygus sampling (#4051)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Fri, 13 Mar 2020 16:52:13 +0000 (11:52 -0500)
committerGitHub <noreply@github.com>
Fri, 13 Mar 2020 16:52:13 +0000 (09:52 -0700)
Fixes #4050.

src/theory/quantifiers/sygus_sampler.cpp

index 10af0d703a5af5c528323323d03fbe0129ae809b..d2c2a238019b6ece5b522483e7b6b6da3ed89680 100644 (file)
@@ -713,8 +713,12 @@ Node SygusSampler::getSygusRandomValue(TypeNode tn,
       Trace("sygus-sample-grammar") << "...returned " << ret << std::endl;
       ret = Rewriter::rewrite(ret);
       Trace("sygus-sample-grammar") << "...after rewrite " << ret << std::endl;
-      Assert(ret.isConst());
-      return ret;
+      // A rare case where we generate a non-constant value from constant
+      // leaves is (/ n 0).
+      if(ret.isConst())
+      {
+        return ret;
+      }
     }
   }
   Trace("sygus-sample-grammar") << "...resort to random value" << std::endl;