From 8188f6d963f09df7ccd0ce838950e450f025fa3e Mon Sep 17 00:00:00 2001
From: Etienne Kneuss <ekneuss@gmail.com>
Date: Thu, 13 Dec 2012 17:52:30 +0100
Subject: [PATCH] Report better errors

---
 src/main/scala/leon/synthesis/SynthesisPhase.scala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/scala/leon/synthesis/SynthesisPhase.scala b/src/main/scala/leon/synthesis/SynthesisPhase.scala
index 028c7dcdd..3e03d9a14 100644
--- a/src/main/scala/leon/synthesis/SynthesisPhase.scala
+++ b/src/main/scala/leon/synthesis/SynthesisPhase.scala
@@ -45,7 +45,12 @@ object SynthesisPhase extends LeonPhase[Program, Program] {
           case Some(model) =>
             options = options.copy(costModel = model)
           case None =>
-            ctx.reporter.fatalError("Unknown cost model: "+cm)
+
+            val errorMsg = "Unknown cost model: " + cm + "\n" +
+                           "Defined cost models: \n" +
+                           (CostModel.all.map(_.name).mkString("  - ", "\n  - ", ""))
+
+            ctx.reporter.fatalError(errorMsg)
         }
       case v @ LeonValueOption("timeout", _) =>
         v.asInt(ctx).foreach { t =>
-- 
GitLab