grisette-0.11.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2021-2024
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Grisette.Internal.Core.Data.Class.SafeDiv

Description

 
Synopsis

Documentation

data ArithException #

Arithmetic exceptions.

Instances

Instances details
Exception ArithException

@since base-4.0.0.0

Instance details

Defined in GHC.Internal.Exception.Type

Show ArithException

@since base-4.0.0.0

Instance details

Defined in GHC.Internal.Exception.Type

Eq ArithException

@since base-3.0

Instance details

Defined in GHC.Internal.Exception.Type

Ord ArithException

@since base-3.0

Instance details

Defined in GHC.Internal.Exception.Type

Mergeable ArithException Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.Mergeable

TransformError ArithException AssertionError Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.Error

(MonadError ArithException m, TryMerge m) => SafeFdiv ArithException AlgReal m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeFdiv

(MonadError ArithException m, MonadUnion m) => SafeFdiv ArithException SymAlgReal m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeFdiv

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Int16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Int32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Int64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Int8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: Int8 -> Int8 -> m Int8 Source #

safeNeg :: Int8 -> m Int8 Source #

safeSub :: Int8 -> Int8 -> m Int8 Source #

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Word16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Word32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Word64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Word8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException SymInteger m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Integer m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Int m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: Int -> Int -> m Int Source #

safeNeg :: Int -> m Int Source #

safeSub :: Int -> Int -> m Int Source #

(MonadError ArithException m, TryMerge m) => SafeLinearArith ArithException Word m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: Word -> Word -> m Word Source #

safeNeg :: Word -> m Word Source #

safeSub :: Word -> Word -> m Word Source #

(MonadError ArithException m, MonadUnion m) => SafeLogBase ArithException SymAlgReal m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLogBase

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Int16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Int32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Int64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Int8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Word16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Word32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Word64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Word8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Int m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymRotate ArithException Word m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Int16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Int32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Int64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Int8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Word16 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Word32 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Word64 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Word8 m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Int m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeSymShift ArithException Word m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int16 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int32 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int64 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int8 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word16 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word32 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word64 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word8 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadUnion m, MonadError ArithException m) => SafeDiv ArithException SymInteger m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Integer m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: Int -> Int -> m Int Source #

safeMod :: Int -> Int -> m Int Source #

safeDivMod :: Int -> Int -> m (Int, Int) Source #

safeQuot :: Int -> Int -> m Int Source #

safeRem :: Int -> Int -> m Int Source #

safeQuotRem :: Int -> Int -> m (Int, Int) Source #

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, UnifiedBranching 'S m) => UnifiedSafeDiv 'S ArithException SymInteger m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError ArithException m, UnifiedBranching mode m) => UnifiedSafeDiv mode ArithException Integer m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError ArithException m, UnifiedBranching 'S m) => UnifiedSafeFdiv 'S ArithException SymAlgReal m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFdiv

(MonadError ArithException m, UnifiedBranching mode m) => UnifiedSafeFdiv mode ArithException AlgReal m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFdiv

(MonadError ArithException m, UnifiedBranching 'S m) => UnifiedSafeLinearArith 'S ArithException SymInteger m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching mode m) => UnifiedSafeLinearArith mode ArithException Integer m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeDiv 'S ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeDiv 'S ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeDiv mode ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

Methods

withBaseSafeDiv :: (SafeDiv ArithException (IntN n) m => r) -> r Source #

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeDiv mode ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

Methods

withBaseSafeDiv :: (SafeDiv ArithException (WordN n) m => r) -> r Source #

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeLinearArith 'S ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeLinearArith 'S ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeLinearArith mode ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeLinearArith mode ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeSymRotate 'S ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeSymRotate 'S ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeSymRotate mode ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeSymRotate mode ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeSymShift 'S ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError ArithException m, UnifiedBranching 'S m, KnownNat n, 1 <= n) => UnifiedSafeSymShift 'S ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeSymShift mode ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError ArithException m, UnifiedBranching mode m, KnownNat n, 1 <= n) => UnifiedSafeSymShift mode ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeLinearArith ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: IntN n -> IntN n -> m (IntN n) Source #

safeNeg :: IntN n -> m (IntN n) Source #

safeSub :: IntN n -> IntN n -> m (IntN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeLinearArith ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: WordN n -> WordN n -> m (WordN n) Source #

safeNeg :: WordN n -> m (WordN n) Source #

safeSub :: WordN n -> WordN n -> m (WordN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeLinearArith ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeNeg :: SymIntN n -> m (SymIntN n) Source #

safeSub :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeLinearArith ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeLinearArith

Methods

safeAdd :: SymWordN n -> SymWordN n -> m (SymWordN n) Source #

safeNeg :: SymWordN n -> m (SymWordN n) Source #

safeSub :: SymWordN n -> SymWordN n -> m (SymWordN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeSymRotate ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

Methods

safeSymRotateL :: IntN n -> IntN n -> m (IntN n) Source #

safeSymRotateR :: IntN n -> IntN n -> m (IntN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeSymRotate ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

Methods

safeSymRotateL :: WordN n -> WordN n -> m (WordN n) Source #

safeSymRotateR :: WordN n -> WordN n -> m (WordN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeSymRotate ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeSymRotate ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymRotate

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeSymShift ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

Methods

safeSymShiftL :: IntN n -> IntN n -> m (IntN n) Source #

safeSymShiftR :: IntN n -> IntN n -> m (IntN n) Source #

safeSymStrictShiftL :: IntN n -> IntN n -> m (IntN n) Source #

safeSymStrictShiftR :: IntN n -> IntN n -> m (IntN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeSymShift ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

Methods

safeSymShiftL :: WordN n -> WordN n -> m (WordN n) Source #

safeSymShiftR :: WordN n -> WordN n -> m (WordN n) Source #

safeSymStrictShiftL :: WordN n -> WordN n -> m (WordN n) Source #

safeSymStrictShiftR :: WordN n -> WordN n -> m (WordN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeSymShift ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeSymShift ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Core.Data.Class.SafeSymShift

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeDiv ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: IntN n -> IntN n -> m (IntN n) Source #

safeMod :: IntN n -> IntN n -> m (IntN n) Source #

safeDivMod :: IntN n -> IntN n -> m (IntN n, IntN n) Source #

safeQuot :: IntN n -> IntN n -> m (IntN n) Source #

safeRem :: IntN n -> IntN n -> m (IntN n) Source #

safeQuotRem :: IntN n -> IntN n -> m (IntN n, IntN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeDiv ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: WordN n -> WordN n -> m (WordN n) Source #

safeMod :: WordN n -> WordN n -> m (WordN n) Source #

safeDivMod :: WordN n -> WordN n -> m (WordN n, WordN n) Source #

safeQuot :: WordN n -> WordN n -> m (WordN n) Source #

safeRem :: WordN n -> WordN n -> m (WordN n) Source #

safeQuotRem :: WordN n -> WordN n -> m (WordN n, WordN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeDiv ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeMod :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeDivMod :: SymIntN n -> SymIntN n -> m (SymIntN n, SymIntN n) Source #

safeQuot :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeRem :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeQuotRem :: SymIntN n -> SymIntN n -> m (SymIntN n, SymIntN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeDiv ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeDiv 'S (Either SomeBVException ArithException) SomeSymIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeDiv 'S (Either SomeBVException ArithException) SomeSymWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeDiv mode (Either SomeBVException ArithException) SomeIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeDiv mode (Either SomeBVException ArithException) SomeWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeDiv

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeLinearArith 'S (Either SomeBVException ArithException) SomeSymIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeLinearArith 'S (Either SomeBVException ArithException) SomeSymWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeLinearArith mode (Either SomeBVException ArithException) SomeIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeLinearArith mode (Either SomeBVException ArithException) SomeWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeLinearArith

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeSymRotate 'S (Either SomeBVException ArithException) SomeSymIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeSymRotate 'S (Either SomeBVException ArithException) SomeSymWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeSymRotate mode (Either SomeBVException ArithException) SomeIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeSymRotate mode (Either SomeBVException ArithException) SomeWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymRotate

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeSymShift 'S (Either SomeBVException ArithException) SomeSymIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching 'S m) => UnifiedSafeSymShift 'S (Either SomeBVException ArithException) SomeSymWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeSymShift mode (Either SomeBVException ArithException) SomeIntN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

(MonadError (Either SomeBVException ArithException) m, UnifiedBranching mode m) => UnifiedSafeSymShift mode (Either SomeBVException ArithException) SomeWordN m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeSymShift

class (MonadError e m, TryMerge m, Mergeable a, DivOr a) => SafeDiv e a (m :: Type -> Type) where Source #

Safe division with monadic error handling in multi-path execution. These procedures throw an exception when the divisor is zero. The result should be able to handle errors with MonadError.

Minimal complete definition

(safeDiv, safeMod | safeDivMod), (safeQuot, safeRem | safeQuotRem)

Methods

safeDiv :: a -> a -> m a Source #

Safe div with monadic error handling in multi-path execution.

>>> safeDiv "a" "b" :: ExceptT ArithException Union SymInteger
ExceptT {If (= b 0) (Left divide by zero) (Right (div a b))}

safeMod :: a -> a -> m a Source #

Safe mod with monadic error handling in multi-path execution.

>>> safeMod "a" "b" :: ExceptT ArithException Union SymInteger
ExceptT {If (= b 0) (Left divide by zero) (Right (mod a b))}

safeDivMod :: a -> a -> m (a, a) Source #

Safe divMod with monadic error handling in multi-path execution.

>>> safeDivMod "a" "b" :: ExceptT ArithException Union (SymInteger, SymInteger)
ExceptT {If (= b 0) (Left divide by zero) (Right ((div a b),(mod a b)))}

safeQuot :: a -> a -> m a Source #

Safe quot with monadic error handling in multi-path execution.

safeRem :: a -> a -> m a Source #

Safe rem with monadic error handling in multi-path execution.

safeQuotRem :: a -> a -> m (a, a) Source #

Safe quotRem with monadic error handling in multi-path execution.

Instances

Instances details
(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int16 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int32 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int64 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int8 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word16 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word32 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word64 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word8 m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadUnion m, MonadError ArithException m) => SafeDiv ArithException SymInteger m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Integer m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Int m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: Int -> Int -> m Int Source #

safeMod :: Int -> Int -> m Int Source #

safeDivMod :: Int -> Int -> m (Int, Int) Source #

safeQuot :: Int -> Int -> m Int Source #

safeRem :: Int -> Int -> m Int Source #

safeQuotRem :: Int -> Int -> m (Int, Int) Source #

(MonadError ArithException m, TryMerge m) => SafeDiv ArithException Word m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeDiv ArithException (IntN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: IntN n -> IntN n -> m (IntN n) Source #

safeMod :: IntN n -> IntN n -> m (IntN n) Source #

safeDivMod :: IntN n -> IntN n -> m (IntN n, IntN n) Source #

safeQuot :: IntN n -> IntN n -> m (IntN n) Source #

safeRem :: IntN n -> IntN n -> m (IntN n) Source #

safeQuotRem :: IntN n -> IntN n -> m (IntN n, IntN n) Source #

(MonadError ArithException m, TryMerge m, KnownNat n, 1 <= n) => SafeDiv ArithException (WordN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: WordN n -> WordN n -> m (WordN n) Source #

safeMod :: WordN n -> WordN n -> m (WordN n) Source #

safeDivMod :: WordN n -> WordN n -> m (WordN n, WordN n) Source #

safeQuot :: WordN n -> WordN n -> m (WordN n) Source #

safeRem :: WordN n -> WordN n -> m (WordN n) Source #

safeQuotRem :: WordN n -> WordN n -> m (WordN n, WordN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeDiv ArithException (SymIntN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

safeDiv :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeMod :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeDivMod :: SymIntN n -> SymIntN n -> m (SymIntN n, SymIntN n) Source #

safeQuot :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeRem :: SymIntN n -> SymIntN n -> m (SymIntN n) Source #

safeQuotRem :: SymIntN n -> SymIntN n -> m (SymIntN n, SymIntN n) Source #

(MonadError ArithException m, MonadUnion m, KnownNat n, 1 <= n) => SafeDiv ArithException (SymWordN n) m Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

(forall (n :: Nat). (KnownNat n, 1 <= n) => SafeDiv e (bv n) (ExceptT e m), MonadError (Either SomeBVException e) m, TryMerge m, Mergeable e, forall (n :: Nat). (KnownNat n, 1 <= n) => Num (bv n), MaySomeBV bv) => SafeDiv (Either SomeBVException e) (SomeBV bv) m Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SomeBV

Methods

safeDiv :: SomeBV bv -> SomeBV bv -> m (SomeBV bv) Source #

safeMod :: SomeBV bv -> SomeBV bv -> m (SomeBV bv) Source #

safeDivMod :: SomeBV bv -> SomeBV bv -> m (SomeBV bv, SomeBV bv) Source #

safeQuot :: SomeBV bv -> SomeBV bv -> m (SomeBV bv) Source #

safeRem :: SomeBV bv -> SomeBV bv -> m (SomeBV bv) Source #

safeQuotRem :: SomeBV bv -> SomeBV bv -> m (SomeBV bv, SomeBV bv) Source #

class DivOr a where Source #

Safe division handling with default values returned on exception.

Methods

divOr :: a -> a -> a -> a Source #

Safe div with default value returned on exception.

>>> divOr "d" "a" "b" :: SymInteger
(ite (= b 0) d (div a b))

modOr :: a -> a -> a -> a Source #

Safe mod with default value returned on exception.

>>> modOr "d" "a" "b" :: SymInteger
(ite (= b 0) d (mod a b))

divModOr :: (a, a) -> a -> a -> (a, a) Source #

Safe divMod with default value returned on exception.

>>> divModOr ("d", "m") "a" "b" :: (SymInteger, SymInteger)
((ite (= b 0) d (div a b)),(ite (= b 0) m (mod a b)))

quotOr :: a -> a -> a -> a Source #

Safe quot with default value returned on exception.

remOr :: a -> a -> a -> a Source #

Safe rem with default value returned on exception.

quotRemOr :: (a, a) -> a -> a -> (a, a) Source #

Safe quotRem with default value returned on exception.

Instances

Instances details
DivOr Int16 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Int32 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Int64 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Int8 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: Int8 -> Int8 -> Int8 -> Int8 Source #

modOr :: Int8 -> Int8 -> Int8 -> Int8 Source #

divModOr :: (Int8, Int8) -> Int8 -> Int8 -> (Int8, Int8) Source #

quotOr :: Int8 -> Int8 -> Int8 -> Int8 Source #

remOr :: Int8 -> Int8 -> Int8 -> Int8 Source #

quotRemOr :: (Int8, Int8) -> Int8 -> Int8 -> (Int8, Int8) Source #

DivOr Word16 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Word32 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Word64 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Word8 Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr SymInteger Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Integer Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

DivOr Int Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: Int -> Int -> Int -> Int Source #

modOr :: Int -> Int -> Int -> Int Source #

divModOr :: (Int, Int) -> Int -> Int -> (Int, Int) Source #

quotOr :: Int -> Int -> Int -> Int Source #

remOr :: Int -> Int -> Int -> Int Source #

quotRemOr :: (Int, Int) -> Int -> Int -> (Int, Int) Source #

DivOr Word Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: Word -> Word -> Word -> Word Source #

modOr :: Word -> Word -> Word -> Word Source #

divModOr :: (Word, Word) -> Word -> Word -> (Word, Word) Source #

quotOr :: Word -> Word -> Word -> Word Source #

remOr :: Word -> Word -> Word -> Word Source #

quotRemOr :: (Word, Word) -> Word -> Word -> (Word, Word) Source #

(KnownNat n, 1 <= n) => DivOr (IntN n) Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: IntN n -> IntN n -> IntN n -> IntN n Source #

modOr :: IntN n -> IntN n -> IntN n -> IntN n Source #

divModOr :: (IntN n, IntN n) -> IntN n -> IntN n -> (IntN n, IntN n) Source #

quotOr :: IntN n -> IntN n -> IntN n -> IntN n Source #

remOr :: IntN n -> IntN n -> IntN n -> IntN n Source #

quotRemOr :: (IntN n, IntN n) -> IntN n -> IntN n -> (IntN n, IntN n) Source #

(KnownNat n, 1 <= n) => DivOr (WordN n) Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: WordN n -> WordN n -> WordN n -> WordN n Source #

modOr :: WordN n -> WordN n -> WordN n -> WordN n Source #

divModOr :: (WordN n, WordN n) -> WordN n -> WordN n -> (WordN n, WordN n) Source #

quotOr :: WordN n -> WordN n -> WordN n -> WordN n Source #

remOr :: WordN n -> WordN n -> WordN n -> WordN n Source #

quotRemOr :: (WordN n, WordN n) -> WordN n -> WordN n -> (WordN n, WordN n) Source #

(forall (n :: Nat). (KnownNat n, 1 <= n) => DivOr (bv n), forall (n :: Nat). (KnownNat n, 1 <= n) => Num (bv n), MaySomeBV bv) => DivOr (SomeBV bv) Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SomeBV

Methods

divOr :: SomeBV bv -> SomeBV bv -> SomeBV bv -> SomeBV bv Source #

modOr :: SomeBV bv -> SomeBV bv -> SomeBV bv -> SomeBV bv Source #

divModOr :: (SomeBV bv, SomeBV bv) -> SomeBV bv -> SomeBV bv -> (SomeBV bv, SomeBV bv) Source #

quotOr :: SomeBV bv -> SomeBV bv -> SomeBV bv -> SomeBV bv Source #

remOr :: SomeBV bv -> SomeBV bv -> SomeBV bv -> SomeBV bv Source #

quotRemOr :: (SomeBV bv, SomeBV bv) -> SomeBV bv -> SomeBV bv -> (SomeBV bv, SomeBV bv) Source #

(KnownNat n, 1 <= n) => DivOr (SymIntN n) Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

Methods

divOr :: SymIntN n -> SymIntN n -> SymIntN n -> SymIntN n Source #

modOr :: SymIntN n -> SymIntN n -> SymIntN n -> SymIntN n Source #

divModOr :: (SymIntN n, SymIntN n) -> SymIntN n -> SymIntN n -> (SymIntN n, SymIntN n) Source #

quotOr :: SymIntN n -> SymIntN n -> SymIntN n -> SymIntN n Source #

remOr :: SymIntN n -> SymIntN n -> SymIntN n -> SymIntN n Source #

quotRemOr :: (SymIntN n, SymIntN n) -> SymIntN n -> SymIntN n -> (SymIntN n, SymIntN n) Source #

(KnownNat n, 1 <= n) => DivOr (SymWordN n) Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SafeDiv

divOrZero :: (DivOr a, Num a) => a -> a -> a Source #

Safe div with 0 returned on exception.

modOrDividend :: (DivOr a, Num a) => a -> a -> a Source #

Safe mod with dividend returned on exception.

quotOrZero :: (DivOr a, Num a) => a -> a -> a Source #

Safe quot with 0 returned on exception.

remOrDividend :: (DivOr a, Num a) => a -> a -> a Source #

Safe rem with dividend returned on exception.

divModOrZeroDividend :: (DivOr a, Num a) => a -> a -> (a, a) Source #

Safe divMod with 0 returned on exception.

quotRemOrZeroDividend :: (DivOr a, Num a) => a -> a -> (a, a) Source #

Safe quotRem with 0 returned on exception.