Skip to content

Commit

Permalink
ccmp and rpo sort
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Nov 13, 2024
1 parent 08af7a3 commit d3b8176
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 132 deletions.
5 changes: 4 additions & 1 deletion src/main/scala/ir/Program.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class ProgramThread(val entry: Procedure,
*/

class Procedure private (
var name: String,
var procName: String,
var address: Option[BigInt],
private var _entryBlock: Option[Block],
private var _returnBlock: Option[Block],
Expand All @@ -188,6 +188,9 @@ class Procedure private (
var requires: List[BExpr],
var ensures: List[BExpr],
) extends Iterable[CFGPosition] {

def name = procName + address.map("_" + _).getOrElse("")

private val _callers = mutable.HashSet[DirectCall]()
_blocks.foreach(_.parent = this)
// class invariant
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ir/Visitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class Renamer(reserved: Set[String]) extends Visitor {

override def visitProcedure(node: Procedure): Procedure = {
if (reserved.contains(node.name)) {
node.name = s"#${node.name}"
node.procName = s"#${node.name}"
}
super.visitProcedure(node)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ir/eval/ExprEval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def evalBVBinExpr(b: BVBinOp, l: BitVecLiteral, r: BitVecLiteral): BitVecLiteral

def evalBVLogBinExpr(b: BVBinOp, l: BitVecLiteral, r: BitVecLiteral): Boolean = b match {
case BVULE => BitVectorEval.smt_bvule(l, r)
case BVUGT => BitVectorEval.smt_bvult(l, r)
case BVUGT => BitVectorEval.smt_bvugt(l, r)
case BVUGE => BitVectorEval.smt_bvuge(l, r)
case BVULT => BitVectorEval.smt_bvult(l, r)
case BVSLT => BitVectorEval.smt_bvslt(l, r)
Expand Down
Loading

0 comments on commit d3b8176

Please sign in to comment.