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.AlgReal
Description
Synopsis
- newtype AlgRealPoly = AlgRealPoly [(Integer, Integer)]
- data UnsupportedAlgRealOperation = UnsupportedAlgRealOperation {}
- toSBVAlgReal :: AlgReal -> AlgReal
- fromSBVAlgReal :: AlgReal -> AlgReal
- data RealPoint
- data AlgReal where
- AlgExactRational :: Rational -> AlgReal
- AlgInexactRational :: Rational -> AlgReal
- AlgPolyRoot :: Integer -> AlgRealPoly -> Maybe String -> AlgReal
- AlgInterval :: RealPoint -> RealPoint -> AlgReal
Documentation
newtype AlgRealPoly Source #
A univariate polynomial with integer coefficients.
For instance, 5x^3+2x-5
is represented as
.AlgRealPoly
[(5, 3), (2, 1), (-5, 0)]
Constructors
AlgRealPoly [(Integer, Integer)] |
Instances
data UnsupportedAlgRealOperation Source #
Exception for unsupported operations on algebraic real numbers.
We only support operations on exact rationals.
Constructors
UnsupportedAlgRealOperation | |
Instances
Exception UnsupportedAlgRealOperation Source # | |
Show UnsupportedAlgRealOperation Source # | |
Defined in Grisette.Internal.SymPrim.AlgReal Methods showsPrec :: Int -> UnsupportedAlgRealOperation -> ShowS # show :: UnsupportedAlgRealOperation -> String # showList :: [UnsupportedAlgRealOperation] -> ShowS # |
toSBVAlgReal :: AlgReal -> AlgReal Source #
Convert algebraic real numbers to SBV's algebraic real numbers.
fromSBVAlgReal :: AlgReal -> AlgReal Source #
Convert SBV's algebraic real numbers to algebraic real numbers.
Boundary point for real intervals.
Constructors
OpenPoint Rational | Open point. |
ClosedPoint Rational | Closed point. |
Instances
Binary RealPoint Source # | |||||
Serial RealPoint Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Serialize RealPoint Source # | |||||
NFData RealPoint Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Generic RealPoint Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal Associated Types
| |||||
Eq RealPoint Source # | |||||
Mergeable RealPoint Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.Mergeable Methods rootStrategy :: MergingStrategy RealPoint Source # sortIndices :: RealPoint -> [DynamicSortedIdx] Source # | |||||
Hashable RealPoint Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Lift RealPoint Source # | |||||
type Rep RealPoint Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal type Rep RealPoint = D1 ('MetaData "RealPoint" "Grisette.Internal.SymPrim.AlgReal" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'False) (C1 ('MetaCons "OpenPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)) :+: C1 ('MetaCons "ClosedPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational))) |
Algebraic real numbers. The representation can be abstract for roots-of-polynomials or intervals.
Constructors
AlgExactRational :: Rational -> AlgReal | Exact rational number. |
AlgInexactRational :: Rational -> AlgReal | Inexact rational numbers. SMT-solver return it with ? at the end. |
AlgPolyRoot | Algebraic real number as a root of a polynomial. |
Fields
| |
AlgInterval | Interval with low and high bounds. |
Instances
Arbitrary AlgReal Source # | |||||
Binary AlgReal Source # | |||||
Serial AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Serialize AlgReal Source # | |||||
NFData AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Generic AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal Associated Types
| |||||
Num AlgReal Source # | |||||
Fractional AlgReal Source # | Unlike sbv, we throw the error when divided by zero happens | ||||
Real AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal Methods toRational :: AlgReal -> Rational # | |||||
Show AlgReal Source # | |||||
Eq AlgReal Source # | |||||
Ord AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Apply AlgReal Source # | |||||
FdivOr AlgReal Source # | |||||
EvalSym AlgReal Source # | |||||
ExtractSym AlgReal Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ExtractSym Methods extractSym :: AlgReal -> AnySymbolSet Source # extractSymMaybe :: forall (knd :: SymbolKind). IsSymbolKind knd => AlgReal -> Maybe (SymbolSet knd) Source # | |||||
Mergeable AlgReal Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.Mergeable Methods rootStrategy :: MergingStrategy AlgReal Source # sortIndices :: AlgReal -> [DynamicSortedIdx] Source # | |||||
PPrint AlgReal Source # | |||||
SubstSym AlgReal 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 -> AlgReal -> AlgReal Source # | |||||
SymEq AlgReal Source # | |||||
SymOrd AlgReal Source # | |||||
AllSyms AlgReal Source # | |||||
NonFuncSBVRep AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Associated Types
| |||||
PEvalFloatingTerm AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFloatingTerm Methods pevalFloatingUnaryTerm :: FloatingUnaryOp -> Term AlgReal -> Term AlgReal Source # pevalPowerTerm :: Term AlgReal -> Term AlgReal -> Term AlgReal Source # withSbvFloatingTermConstraint :: (Floating (SBVType AlgReal) => r) -> r Source # sbvPowerTerm :: SBVType AlgReal -> SBVType AlgReal -> SBVType AlgReal Source # sbvFloatingUnaryTerm :: FloatingUnaryOp -> SBVType AlgReal -> SBVType AlgReal Source # | |||||
PEvalFractionalTerm AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFractionalTerm | |||||
PEvalIEEEFPConvertibleTerm AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalIEEEFPConvertibleTerm Methods pevalFromFPOrTerm :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => Term AlgReal -> Term FPRoundingMode -> Term (FP eb sb) -> Term AlgReal Source # pevalToFPTerm :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => Term FPRoundingMode -> Term AlgReal -> Term (FP eb sb) Source # sbvFromFPOrTerm :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => SBVType AlgReal -> SBVType FPRoundingMode -> SBVType (FP eb sb) -> SBVType AlgReal Source # sbvToFPTerm :: forall (eb :: Nat) (sb :: Nat). ValidFP eb sb => SBVType FPRoundingMode -> SBVType AlgReal -> SBVType (FP eb sb) Source # | |||||
PEvalNumTerm AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalNumTerm Methods pevalAddNumTerm :: Term AlgReal -> Term AlgReal -> Term AlgReal Source # pevalNegNumTerm :: Term AlgReal -> Term AlgReal Source # pevalMulNumTerm :: Term AlgReal -> Term AlgReal -> Term AlgReal Source # pevalAbsNumTerm :: Term AlgReal -> Term AlgReal Source # pevalSignumNumTerm :: Term AlgReal -> Term AlgReal Source # withSbvNumTermConstraint :: (Num (SBVType AlgReal) => r) -> r Source # sbvAddNumTerm :: SBVType AlgReal -> SBVType AlgReal -> SBVType AlgReal Source # sbvNegNumTerm :: SBVType AlgReal -> SBVType AlgReal Source # sbvMulNumTerm :: SBVType AlgReal -> SBVType AlgReal -> SBVType AlgReal Source # sbvAbsNumTerm :: SBVType AlgReal -> SBVType AlgReal Source # sbvSignumNumTerm :: SBVType AlgReal -> SBVType AlgReal Source # | |||||
PEvalOrdTerm AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalOrdTerm Methods pevalLtOrdTerm :: Term AlgReal -> Term AlgReal -> Term Bool Source # pevalLeOrdTerm :: Term AlgReal -> Term AlgReal -> Term Bool Source # withSbvOrdTermConstraint :: (OrdSymbolic (SBVType AlgReal) => r) -> r Source # sbvLtOrdTerm :: SBVType AlgReal -> SBVType AlgReal -> SBV Bool Source # sbvLeOrdTerm :: SBVType AlgReal -> SBVType AlgReal -> SBV Bool Source # | |||||
SBVRep AlgReal Source # | |||||
SupportedNonFuncPrim AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Methods conNonFuncSBVTerm :: AlgReal -> SBV (NonFuncSBVBaseType AlgReal) Source # symNonFuncSBVTerm :: SBVFreshMonad m => String -> m (SBV (NonFuncSBVBaseType AlgReal)) Source # withNonFuncPrim :: (NonFuncPrimConstraint AlgReal => r) -> r Source # | |||||
SupportedPrim AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Methods primTypeRep :: TypeRep AlgReal Source # sameCon :: AlgReal -> AlgReal -> Bool Source # hashConWithSalt :: Int -> AlgReal -> Int Source # pformatCon :: AlgReal -> String Source # defaultValue :: AlgReal Source # pevalITETerm :: Term Bool -> Term AlgReal -> Term AlgReal -> Term AlgReal Source # pevalEqTerm :: Term AlgReal -> Term AlgReal -> Term Bool Source # pevalDistinctTerm :: NonEmpty (Term AlgReal) -> Term Bool Source # conSBVTerm :: AlgReal -> SBVType AlgReal Source # symSBVName :: TypedSymbol 'AnyKind AlgReal -> Int -> String Source # symSBVTerm :: SBVFreshMonad m => String -> m (SBVType AlgReal) Source # withPrim :: ((PrimConstraint AlgReal, SMTDefinable (SBVType AlgReal), Mergeable (SBVType AlgReal), Typeable (SBVType AlgReal)) => a) -> a Source # sbvIte :: SBV Bool -> SBVType AlgReal -> SBVType AlgReal -> SBVType AlgReal Source # sbvEq :: SBVType AlgReal -> SBVType AlgReal -> SBV Bool Source # sbvDistinct :: NonEmpty (SBVType AlgReal) -> SBV Bool Source # parseSMTModelResult :: Int -> ([([CV], CV)], CV) -> AlgReal Source # castTypedSymbol :: forall (knd' :: SymbolKind) (knd :: SymbolKind). IsSymbolKind knd' => TypedSymbol knd AlgReal -> Maybe (TypedSymbol knd' AlgReal) Source # | |||||
SupportedPrimConstraint AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim Associated Types
| |||||
SymRep AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.SymAlgReal Associated Types
| |||||
UnifiedConRep AlgReal Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedRep | |||||
UnifiedSymRep AlgReal Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedRep Associated Types
| |||||
Hashable AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
Solvable AlgReal SymAlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.SymAlgReal Methods con :: AlgReal -> SymAlgReal Source # conView :: SymAlgReal -> Maybe AlgReal Source # sym :: Symbol -> SymAlgReal Source # ssym :: Identifier -> SymAlgReal Source # isym :: Identifier -> Int -> SymAlgReal Source # | |||||
ToCon SymAlgReal AlgReal Source # | |||||
ToSym AlgReal SymAlgReal Source # | |||||
Defined in Grisette.Internal.Internal.Impl.Core.Data.Class.ToSym Methods toSym :: AlgReal -> SymAlgReal Source # | |||||
LinkedRep AlgReal SymAlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.SymAlgReal Methods underlyingTerm :: SymAlgReal -> Term AlgReal Source # | |||||
PEvalFromIntegralTerm Integer AlgReal Source # | |||||
Lift AlgReal Source # | |||||
(MonadError ArithException m, TryMerge m) => SafeFdiv ArithException AlgReal m Source # | |||||
UnifiedFromIntegral 'C Integer AlgReal Source # | |||||
UnifiedSolvable 'C AlgReal AlgReal Source # | |||||
UnifiedSolvable 'S SymAlgReal AlgReal Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSolvable Methods withBaseSolvable :: (If (IsConMode 'S) (SymAlgReal ~ AlgReal) (Solvable AlgReal SymAlgReal) => r) -> r Source # | |||||
(MonadError ArithException m, UnifiedBranching mode m) => UnifiedSafeFdiv mode ArithException AlgReal m Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedSafeFdiv Methods withBaseUnifiedSafeFdiv :: (SafeFdiv ArithException AlgReal 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, 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 # | |||||
(KnownNat n', 1 <= n') => UnifiedFromIntegral 'C (IntN n') AlgReal Source # | |||||
(KnownNat n', 1 <= n') => UnifiedFromIntegral 'C (WordN n') AlgReal Source # | |||||
ValidFP eb sb => IEEEFPConvertible AlgReal (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 | |||||
(KnownNat n, 1 <= n) => PEvalFromIntegralTerm (IntN n) AlgReal Source # | |||||
(KnownNat n, 1 <= n) => PEvalFromIntegralTerm (WordN n) AlgReal Source # | |||||
type Rep AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal type Rep AlgReal = D1 ('MetaData "AlgReal" "Grisette.Internal.SymPrim.AlgReal" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'False) ((C1 ('MetaCons "AlgExactRational" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)) :+: C1 ('MetaCons "AlgInexactRational" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational))) :+: (C1 ('MetaCons "AlgPolyRoot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AlgRealPoly) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)))) :+: C1 ('MetaCons "AlgInterval" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RealPoint) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RealPoint)))) | |||||
type FunType AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.AlgReal | |||||
type NonFuncSBVBaseType AlgReal Source # | |||||
type PrimConstraint AlgReal Source # | |||||
type SBVType AlgReal Source # | |||||
type SymType AlgReal Source # | |||||
Defined in Grisette.Internal.SymPrim.SymAlgReal | |||||
type ConType AlgReal Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedRep | |||||
type SymType AlgReal Source # | |||||
Defined in Grisette.Internal.Unified.Class.UnifiedRep |