Skip to content

Commit

Permalink
Fixes build
Browse files Browse the repository at this point in the history
  • Loading branch information
colder authored and manoskouk committed Jul 11, 2016
1 parent 5dc19d7 commit 2ae0979
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/leon/synthesis/rules/BottomUpTEGIS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import leon.grammars.aspects._
case object BottomUpTEGIS extends BottomUpTEGISLike("BU TEGIS") {
def getParams(sctx: SynthesisContext, p: Problem) = {
TegisParams(
grammar = Grammars.default(sctx, p),
grammar = grammars.default(sctx, p),
maxExpands = 4
)
}
Expand Down
23 changes: 12 additions & 11 deletions src/main/scala/leon/synthesis/rules/BottomUpTEGISLike.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ abstract class BottomUpTEGISLike(name: String) extends Rule(name) {
type Signature = Vector[Expr]

case class EqClass(sig: Signature, cand: Expr) {
def asString(target: Option[Signature] = None)(implicit ctx: LeonContext): String = {
def asString(implicit ctx: LeonContext): String = {

val hash = Integer.toHexString(sig.hashCode)

val isMatch = Some(sig) == target

val okSign = if (isMatch) "OK" else " "

f"${cand.asString}%-50s <- "+okSign+" "+debugSig(sig)
f"${cand.asString}%-50s <- "+debugSig(sig)
}
}

Expand Down Expand Up @@ -76,8 +72,6 @@ abstract class BottomUpTEGISLike(name: String) extends Rule(name) {
val examplesEnvs = examples.map { case InOutExample(is, os) => (p.as zip is).toMap }
val targetSign = examples.map { case InOutExample(_, os) => tupleWrap(os) }

//println("Looking for "+debugSig(targetSign))

val enum = new MemoizedEnumerator[Label, Expr, ProductionRule[Label, Expr]](grammar.getProductions)

val targetType = tupleTypeWrap(p.xs.map(_.getType))
Expand All @@ -91,20 +85,27 @@ abstract class BottomUpTEGISLike(name: String) extends Rule(name) {
for ((tpe, cs) <- classes) {
println(s"===== ${tpe.asString} =====")
for (c <- cs.values) {
println(s" - ${c.asString(Some(targetSign))}")
println(s" - ${c.asString}")
}
}
}

def findTargetSign(classes: Map[Signature, EqClass]): Option[EqClass] = {
classes.get(targetSign)
}

def expandAll(): Option[EqClass] = {
//println("#"*80)
//debugClasses()
//println("#"*80)

for (tpe <- classes.keys) {
expand(tpe)
if ((tpe == targetType) && (newClasses(tpe) contains targetSign)) {
return Some(newClasses(tpe)(targetSign))
if (tpe == targetType) {
findTargetSign(newClasses(tpe)) match {
case Some(cl) => return Some(cl)
case None =>
}
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/main/scala/leon/synthesis/rules/CEGIS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ case object CEGIS extends CEGISLike("CEGIS") {
def getParams(sctx: SynthesisContext, p: Problem) = {
val maxSize = sctx.settings.cegisMaxSize

val sizes0 = for (s <- 1 to maxSize by 3) yield {
(s, Math.min(s+2, maxSize), 4*s)
val sizesNew = for (s <- 1 to maxSize by 3) yield {
(s, Math.min(s+2, maxSize), s+2)
}

val sizes = List((1, maxSize, 0));


CegisParams(
grammar = grammars.default(sctx, p),
rootLabel = Label(_).withAspect(Tagged(Tags.Top, 0, None)),
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/leon/synthesis/rules/TEGIS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import leon.grammars.aspects._
case object TEGIS extends TEGISLike("TEGIS") {
def getParams(sctx: SynthesisContext, p: Problem) = {
TegisParams(
grammar = Grammars.default(sctx, p),
grammar = grammars.default(sctx, p),
rootLabel = Label(_).withAspect(Tagged(Tags.Top, 0, None)),
minSize = 1,
maxSize = 5
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/leon/synthesis/rules/unused/TEGLESS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ case object TEGLESS extends TEGISLike("TEGLESS") {
}

TegisParams(
grammar = Grammars.default(sctx, p),
grammar = grammars.default(sctx, p),
rootLabel = { (tpe: TypeTree) => Label(tpe).withAspect(DepthBound(2)).withAspect(SimilarTo(guides, sctx.functionContext)) },
minSize = 1,
maxSize = 5
Expand Down

0 comments on commit 2ae0979

Please sign in to comment.