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

Grisette.Internal.SymPrim.AlgReal

Description

 
Synopsis

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

Instances details
Binary AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Serial AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Serialize AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

NFData AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

rnf :: AlgRealPoly -> () #

Generic AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Associated Types

type Rep AlgRealPoly 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

type Rep AlgRealPoly = D1 ('MetaData "AlgRealPoly" "Grisette.Internal.SymPrim.AlgReal" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'True) (C1 ('MetaCons "AlgRealPoly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Integer, Integer)])))
Eq AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Mergeable AlgRealPoly Source # 
Instance details

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

Hashable AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Lift AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

lift :: Quote m => AlgRealPoly -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => AlgRealPoly -> Code m AlgRealPoly #

type Rep AlgRealPoly Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

type Rep AlgRealPoly = D1 ('MetaData "AlgRealPoly" "Grisette.Internal.SymPrim.AlgReal" "grisette-0.11.0.0-HndeEPlDvvDHSETLw6O8c" 'True) (C1 ('MetaCons "AlgRealPoly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Integer, Integer)])))

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.

data RealPoint Source #

Boundary point for real intervals.

Constructors

OpenPoint Rational

Open point.

ClosedPoint Rational

Closed point.

Instances

Instances details
Binary RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Serial RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

serialize :: MonadPut m => RealPoint -> m () #

deserialize :: MonadGet m => m RealPoint #

Serialize RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

NFData RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

rnf :: RealPoint -> () #

Generic RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Associated Types

type Rep RealPoint 
Instance details

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)))
Eq RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Mergeable RealPoint Source # 
Instance details

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

Hashable RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Lift RealPoint Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

lift :: Quote m => RealPoint -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => RealPoint -> Code m RealPoint #

type Rep RealPoint Source # 
Instance details

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)))

data AlgReal where Source #

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.

Fields

Instances

Instances details
Arbitrary AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Binary AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

put :: AlgReal -> Put #

get :: Get AlgReal #

putList :: [AlgReal] -> Put #

Serial AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

serialize :: MonadPut m => AlgReal -> m () #

deserialize :: MonadGet m => m AlgReal #

Serialize AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

NFData AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

rnf :: AlgReal -> () #

Generic AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

from :: AlgReal -> Rep AlgReal x #

to :: Rep AlgReal x -> AlgReal #

Num AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Fractional AlgReal Source #

Unlike sbv, we throw the error when divided by zero happens

Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Real AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Show AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Eq AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

(==) :: AlgReal -> AlgReal -> Bool #

(/=) :: AlgReal -> AlgReal -> Bool #

Ord AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Apply AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Associated Types

type FunType AlgReal 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

FdivOr AlgReal Source # 
Instance details

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

EvalSym AlgReal Source # 
Instance details

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

Methods

evalSym :: Bool -> Model -> AlgReal -> AlgReal Source #

ExtractSym AlgReal Source # 
Instance details

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

Mergeable AlgReal Source # 
Instance details

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

PPrint AlgReal Source # 
Instance details

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

SubstSym AlgReal Source # 
Instance details

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 # 
Instance details

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

SymOrd AlgReal Source # 
Instance details

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

AllSyms AlgReal Source # 
Instance details

Defined in Grisette.Internal.Internal.Impl.SymPrim.AllSyms

NonFuncSBVRep AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

PEvalFloatingTerm AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFloatingTerm

PEvalFractionalTerm AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFractionalTerm

PEvalIEEEFPConvertibleTerm AlgReal Source # 
Instance details

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 # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalNumTerm

PEvalOrdTerm AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalOrdTerm

SBVRep AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

SupportedNonFuncPrim AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

SupportedPrim AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

SupportedPrimConstraint AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

SymRep AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymAlgReal

Associated Types

type SymType AlgReal 
Instance details

Defined in Grisette.Internal.SymPrim.SymAlgReal

UnifiedConRep AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep

Associated Types

type ConType AlgReal 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep

UnifiedSymRep AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep

Associated Types

type SymType AlgReal 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep

Hashable AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

hashWithSalt :: Int -> AlgReal -> Int #

hash :: AlgReal -> Int #

Solvable AlgReal SymAlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymAlgReal

ToCon SymAlgReal AlgReal Source # 
Instance details

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

ToSym AlgReal SymAlgReal Source # 
Instance details

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

LinkedRep AlgReal SymAlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymAlgReal

PEvalFromIntegralTerm Integer AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFromIntegralTerm

Lift AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

Methods

lift :: Quote m => AlgReal -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => AlgReal -> Code m AlgReal #

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

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

UnifiedFromIntegral 'C Integer AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedFromIntegral

UnifiedSolvable 'C AlgReal AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSolvable

UnifiedSolvable 'S SymAlgReal AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSolvable

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

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFdiv

(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, TryMerge m, ValidFP eb sb) => SafeFromFP NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # 
Instance details

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 # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedFromIntegral

(KnownNat n', 1 <= n') => UnifiedFromIntegral 'C (WordN n') AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedFromIntegral

ValidFP eb sb => IEEEFPConvertible AlgReal (FP eb sb) FPRoundingMode Source # 
Instance details

Defined in Grisette.Internal.SymPrim.FP

ValidFP eb sb => IEEEFPToAlgReal AlgReal (FP eb sb) FPRoundingMode Source # 
Instance details

Defined in Grisette.Internal.SymPrim.FP

Methods

fpToAlgReal :: AlgReal -> FP eb sb -> AlgReal Source #

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

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFromIntegralTerm

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

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.PEvalFromIntegralTerm

type Rep AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

type FunType AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.AlgReal

type NonFuncSBVBaseType AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

type PrimConstraint AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

type SBVType AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.Prim.Internal.Instances.SupportedPrim

type SymType AlgReal Source # 
Instance details

Defined in Grisette.Internal.SymPrim.SymAlgReal

type ConType AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep

type SymType AlgReal Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedRep