mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-17 13:01:31 +03:00
More precise rule for k >= width var
interval derivation
This commit is contained in:
parent
5a43c1d1fe
commit
576df9fa95
@ -125,18 +125,18 @@ propInterval varInts prop = catMaybes
|
||||
-- k >= width x
|
||||
, do (l,r) <- pIsGeq prop
|
||||
x <- tIsVar =<< pIsWidth r
|
||||
let int = typeInterval varInts l
|
||||
|
||||
-- record the exact upper bound when it produces values within 128
|
||||
-- bits
|
||||
ub = case iUpper int of
|
||||
let ub = case iIsExact (typeInterval varInts l) of
|
||||
Just (Nat val) | val < 128 -> Just (Nat (2 ^ val - 1))
|
||||
| otherwise -> Nothing
|
||||
_ -> iUpper int
|
||||
upper -> upper
|
||||
|
||||
return (x, Interval { iLower = Nat 0, iUpper = ub })
|
||||
|
||||
]
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
data Interval = Interval
|
||||
|
Loading…
Reference in New Issue
Block a user