Skip to content
Snippets Groups Projects
Commit 7b47a7f4 authored by Mikaël Mayer's avatar Mikaël Mayer
Browse files

removed printlns

parent 2469461b
Branches
Tags
No related merge requests found
...@@ -15,34 +15,16 @@ trait RecContext[RC <: RecContext[RC]] { ...@@ -15,34 +15,16 @@ trait RecContext[RC <: RecContext[RC]] {
def newVars(news: Map[Identifier, Expr]): RC def newVars(news: Map[Identifier, Expr]): RC
def withNewVar(id: Identifier, v: Expr): RC = { def withNewVar(id: Identifier, v: Expr): RC = {
if(!purescala.ExprOps.isValue(v)) {
println(s"Trying to add $id -> $v in context butnot a value")
println(Thread.currentThread().getStackTrace.map(_.toString).mkString("\n"))
System.exit(0)
}
newVars(mappings + (id -> v)) newVars(mappings + (id -> v))
} }
def withNewVars(news: Map[Identifier, Expr]): RC = { def withNewVars(news: Map[Identifier, Expr]): RC = {
if(news.exists{ case (k, v) => !purescala.ExprOps.isValue(v) }) {
println(s"Trying to add $news in context but not a value")
println(Thread.currentThread().getStackTrace.map(_.toString).mkString("\n"))
System.exit(0)
}
newVars(mappings ++ news) newVars(mappings ++ news)
} }
} }
case class DefaultRecContext(mappings: Map[Identifier, Expr]) extends RecContext[DefaultRecContext] { case class DefaultRecContext(mappings: Map[Identifier, Expr]) extends RecContext[DefaultRecContext] {
def newVars(news: Map[Identifier, Expr]) = copy(news) def newVars(news: Map[Identifier, Expr]) = copy(news)
mappings.find{ case (k, v) => !purescala.ExprOps.isValue(v) } match {
case None =>
case Some(a) =>
println(s"Trying to add $mappings in context but $a has not a value as second argument (of type ${a._2.getType}) and class ${a._2.getClass} because ${purescala.ExprOps.msgs}")
println(Thread.currentThread().getStackTrace.map(_.toString).mkString("\n"))
System.exit(0)
}
} }
class GlobalContext(val model: Model, val maxSteps: Int, val check: Boolean) { class GlobalContext(val model: Model, val maxSteps: Int, val check: Boolean) {
......
...@@ -66,7 +66,7 @@ case object Focus extends PreprocessingRule("Focus") { ...@@ -66,7 +66,7 @@ case object Focus extends PreprocessingRule("Focus") {
def existsFailing(e: Expr, env: Map[Identifier, Expr], evaluator: DeterministicEvaluator): Boolean = { def existsFailing(e: Expr, env: Map[Identifier, Expr], evaluator: DeterministicEvaluator): Boolean = {
p.eb.invalids.exists { ex => p.eb.invalids.exists { ex =>
evaluator.evalEnvExpr(e, (p.as zip ex.ins).toMap ++ env) match { evaluator.evalEnvExpr(e, (p.as zip ex.ins).toMap ++ env).result match {
case Some(BooleanLiteral(b)) => b case Some(BooleanLiteral(b)) => b
case _ => true case _ => true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment