@@ -5,13 +5,11 @@ import SSA.Experimental.Bits.Generalize.Basic
55
66namespace Generalize
77
8-
98open Lean
109open Lean.Meta
1110open Std.Sat
1211open Std.Tactic.BVDecide
1312
14-
1513structure ParsedBVExprState where
1614 maxFreeVarId : Nat
1715 numSymVars : Nat
@@ -110,13 +108,10 @@ partial def toBVExpr (expr : Expr) (targetWidth: Nat) : ParseBVExprM (Option (BV
110108 | BitVec.rotateRight _ innerExpr distanceExpr =>
111109 rotateReflection innerExpr distanceExpr BVUnOp.rotateRight
112110 | BitVec.zeroExtend _ nExpr vExpr =>
113- logInfo m! "matched zero extend: { vExpr} "
114111 let some n ← getNatValue? nExpr | return none
115- logInfo m! "vExpr: { vExpr} "
116112 let some v ← go vExpr | return none
117113 return some {bvExpr := GenBVExpr.zeroExtend n v.bvExpr, width := _}
118114 | BitVec.truncate _ nExpr vExpr =>
119- logInfo m! "matched truncate: { vExpr} "
120115 let some n ← getNatValue? nExpr | return none
121116 let some v ← go vExpr | return none
122117 return some {bvExpr := GenBVExpr.truncate n v.bvExpr, width := _}
@@ -205,7 +200,6 @@ partial def toBVExpr (expr : Expr) (targetWidth: Nat) : ParseBVExprM (Option (BV
205200 return some {bvExpr := GenBVExpr.const (BitVec.ofNat n v), width := n}
206201
207202 getBitVecValue? (e : Expr) : MetaM (Option ((n : Nat) × BitVec n)) := OptionT.run do
208- logInfo m! "parsing: { e} "
209203 match_expr e with
210204 | BitVec.ofNat nExpr vExpr =>
211205 let n ← getNatValue? nExpr
@@ -264,11 +258,11 @@ def parseExprs (lhsExpr rhsExpr : Expr) (targetWidth : Nat): ParseBVExprM (Optio
264258
265259 let rhs: ParsedBVExpr := {bvExpr := rhsRes.bvExpr, width := rhsRes.width, symVars := rhsSymVars, inputVars := rhsInputVars}
266260
267- logInfo m! "lhs width: { lhsRes.width} ; rhs width: { rhsRes.width} "
261+ trace[Generalize] m! "lhs width: { lhsRes.width} ; rhs width: { rhsRes.width} "
268262 if h : lhsRes.width = rhsRes.width then
269263 let rhsExpr := h ▸ rhsRes.bvExpr
270264 let bvLogicalExpr := BoolExpr.literal (GenBVPred.bin lhsRes.bvExpr BVBinPred.eq rhsExpr)
271- logInfo m! "BVLogicalExpr: { bvLogicalExpr} "
265+ trace[Generalize] m! "BVLogicalExpr: { bvLogicalExpr} "
272266
273267 return some {lhs := lhs, rhs := rhs, state := state, bvLogicalExpr := bvLogicalExpr}
274268
0 commit comments