mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-29 00:59:09 +03:00
adding two finsets, get a finset
This commit is contained in:
parent
d0d30f038d
commit
fa96a062e1
@ -614,6 +614,15 @@ bvadc w (FinSet t) (StackOffset a s) c
|
|||||||
, BoolConst b <- c
|
, BoolConst b <- c
|
||||||
, o <- if b then o0 + 1 else o0 =
|
, o <- if b then o0 + 1 else o0 =
|
||||||
StackOffset a $ Set.map (fromInteger . addOff w o . toInteger) s
|
StackOffset a $ Set.map (fromInteger . addOff w o . toInteger) s
|
||||||
|
-- Two finite sets
|
||||||
|
bvadc w (FinSet l) (FinSet r) (BoolConst b)
|
||||||
|
| ls <- Set.toList l
|
||||||
|
, rs <- Set.toList r
|
||||||
|
= case Set.fromList [bottomBits $ lval+rval+if b then 1 else 0 | lval <- ls, rval <- rs] of
|
||||||
|
s | Set.size s <= maxSetSize -> FinSet s
|
||||||
|
_ -> TopV
|
||||||
|
where
|
||||||
|
bottomBits v = v .&. (bit (fromInteger (natValue w)) - 1)
|
||||||
-- Strided intervals
|
-- Strided intervals
|
||||||
bvadc w v v' c
|
bvadc w v v' c
|
||||||
| StridedInterval si1 <- v, StridedInterval si2 <- v' = go si1 si2
|
| StridedInterval si1 <- v, StridedInterval si2 <- v' = go si1 si2
|
||||||
|
Loading…
Reference in New Issue
Block a user