@@ -58,6 +58,8 @@ import EVM.Effects
5858import EVM.Format as Format
5959import EVM.Traversals
6060
61+ import Debug.Trace
62+
6163type family ExprType a where
6264 ExprType 'AInteger = EVM. EWord
6365 ExprType 'ABoolean = EVM. EWord
@@ -234,7 +236,7 @@ translateBehv cmap (Behaviour _ _ _ _ preconds caseconds _ upds ret) = do
234236 cmap' <- applyUpdates cmap cmap upds
235237 fresh' <- getFresh
236238 let acmap = abstractCmap initAddr cmap'
237- pure (simplify $ EVM. Success (preconds' <> caseconds' <> symAddrCnstr (fresh+ 1 ) fresh') mempty ret' (M. map fst cmap'), acmap)
239+ pure (EVM. Success (preconds' <> caseconds' <> symAddrCnstr (fresh+ 1 ) fresh') mempty ret' (M. map fst cmap'), acmap)
238240
239241applyUpdates :: Monad m => ContractMap -> ContractMap -> [StorageUpdate ] -> ActT m ContractMap
240242applyUpdates readMap writeMap upds = foldM (applyUpdate readMap) writeMap upds
@@ -427,7 +429,7 @@ expToBuf cmap styp e = do
427429 pure $ EVM. WriteWord (EVM. Lit 0 ) e' (EVM. ConcreteBuf " " )
428430 SBoolean -> do
429431 e' <- toExpr cmap e
430- pure $ EVM. WriteWord (EVM. Lit 0 ) e' (EVM. ConcreteBuf " " )
432+ pure $ EVM. WriteWord (EVM. Lit 0 ) ( EVM. IsZero $ EVM. IsZero e') (EVM. ConcreteBuf " " )
431433 SByteStr -> toExpr cmap e
432434
433435-- | Get the slot and the offset of a storage variable in storage
@@ -791,6 +793,13 @@ checkBehaviours solvers (Contract _ behvs) actstorage = do
791793
792794 solbehvs <- lift $ removeFails <$> getRuntimeBranches solvers hevmstorage calldata fresh
793795
796+
797+ -- when (name == "setg") (do
798+ -- traceM "Act behvs:"
799+ -- traceM $ showBehvs behvs'
800+ -- traceM "Sol behvs:"
801+ -- traceM $ showBehvs solbehvs)
802+
794803 lift $ showMsg $ " \x1b [1mChecking behavior \x1b [4m" <> name <> " \x1b [m of Act\x1b [m"
795804 -- equivalence check
796805 lift $ showMsg " \x1b [1mChecking if behaviour is matched by EVM\x1b [m"
0 commit comments