Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreistefanescu committed Jan 10, 2024
1 parent 103e302 commit 21e9e00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions symbolic/src/Data/Macaw/Symbolic/MemOps.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{-# Language PatternSynonyms #-}
{-# Language TypeApplications #-}
{-# Language PatternGuards #-}
{-# LANGUAGE OverloadedStrings #-}
module Data.Macaw.Symbolic.MemOps
( PtrOp
, GlobalMap(..)
Expand Down Expand Up @@ -855,6 +856,8 @@ doPtrLt = ptrOp $ \bak mem w xPtr xBits yPtr yBits x y ->
undef <- mkUndefinedBool sym "ptr_lt"
res <- bvUlt sym (asBits x) (asBits y)
itePred sym ok res undef
-- assert bak ok "ptr_lt"
-- return res


doPtrLeq :: PtrOp sym w (RegValue sym BoolType)
Expand All @@ -870,6 +873,8 @@ doPtrLeq = ptrOp $ \bak mem w xPtr xBits yPtr yBits x y ->
undef <- mkUndefinedBool sym "ptr_leq"
res <- bvUle sym (asBits x) (asBits y)
itePred sym ok res undef
-- assert bak ok "ptr_leq"
-- return res


doPtrEq :: PtrOp sym w (RegValue sym BoolType)
Expand All @@ -883,6 +888,7 @@ doPtrEq = ptrOp $ \bak _mem w xPtr xBits yPtr yBits x y ->
undef <- mkUndefinedBool sym "ptr_eq"
let nw = M.addrWidthNatRepr w
cases bak (binOpLabel "ptr_eq" x y) itePred (Just undef)
-- cases bak (binOpLabel "ptr_eq" x y) itePred Nothing
[ both_bits ~> endCase =<< bvEq sym (asBits x) (asBits y)
, both_ptrs ~> endCase =<< ptrEq sym nw x y
, both_null ~> endCase (truePred sym)
Expand Down

0 comments on commit 21e9e00

Please sign in to comment.