From 081c1f1d3ae01b1a237ab0f7cacdf04eecf71793 Mon Sep 17 00:00:00 2001 From: Gerard Basler Date: Mon, 2 Mar 2015 04:22:02 +0100 Subject: Add a check to ensure that if the formulas originating from the exhaustivity / reachability analysis are too big to be solved in reasonable time, then we skip the analysis. I also cleaned up warnings. Why did `t9181.scala` work fine with 2.11.4, but is now running out of memory? In order to ensure that the scrutinee is associated only with one of the 400 derived classes we add 400*400 / 2 ~ 80k clauses to ensure mutual exclusivity. In 2.11.4 the translation into CNF used to fail, since it would blow up already at this point in memory. This has been fixed in 2.11.5, but now the DPLL solver is the bottleneck. There's a check in the search for all models (exhaustivity) that it would avoid a blow up, but in the search for a model (reachability), such a check is missing. --- test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/junit') diff --git a/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala b/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala index 1fff9c9a32..1fe7b19056 100644 --- a/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala +++ b/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala @@ -6,6 +6,7 @@ import org.junit.runner.RunWith import org.junit.runners.JUnit4 import scala.collection.mutable +import scala.reflect.internal.util.Position import scala.tools.nsc.{Global, Settings} object TestSolver extends Logic with Solving { @@ -72,6 +73,8 @@ object TestSolver extends Logic with Solving { def prepareNewAnalysis() = {} + def uncheckedWarning(pos: Position, msg: String) = sys.error(msg) + def reportWarning(msg: String) = sys.error(msg) /** -- cgit v1.2.3