Skip to content

Commit

Permalink
concolic driver outline
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhan45 committed Nov 29, 2023
1 parent ff59cff commit 0e25181
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/main/scala/wasm/ConcolicDriver.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package gensym.wasm.concolicdriver

import gensym.wasm.concolicminiwasm._
import gensym.wasm.ast._
import gensym.wasm.symbolic._

import scala.collection.immutable.Queue
import scala.collection.mutable.{HashMap, HashSet}

object ConcolicDriver {
def condsToEnv(conds: List[Cond]): HashMap[Int, Value] = {
???
}

def negateCond(conds: List[Cond], i: Int): List[Cond] = {
???
}

def checkPCToFile(pc: List[Cond]): Unit = {
???
}

def exec(module: Module, mainFun: String, startEnv: HashMap[Int, Value]) = {
val worklist = Queue(startEnv)
// val visited = ???

def loop(worklist: Queue[HashMap[Int, Value]]): Unit = worklist match {
case Queue() => ()
case env +: rest => {
Evaluator.execWholeProgram(module, mainFun, env, (_endStack, _endSymStack, pathConds) => {
val newEnv = condsToEnv(pathConds)
val newWork = for (i <- 0 until pathConds.length) yield {
val newConds = negateCond(pathConds, i)
checkPCToFile(newConds)
condsToEnv(newConds)
}
loop(rest ++ newWork)
})
}
}

loop(worklist)
}
}

0 comments on commit 0e25181

Please sign in to comment.