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

Add CollectorWithPC constructor

parent a3d1a433
No related branches found
No related tags found
No related merge requests found
/* Copyright 2009-2016 EPFL, Lausanne */
package inox
package transformers
/** A [[Collector]] that collects path conditions */
trait CollectorWithPC extends TransformerWithPC with Collector
object CollectorWithPC {
def apply[T](p: Program)(f: PartialFunction[(p.trees.Expr, p.symbols.Path), T]) = {
new CollectorWithPC {
type R = T
val trees: p.trees.type = p.trees
val symbols: p.symbols.type = p.symbols
import trees.Expr
import symbols.Path
val initEnv: Path = Path.empty
protected def step(e: Expr, env: Path): List[(T, Path)] = {
f.lift((e, env)).map((_, env)).toList
}
}
}
}
......@@ -95,6 +95,3 @@ trait TransformerWithPC extends Transformer {
}
}
/** A [[Collector]] that collects path conditions */
trait CollectorWithPC extends TransformerWithPC with Collector
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment