Skip to content
Snippets Groups Projects
Commit 07cee88d authored by Nicolas Voirol's avatar Nicolas Voirol
Browse files

More changed to accomodate stainless

parent fbbca114
Branches
Tags
No related merge requests found
...@@ -6,7 +6,7 @@ package ast ...@@ -6,7 +6,7 @@ package ast
import utils.Graphs._ import utils.Graphs._
trait CallGraph { trait CallGraph {
private[ast] val trees: Trees protected val trees: Trees
import trees._ import trees._
import trees.exprOps._ import trees.exprOps._
protected val symbols: Symbols protected val symbols: Symbols
......
...@@ -10,7 +10,7 @@ package ast ...@@ -10,7 +10,7 @@ package ast
* @define encodingof Encoding of * @define encodingof Encoding of
* */ * */
trait Constructors { trait Constructors {
private[ast] val trees: Trees protected val trees: Trees
import trees._ import trees._
import trees.exprOps._ import trees.exprOps._
protected implicit val symbols: Symbols protected implicit val symbols: Symbols
......
...@@ -96,7 +96,7 @@ trait Definitions { self: Trees => ...@@ -96,7 +96,7 @@ trait Definitions { self: Trees =>
val classes: Map[Identifier, ClassDef] val classes: Map[Identifier, ClassDef]
val functions: Map[Identifier, FunDef] val functions: Map[Identifier, FunDef]
private[ast] val trees: self.type = self protected val trees: self.type = self
protected val symbols: this.type = this protected val symbols: this.type = this
// @nv: this is a hack to reinject `this` into the set of implicits // @nv: this is a hack to reinject `this` into the set of implicits
......
...@@ -48,7 +48,7 @@ trait ExprOps extends GenTreeOps { ...@@ -48,7 +48,7 @@ trait ExprOps extends GenTreeOps {
case _ => None case _ => None
} (expr) } (expr)
object VariableExtractor { protected class VariableExtractor {
def unapply(e: Expr): Option[(Set[Variable], Set[Variable])] = e match { def unapply(e: Expr): Option[(Set[Variable], Set[Variable])] = e match {
case v: Variable => Some((Set(v), Set.empty)) case v: Variable => Some((Set(v), Set.empty))
case Let(vd, _, _) => Some((Set.empty, Set(vd.toVariable))) case Let(vd, _, _) => Some((Set.empty, Set(vd.toVariable)))
...@@ -59,6 +59,8 @@ trait ExprOps extends GenTreeOps { ...@@ -59,6 +59,8 @@ trait ExprOps extends GenTreeOps {
} }
} }
protected val VariableExtractor = new VariableExtractor
/** Returns the set of free variables in an expression */ /** Returns the set of free variables in an expression */
def variablesOf(expr: Expr): Set[Variable] = { def variablesOf(expr: Expr): Set[Variable] = {
fold[Set[Variable]] { case (e, subs) => fold[Set[Variable]] { case (e, subs) =>
......
...@@ -35,11 +35,11 @@ trait Trees ...@@ -35,11 +35,11 @@ trait Trees
override def toString = asString(PrinterOptions.fromContext(InoxContext.printNames)) override def toString = asString(PrinterOptions.fromContext(InoxContext.printNames))
} }
object exprOps extends { val exprOps: ExprOps { val trees: Trees.this.type } = new {
protected val trees: Trees.this.type = Trees.this protected val trees: Trees.this.type = Trees.this
} with ExprOps } with ExprOps
object dsl extends { val dsl: DSL { val trees: Trees.this.type } = new {
protected val trees: Trees.this.type = Trees.this protected val trees: Trees.this.type = Trees.this
} with DSL } with DSL
......
...@@ -4,7 +4,7 @@ package inox ...@@ -4,7 +4,7 @@ package inox
package ast package ast
trait TypeOps { trait TypeOps {
private[ast] val trees: Trees protected val trees: Trees
import trees._ import trees._
protected implicit val symbols: Symbols protected implicit val symbols: Symbols
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment