hasmtlib-1.0.0: A monad for interfacing with external SMT solvers
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Hasmtlib.Codec

Synopsis

Documentation

type family DefaultDecoded a :: Type where ... Source #

Compute the default Decoded Type for every functor-wrapper. Useful for instances using default signatures.

Equations

DefaultDecoded (f a) = f (Decoded a) 

class Codec a where Source #

Lift values to SMT-Values or decode them.

Minimal complete definition

Nothing

Associated Types

type Decoded a :: Type Source #

Methods

decode :: Solution -> a -> Maybe (Decoded a) Source #

Decode a value using given solution.

default decode :: (Traversable f, Codec b, a ~ f b, Decoded a ~ f (Decoded b)) => Solution -> a -> Maybe (Decoded a) Source #

encode :: Decoded a -> a Source #

Encode a value as constant.

default encode :: (Functor f, Codec b, a ~ f b, Decoded a ~ f (Decoded b)) => Decoded a -> a Source #

Instances

Instances details
Codec () Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded () Source #

Methods

decode :: Solution -> () -> Maybe (Decoded ()) Source #

encode :: Decoded () -> () Source #

Codec a => Codec (IntMap a) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (IntMap a) Source #

Codec a => Codec (Seq a) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Seq a) Source #

Methods

decode :: Solution -> Seq a -> Maybe (Decoded (Seq a)) Source #

encode :: Decoded (Seq a) -> Seq a Source #

Codec a => Codec (Tree a) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Tree a) Source #

Methods

decode :: Solution -> Tree a -> Maybe (Decoded (Tree a)) Source #

encode :: Decoded (Tree a) -> Tree a Source #

KnownSMTSort t => Codec (Expr t) Source #

Decode and evaluate expressions

Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Expr t) Source #

Methods

decode :: Solution -> Expr t -> Maybe (Decoded (Expr t)) Source #

encode :: Decoded (Expr t) -> Expr t Source #

Codec a => Codec (Maybe a) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Maybe a) Source #

Codec a => Codec [a] Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded [a] Source #

Methods

decode :: Solution -> [a] -> Maybe (Decoded [a]) Source #

encode :: Decoded [a] -> [a] Source #

(Codec a, Codec b) => Codec (Either a b) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Either a b) Source #

Methods

decode :: Solution -> Either a b -> Maybe (Decoded (Either a b)) Source #

encode :: Decoded (Either a b) -> Either a b Source #

Codec a => Codec (Map k a) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Map k a) Source #

Methods

decode :: Solution -> Map k a -> Maybe (Decoded (Map k a)) Source #

encode :: Decoded (Map k a) -> Map k a Source #

(Codec a, Codec b) => Codec (a, b) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b) Source #

Methods

decode :: Solution -> (a, b) -> Maybe (Decoded (a, b)) Source #

encode :: Decoded (a, b) -> (a, b) Source #

(Codec a, Codec b, Codec c) => Codec (a, b, c) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c) Source #

Methods

decode :: Solution -> (a, b, c) -> Maybe (Decoded (a, b, c)) Source #

encode :: Decoded (a, b, c) -> (a, b, c) Source #

(Codec a, Codec b, Codec c, Codec d) => Codec (a, b, c, d) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c, d) Source #

Methods

decode :: Solution -> (a, b, c, d) -> Maybe (Decoded (a, b, c, d)) Source #

encode :: Decoded (a, b, c, d) -> (a, b, c, d) Source #

(Codec a, Codec b, Codec c, Codec d, Codec e) => Codec (a, b, c, d, e) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c, d, e) Source #

Methods

decode :: Solution -> (a, b, c, d, e) -> Maybe (Decoded (a, b, c, d, e)) Source #

encode :: Decoded (a, b, c, d, e) -> (a, b, c, d, e) Source #

(Codec a, Codec b, Codec c, Codec d, Codec e, Codec f) => Codec (a, b, c, d, e, f) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c, d, e, f) Source #

Methods

decode :: Solution -> (a, b, c, d, e, f) -> Maybe (Decoded (a, b, c, d, e, f)) Source #

encode :: Decoded (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

(Codec a, Codec b, Codec c, Codec d, Codec e, Codec f, Codec g) => Codec (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c, d, e, f, g) Source #

Methods

decode :: Solution -> (a, b, c, d, e, f, g) -> Maybe (Decoded (a, b, c, d, e, f, g)) Source #

encode :: Decoded (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

(Codec a, Codec b, Codec c, Codec d, Codec e, Codec f, Codec g, Codec h) => Codec (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (a, b, c, d, e, f, g, h) Source #

Methods

decode :: Solution -> (a, b, c, d, e, f, g, h) -> Maybe (Decoded (a, b, c, d, e, f, g, h)) Source #

encode :: Decoded (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #