From 59dfa76e4fc82ae8bd9f922a040c8b67a5418f68 Mon Sep 17 00:00:00 2001
From: Etienne Kneuss <ekneuss@gmail.com>
Date: Wed, 15 Apr 2015 01:22:11 +0200
Subject: [PATCH] Let's have one int constant that is "weird" enough

The reasonning is that when generating tests, we want  tests for when
the elements do not matter too much.

For instance, if we want tests for choose (x => x == a), and we only
have the test a = 0, then a+a will pass the test, 42 is less likely to
cause these.
---
 src/main/scala/leon/synthesis/rules/CEGISLike.scala         | 4 +---
 src/main/scala/leon/synthesis/utils/ExpressionGrammar.scala | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/scala/leon/synthesis/rules/CEGISLike.scala b/src/main/scala/leon/synthesis/rules/CEGISLike.scala
index 53303b4a4..96c28f234 100644
--- a/src/main/scala/leon/synthesis/rules/CEGISLike.scala
+++ b/src/main/scala/leon/synthesis/rules/CEGISLike.scala
@@ -316,13 +316,11 @@ abstract class CEGISLike[T <% Typed](name: String) extends Rule(name) {
             None
         }(cTree))
 
-        val evalParams = CodeGenParams.default
-
         //println("-- "*30)
         //println(programCTree)
         //println(".. "*30)
 
-        val evaluator  = new DualEvaluator(sctx.context, programCTree, evalParams)
+        val evaluator  = new DualEvaluator(sctx.context, programCTree, CodeGenParams.default)
 
 
         tester =
diff --git a/src/main/scala/leon/synthesis/utils/ExpressionGrammar.scala b/src/main/scala/leon/synthesis/utils/ExpressionGrammar.scala
index 5839f5bf5..5244c6d4d 100644
--- a/src/main/scala/leon/synthesis/utils/ExpressionGrammar.scala
+++ b/src/main/scala/leon/synthesis/utils/ExpressionGrammar.scala
@@ -150,13 +150,13 @@ object ExpressionGrammars {
         List(
           Generator(Nil, { _ => IntLiteral(0) }),
           Generator(Nil, { _ => IntLiteral(1) }),
-          Generator(Nil, { _ => IntLiteral(-1) })
+          Generator(Nil, { _ => IntLiteral(42) })
         )
       case IntegerType =>
         List(
           Generator(Nil, { _ => InfiniteIntegerLiteral(0) }),
           Generator(Nil, { _ => InfiniteIntegerLiteral(1) }),
-          Generator(Nil, { _ => InfiniteIntegerLiteral(-1) })
+          Generator(Nil, { _ => InfiniteIntegerLiteral(42) })
         )
 
       case tp@TypeParameter(_) =>
-- 
GitLab