-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |