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

removed printlns

parent 2469461b
No related branches found
No related tags found
No related merge requests found
......@@ -15,34 +15,16 @@ trait RecContext[RC <: RecContext[RC]] {
def newVars(news: Map[Identifier, 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))
}
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)
}
}
case class DefaultRecContext(mappings: Map[Identifier, Expr]) extends RecContext[DefaultRecContext] {
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) {
......
......@@ -66,7 +66,7 @@ case object Focus extends PreprocessingRule("Focus") {
def existsFailing(e: Expr, env: Map[Identifier, Expr], evaluator: DeterministicEvaluator): Boolean = {
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 _ => true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment