Copyright | (c) Sirui Lu 2024 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | None |
Language | Haskell2010 |
Grisette.Internal.SymPrim.FP
Description
Synopsis
- type ValidFP (eb :: Nat) (sb :: Nat) = ValidFloat eb sb
- newtype FP (eb :: Nat) (sb :: Nat) = FP {
- unFP :: FloatingPoint eb sb
- type FP16 = FP 5 11
- type FP32 = FP 8 24
- type FP64 = FP 11 53
- withValidFPProofs :: forall (eb :: Nat) (sb :: Nat) r. ValidFP eb sb => ((KnownNat (eb + sb), BVIsNonZero (eb + sb), 1 <= (eb + sb), 1 <= eb, 1 <= sb) => r) -> r
- data FPRoundingMode
- allFPRoundingMode :: [FPRoundingMode]
- data NotRepresentableFPError
- class ConvertibleBound (bv :: Nat -> Type) where
- convertibleLowerBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => bv n -> FPRoundingMode -> FP eb sb
- convertibleUpperBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => bv n -> FPRoundingMode -> FP eb sb
- nextFP :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => FP eb sb -> FP eb sb
- prevFP :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => FP eb sb -> FP eb sb
- withUnsafeValidFP :: forall (eb :: Nat) (sb :: Nat) r. (KnownNat eb, KnownNat sb) => (ValidFP eb sb => r) -> r
- checkDynamicValidFP :: Natural -> Natural -> Bool
- invalidFPMessage :: String
Documentation
type ValidFP (eb :: Nat) (sb :: Nat) = ValidFloat eb sb Source #
A type-level proof that the given bit-widths are valid for a floating-point number.
newtype FP (eb :: Nat) (sb :: Nat) Source #
IEEE 754 floating-point number with eb
exponent bits and sb
significand
bits.
>>>
1.0 + 2.0 :: FP 11 53
3.0
More operations are available. Please refer to Grisette.Core for more information.
Constructors
FP | |
Fields
|
Instances
withValidFPProofs :: forall (eb :: Nat) (sb :: Nat) r. ValidFP eb sb => ((KnownNat (eb + sb), BVIsNonZero (eb + sb), 1 <= (eb + sb), 1 <= eb, 1 <= sb) => r) -> r Source #
Some type-level witnesses that could be derived from ValidFP
.
data FPRoundingMode Source #
Rounding mode for floating-point operations.
Constructors
RNE | Round to nearest, ties to even. |
RNA | Round to nearest, ties to away from zero. |
RTP | Round towards positive infinity. |
RTN | Round towards negative infinity. |
RTZ | Round towards zero. |
Instances
Arbitrary FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
Serial FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods serialize :: MonadPut m => FPRoundingMode -> m () # deserialize :: MonadGet m => m FPRoundingMode # | |||||||||
NFData FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods rnf :: FPRoundingMode -> () # | |||||||||
Generic FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Associated Types
Methods from :: FPRoundingMode -> Rep FPRoundingMode x # to :: Rep FPRoundingMode x -> FPRoundingMode # | |||||||||
Show FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods showsPrec :: Int -> FPRoundingMode -> ShowS # show :: FPRoundingMode -> String # showList :: [FPRoundingMode] -> ShowS # | |||||||||
Eq FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods (==) :: FPRoundingMode -> FPRoundingMode -> Bool # (/=) :: FPRoundingMode -> FPRoundingMode -> Bool # | |||||||||
Ord FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods compare :: FPRoundingMode -> FPRoundingMode -> Ordering # (<) :: FPRoundingMode -> FPRoundingMode -> Bool # (<=) :: FPRoundingMode -> FPRoundingMode -> Bool # (>) :: FPRoundingMode -> FPRoundingMode -> Bool # (>=) :: FPRoundingMode -> FPRoundingMode -> Bool # max :: FPRoundingMode -> FPRoundingMode -> FPRoundingMode # min :: FPRoundingMode -> FPRoundingMode -> FPRoundingMode # | |||||||||
Apply FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Associated Types
Methods | |||||||||
IEEEFPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods rne :: FPRoundingMode Source # rna :: FPRoundingMode Source # rtp :: FPRoundingMode Source # rtn :: FPRoundingMode Source # rtz :: FPRoundingMode Source # | |||||||||
EvalSym FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.EvalSym Methods evalSym :: Bool -> Model -> FPRoundingMode -> FPRoundingMode Source # | |||||||||
ExtractSym FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ExtractSym Methods extractSym :: FPRoundingMode -> AnySymbolSet Source # extractSymMaybe :: forall (knd :: SymbolKind). IsSymbolKind knd => FPRoundingMode -> Maybe (SymbolSet knd) Source # | |||||||||
Mergeable FPRoundingMode Source # | |||||||||
PPrint FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.PPrint Methods pformat :: FPRoundingMode -> Doc ann Source # pformatPrec :: Int -> FPRoundingMode -> Doc ann Source # pformatList :: [FPRoundingMode] -> Doc ann Source # | |||||||||
SubstSym FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SubstSym Methods substSym :: forall cb sb (knd :: SymbolKind). (LinkedRep cb sb, IsSymbolKind knd) => TypedSymbol knd cb -> sb -> FPRoundingMode -> FPRoundingMode Source # | |||||||||
SymEq FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SymEq Methods (.==) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # (./=) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # symDistinct :: [FPRoundingMode] -> SymBool Source # | |||||||||
SymOrd FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SymOrd Methods (.<) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # (.<=) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # (.>) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # (.>=) :: FPRoundingMode -> FPRoundingMode -> SymBool Source # symCompare :: FPRoundingMode -> FPRoundingMode -> Union Ordering Source # | |||||||||
AllSyms FPRoundingMode Source # | |||||||||
NonFuncSBVRep FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Associated Types
| |||||||||
PEvalOrdTerm FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalOrdTerm Methods pevalLtOrdTerm :: Term FPRoundingMode -> Term FPRoundingMode -> Term Bool Source # pevalLeOrdTerm :: Term FPRoundingMode -> Term FPRoundingMode -> Term Bool Source # withSbvOrdTermConstraint :: (OrdSymbolic (SBVType FPRoundingMode) => r) -> r Source # sbvLtOrdTerm :: SBVType FPRoundingMode -> SBVType FPRoundingMode -> SBV Bool Source # sbvLeOrdTerm :: SBVType FPRoundingMode -> SBVType FPRoundingMode -> SBV Bool Source # | |||||||||
SBVRep FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Associated Types
| |||||||||
SupportedNonFuncPrim FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Methods conNonFuncSBVTerm :: FPRoundingMode -> SBV (NonFuncSBVBaseType FPRoundingMode) Source # symNonFuncSBVTerm :: SBVFreshMonad m => String -> m (SBV (NonFuncSBVBaseType FPRoundingMode)) Source # withNonFuncPrim :: (NonFuncPrimConstraint FPRoundingMode => r) -> r Source # | |||||||||
SupportedPrim FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Methods primTypeRep :: TypeRep FPRoundingMode Source # sameCon :: FPRoundingMode -> FPRoundingMode -> Bool Source # hashConWithSalt :: Int -> FPRoundingMode -> Int Source # pformatCon :: FPRoundingMode -> String Source # defaultValue :: FPRoundingMode Source # pevalITETerm :: Term Bool -> Term FPRoundingMode -> Term FPRoundingMode -> Term FPRoundingMode Source # pevalEqTerm :: Term FPRoundingMode -> Term FPRoundingMode -> Term Bool Source # pevalDistinctTerm :: NonEmpty (Term FPRoundingMode) -> Term Bool Source # conSBVTerm :: FPRoundingMode -> SBVType FPRoundingMode Source # symSBVName :: TypedSymbol 'AnyKind FPRoundingMode -> Int -> String Source # symSBVTerm :: SBVFreshMonad m => String -> m (SBVType FPRoundingMode) Source # withPrim :: ((PrimConstraint FPRoundingMode, SMTDefinable (SBVType FPRoundingMode), Mergeable (SBVType FPRoundingMode), Typeable (SBVType FPRoundingMode)) => a) -> a Source # sbvIte :: SBV Bool -> SBVType FPRoundingMode -> SBVType FPRoundingMode -> SBVType FPRoundingMode Source # sbvEq :: SBVType FPRoundingMode -> SBVType FPRoundingMode -> SBV Bool Source # sbvDistinct :: NonEmpty (SBVType FPRoundingMode) -> SBV Bool Source # parseSMTModelResult :: Int -> ([([CV], CV)], CV) -> FPRoundingMode Source # castTypedSymbol :: forall (knd' :: SymbolKind) (knd :: SymbolKind). IsSymbolKind knd' => TypedSymbol knd FPRoundingMode -> Maybe (TypedSymbol knd' FPRoundingMode) Source # funcDummyConstraint :: SBVType FPRoundingMode -> SBV Bool Source # | |||||||||
SupportedPrimConstraint FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Associated Types
| |||||||||
SymRep FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.SymFP Associated Types
| |||||||||
Hashable FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
GenSym FPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.GenSym Methods fresh :: MonadFresh m => FPRoundingMode -> m (Union FPRoundingMode) Source # | |||||||||
GenSymSimple FPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.GenSym Methods simpleFresh :: MonadFresh m => FPRoundingMode -> m FPRoundingMode Source # | |||||||||
Solvable FPRoundingMode SymFPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.SymFP Methods con :: FPRoundingMode -> SymFPRoundingMode Source # conView :: SymFPRoundingMode -> Maybe FPRoundingMode Source # sym :: Symbol -> SymFPRoundingMode Source # ssym :: Identifier -> SymFPRoundingMode Source # isym :: Identifier -> Int -> SymFPRoundingMode Source # | |||||||||
ToCon FPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToCon Methods | |||||||||
ToCon SymFPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToCon Methods | |||||||||
ToSym FPRoundingMode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToSym Methods toSym :: FPRoundingMode -> FPRoundingMode Source # | |||||||||
ToSym FPRoundingMode SymFPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToSym Methods | |||||||||
DecideEvalMode mode => UnifiedSymEq mode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Unified.Class.UnifiedSymEq Methods withBaseSymEq :: (If (IsConMode mode) (Eq FPRoundingMode) (SymEq FPRoundingMode) => r) -> r Source # | |||||||||
DecideEvalMode mode => UnifiedSymOrd mode FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Unified.Class.UnifiedSymOrd Methods withBaseSymOrd :: (If (IsConMode mode) (Ord FPRoundingMode) (SymOrd FPRoundingMode) => r) -> r Source # | |||||||||
LinkedRep FPRoundingMode SymFPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.SymFP Methods underlyingTerm :: SymFPRoundingMode -> Term FPRoundingMode Source # wrapTerm :: Term FPRoundingMode -> SymFPRoundingMode Source # | |||||||||
Lift FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods lift :: Quote m => FPRoundingMode -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => FPRoundingMode -> Code m FPRoundingMode # | |||||||||
ValidFP eb sb => UnifiedFPImpl 'C FP eb sb (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.Internal.Impl.Unified.UnifiedFP Associated Types
| |||||||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m AlgReal Source # | |||||||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m Integer Source # | |||||||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m (IntN n) Source # | |||||||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m Source # | |||||||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m (WordN n) Source # | |||||||||
ValidFP eb sb => IEEEFPConvertible AlgReal (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
ValidFP eb sb => IEEEFPConvertible Integer (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
ValidFP eb sb => IEEEFPToAlgReal AlgReal (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
(ValidFP eb sb, KnownNat n, 1 <= n) => IEEEFPConvertible (IntN n) (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
(ValidFP eb sb, KnownNat n, 1 <= n) => IEEEFPConvertible (WordN n) (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
ValidFP eb sb => IEEEFPRoundingOp (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP Methods fpAdd :: FPRoundingMode -> FP eb sb -> FP eb sb -> FP eb sb Source # fpSub :: FPRoundingMode -> FP eb sb -> FP eb sb -> FP eb sb Source # fpMul :: FPRoundingMode -> FP eb sb -> FP eb sb -> FP eb sb Source # fpDiv :: FPRoundingMode -> FP eb sb -> FP eb sb -> FP eb sb Source # fpFMA :: FPRoundingMode -> FP eb sb -> FP eb sb -> FP eb sb -> FP eb sb Source # fpSqrt :: FPRoundingMode -> FP eb sb -> FP eb sb Source # fpRoundToIntegral :: FPRoundingMode -> FP eb sb -> FP eb sb Source # | |||||||||
(ValidFP eb sb, ValidFP eb' sb') => IEEEFPConvertible (FP eb' sb') (FP eb sb) FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
type Rep FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP type Rep FPRoundingMode = D1 ('MetaData "FPRoundingMode" "Grisette.Internal.SymPrim.FP" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'False) ((C1 ('MetaCons "RNE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RNA" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "RTP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RTN" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RTZ" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||||||
type FunType FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.FP | |||||||||
type NonFuncSBVBaseType FPRoundingMode Source # | |||||||||
type PrimConstraint FPRoundingMode Source # | |||||||||
type SBVType FPRoundingMode Source # | |||||||||
type SymType FPRoundingMode Source # | |||||||||
Defined in Grisette.Internal.SymPrim.SymFP |
allFPRoundingMode :: [FPRoundingMode] Source #
All IEEE 754 rounding modes.
data NotRepresentableFPError Source #
An error thrown when bitcasting or converting FP
NaN to other types.
Constructors
NaNError | |
FPUnderflowError | |
FPOverflowError |
Instances
Exception NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP | |||||
Generic NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP Associated Types
Methods from :: NotRepresentableFPError -> Rep NotRepresentableFPError x # to :: Rep NotRepresentableFPError x -> NotRepresentableFPError # | |||||
Show NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP Methods showsPrec :: Int -> NotRepresentableFPError -> ShowS # show :: NotRepresentableFPError -> String # showList :: [NotRepresentableFPError] -> ShowS # | |||||
Eq NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP Methods (==) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # (/=) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # | |||||
Ord NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP Methods compare :: NotRepresentableFPError -> NotRepresentableFPError -> Ordering # (<) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # (<=) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # (>) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # (>=) :: NotRepresentableFPError -> NotRepresentableFPError -> Bool # max :: NotRepresentableFPError -> NotRepresentableFPError -> NotRepresentableFPError # min :: NotRepresentableFPError -> NotRepresentableFPError -> NotRepresentableFPError # | |||||
EvalSym NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.EvalSym Methods evalSym :: Bool -> Model -> NotRepresentableFPError -> NotRepresentableFPError Source # | |||||
ExtractSym NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ExtractSym Methods extractSym :: NotRepresentableFPError -> AnySymbolSet Source # extractSymMaybe :: forall (knd :: SymbolKind). IsSymbolKind knd => NotRepresentableFPError -> Maybe (SymbolSet knd) Source # | |||||
Mergeable NotRepresentableFPError Source # | |||||
PPrint NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.PPrint Methods pformat :: NotRepresentableFPError -> Doc ann Source # pformatPrec :: Int -> NotRepresentableFPError -> Doc ann Source # pformatList :: [NotRepresentableFPError] -> Doc ann Source # | |||||
SubstSym NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SubstSym Methods substSym :: forall cb sb (knd :: SymbolKind). (LinkedRep cb sb, IsSymbolKind knd) => TypedSymbol knd cb -> sb -> NotRepresentableFPError -> NotRepresentableFPError Source # | |||||
SymEq NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SymEq Methods (.==) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # (./=) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # symDistinct :: [NotRepresentableFPError] -> SymBool Source # | |||||
SymOrd NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.SymOrd Methods (.<) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # (.<=) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # (.>) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # (.>=) :: NotRepresentableFPError -> NotRepresentableFPError -> SymBool Source # symCompare :: NotRepresentableFPError -> NotRepresentableFPError -> Union Ordering Source # | |||||
ToCon NotRepresentableFPError NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToCon Methods toCon :: NotRepresentableFPError -> Maybe NotRepresentableFPError Source # | |||||
ToSym NotRepresentableFPError NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToSym Methods toSym :: NotRepresentableFPError -> NotRepresentableFPError Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP16 Int16 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP16 -> m Int16 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP16 Word16 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP16 -> m Word16 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP32 Int32 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP32 -> m Int32 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP32 Word32 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP32 -> m Word32 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP32 Float m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP32 -> m Float Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP64 Int64 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP64 -> m Int64 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP64 Word64 m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP64 -> m Word64 Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m) => SafeBitCast NotRepresentableFPError FP64 Double m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP64 -> m Double Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb) => UnifiedSafeFromFP 'S NotRepresentableFPError SymAlgReal (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError SymAlgReal (SymFP eb sb) SymFPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb) => UnifiedSafeFromFP 'S NotRepresentableFPError SymInteger (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError SymInteger (SymFP eb sb) SymFPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP 'S NotRepresentableFPError (SymIntN n) (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (SymIntN n) (SymFP eb sb) SymFPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP 'S NotRepresentableFPError (SymWordN n) (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (SymWordN n) (SymFP eb sb) SymFPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP Methods withBaseSafeFromFP :: (SafeFromFP NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m AlgReal Source # | |||||
(MonadError NotRepresentableFPError m, MonadUnion m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError SymAlgReal (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: SymFPRoundingMode -> SymFP eb sb -> m SymAlgReal Source # | |||||
(MonadError NotRepresentableFPError m, MonadUnion m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError SymInteger (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: SymFPRoundingMode -> SymFP eb sb -> m SymInteger Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m Integer Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n, n ~ (eb + sb)) => UnifiedSafeBitCast 'S NotRepresentableFPError (SymFP eb sb) (SymIntN n) m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeBitCast Methods withBaseSafeBitCast :: (SafeBitCast NotRepresentableFPError (SymFP eb sb) (SymIntN n) m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n, n ~ (eb + sb)) => UnifiedSafeBitCast 'S NotRepresentableFPError (SymFP eb sb) (SymWordN n) m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeBitCast Methods withBaseSafeBitCast :: (SafeBitCast NotRepresentableFPError (SymFP eb sb) (SymWordN n) m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n, n ~ (eb + sb)) => UnifiedSafeBitCast mode NotRepresentableFPError (FP eb sb) (IntN n) m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeBitCast Methods withBaseSafeBitCast :: (SafeBitCast NotRepresentableFPError (FP eb sb) (IntN n) m => r) -> r Source # | |||||
(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n, n ~ (eb + sb)) => UnifiedSafeBitCast mode NotRepresentableFPError (FP eb sb) (WordN n) m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeBitCast Methods withBaseSafeBitCast :: (SafeBitCast NotRepresentableFPError (FP eb sb) (WordN n) m => r) -> r Source # | |||||
ToSym NotRepresentableFPError (Union NotRepresentableFPError) Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToSym Methods toSym :: NotRepresentableFPError -> Union NotRepresentableFPError Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m (IntN n) Source # | |||||
(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: FPRoundingMode -> FP eb sb -> m (WordN n) Source # | |||||
(MonadError NotRepresentableFPError m, MonadUnion m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (SymIntN n) (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: SymFPRoundingMode -> SymFP eb sb -> m (SymIntN n) Source # | |||||
(MonadError NotRepresentableFPError m, MonadUnion m, ValidFP eb sb, KnownNat n, 1 <= n) => SafeFromFP NotRepresentableFPError (SymWordN n) (SymFP eb sb) SymFPRoundingMode m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeFromFP Methods safeFromFP :: SymFPRoundingMode -> SymFP eb sb -> m (SymWordN n) Source # | |||||
(ValidFP eb sb, r ~ (eb + sb), KnownNat r, 1 <= r, TryMerge m, MonadError NotRepresentableFPError m) => SafeBitCast NotRepresentableFPError (FP eb sb) (IntN r) m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP eb sb -> m (IntN r) Source # | |||||
(ValidFP eb sb, r ~ (eb + sb), KnownNat r, 1 <= r, TryMerge m, MonadError NotRepresentableFPError m) => SafeBitCast NotRepresentableFPError (FP eb sb) (WordN r) m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: FP eb sb -> m (WordN r) Source # | |||||
(ValidFP eb sb, r ~ (eb + sb), KnownNat r, 1 <= r, MonadUnion m, MonadError NotRepresentableFPError m) => SafeBitCast NotRepresentableFPError (SymFP eb sb) (SymIntN r) m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: SymFP eb sb -> m (SymIntN r) Source # | |||||
(ValidFP eb sb, r ~ (eb + sb), KnownNat r, 1 <= r, MonadUnion m, MonadError NotRepresentableFPError m) => SafeBitCast NotRepresentableFPError (SymFP eb sb) (SymWordN r) m Source # | |||||
Defined in Grisette.Internal.Core.Data.Class.SafeBitCast Methods safeBitCast :: SymFP eb sb -> m (SymWordN r) Source # | |||||
ToCon (Union NotRepresentableFPError) NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToCon Methods toCon :: Union NotRepresentableFPError -> Maybe NotRepresentableFPError Source # | |||||
type Rep NotRepresentableFPError Source # | |||||
Defined in Grisette.Internal.SymPrim.FP type Rep NotRepresentableFPError = D1 ('MetaData "NotRepresentableFPError" "Grisette.Internal.SymPrim.FP" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'False) (C1 ('MetaCons "NaNError" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FPUnderflowError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FPOverflowError" 'PrefixI 'False) (U1 :: Type -> Type))) |
class ConvertibleBound (bv :: Nat -> Type) where Source #
Bounds for converting bit vectors to floating-point numbers. Out-of-range FP values cannot be converted to a representable bit-vector.
Methods
convertibleLowerBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => bv n -> FPRoundingMode -> FP eb sb Source #
convertibleUpperBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => bv n -> FPRoundingMode -> FP eb sb Source #
Instances
ConvertibleBound IntN Source # | |
Defined in Grisette.Internal.SymPrim.FP Methods convertibleLowerBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => IntN n -> FPRoundingMode -> FP eb sb Source # convertibleUpperBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => IntN n -> FPRoundingMode -> FP eb sb Source # | |
ConvertibleBound WordN Source # | |
Defined in Grisette.Internal.SymPrim.FP Methods convertibleLowerBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => WordN n -> FPRoundingMode -> FP eb sb Source # convertibleUpperBound :: forall (eb :: Nat) (sb :: Nat) (n :: Nat). (ValidFP eb sb, KnownNat n, 1 <= n) => WordN n -> FPRoundingMode -> FP eb sb Source # |
nextFP :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => FP eb sb -> FP eb sb Source #
Next representable floating-point number.
Note:
nextFP(+inf) = +inf nextFP(-inf) = -maxNormalized nextFP(NaN) = NaN
The function do not distinguish between -0 and +0.
prevFP :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => FP eb sb -> FP eb sb Source #
Previous representable floating-point number.
Note:
prevFP(+inf) = +maxNormalized prevFP(-inf) = -inf prevFP(NaN) = NaN
The function do not distinguish between -0 and +0.
withUnsafeValidFP :: forall (eb :: Nat) (sb :: Nat) r. (KnownNat eb, KnownNat sb) => (ValidFP eb sb => r) -> r Source #
Provide an (unsafe) type-level proof that the given floating-point type is valid.
checkDynamicValidFP :: Natural -> Natural -> Bool Source #
Check if the given floating-point type is valid.
invalidFPMessage :: String Source #
A message thrown when the floating-point type is invalid.