Skip to content
Snippets Groups Projects
Commit 16c5eabe authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Pretty print Raw Array

parent 859cfa88
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,23 @@
package leon
package solvers
import leon.purescala.{PrinterContext, PrettyPrintable}
import leon.purescala.PrinterHelpers._
import purescala.Types._
import purescala.Expressions._
// Corresponds to a smt map, not a leon/scala array
private[solvers] case class RawArrayType(from: TypeTree, to: TypeTree) extends TypeTree
private[solvers] case class RawArrayType(from: TypeTree, to: TypeTree) extends TypeTree with PrettyPrintable {
override def printWith(implicit pctx: PrinterContext): Unit = {
p"RawArrayType[$from, $to]"
}
}
// Corresponds to a raw array value, which is coerced to a Leon expr depending on target type (set/array)
private[solvers] case class RawArrayValue(keyTpe: TypeTree, elems: Map[Expr, Expr], default: Expr) extends Expr {
private[solvers] case class RawArrayValue(keyTpe: TypeTree, elems: Map[Expr, Expr], default: Expr) extends Expr with PrettyPrintable{
val getType = RawArrayType(keyTpe, default.getType)
override def printWith(implicit pctx: PrinterContext): Unit = {
p"RawArrayValue[$keyTpe](${nary(elems.toSeq, ", ")}, default = $default)"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment