expressions-0.5: Expressions and Formulae a la carte

Copyright(C) 2017-18 Jakub Daniel
LicenseBSD-style (see the file LICENSE)
MaintainerJakub Daniel <jakub.daniel@protonmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Expression

Description

Usage:

You can build expressions in predefined languages (QFLogic, QFLia, QFALia, Lia, ALia) using the smart constructors such as var, and, or, not, forall, exists (or operators .&., .|., .->., .<-., .<->.) or you can define your own sorted language as a fixpoint (IFix) of a sum (:+:) of indexed functors (IFunctor).

Synopsis

Documentation

data family Sing (a :: k) :: Type #

The singleton kind-indexed data family.

Instances
data Sing (a :: Bool) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (a :: Bool) where
data Sing (a :: Ordering) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (a :: Ordering) where
data Sing (n :: Nat) 
Instance details

Defined in Data.Singletons.TypeLits.Internal

data Sing (n :: Nat) where
data Sing (n :: Symbol) 
Instance details

Defined in Data.Singletons.TypeLits.Internal

data Sing (n :: Symbol) where
data Sing (a :: ()) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (a :: ()) where
data Sing (a :: Void) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (a :: Void)
data Sing (a :: All) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (a :: All) where
data Sing (a :: Any) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (a :: Any) where
data Sing (a :: Sort) Source # 
Instance details

Defined in Data.Expression.Sort

data Sing (a :: Sort) where
data Sing (b :: [a]) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (b :: [a]) where
  • SNil :: forall a (b :: [a]). Sing ([] :: [a])
  • SCons :: forall a (b :: [a]) (n1 :: a) (n2 :: [a]). Sing n1 -> Sing n2 -> Sing (n1 ': n2)
data Sing (b :: Maybe a) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (b :: Maybe a) where
data Sing (b :: Min a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Min a) where
data Sing (b :: Max a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Max a) where
data Sing (b :: First a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: First a) where
data Sing (b :: Last a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Last a) where
data Sing (a :: WrappedMonoid m) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (a :: WrappedMonoid m) where
data Sing (b :: Option a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Option a) where
data Sing (b :: Identity a) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (b :: Identity a) where
data Sing (b :: First a) 
Instance details

Defined in Data.Singletons.Prelude.Monoid

data Sing (b :: First a) where
data Sing (b :: Last a) 
Instance details

Defined in Data.Singletons.Prelude.Monoid

data Sing (b :: Last a) where
data Sing (b :: Dual a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Dual a) where
data Sing (b :: Sum a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Sum a) where
data Sing (b :: Product a) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup.Internal

data Sing (b :: Product a) where
data Sing (b :: Down a) 
Instance details

Defined in Data.Singletons.Prelude.Ord

data Sing (b :: Down a) where
data Sing (b :: NonEmpty a) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (b :: NonEmpty a) where
data Sing (b :: Endo a) 
Instance details

Defined in Data.Singletons.Prelude.Foldable

data Sing (b :: Endo a) where
data Sing (b :: MaxInternal a) 
Instance details

Defined in Data.Singletons.Prelude.Foldable

data Sing (b :: MaxInternal a) where
data Sing (b :: MinInternal a) 
Instance details

Defined in Data.Singletons.Prelude.Foldable

data Sing (b :: MinInternal a) where
data Sing (c :: Either a b) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (c :: Either a b) where
data Sing (c :: (a, b)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (c :: (a, b)) where
data Sing (c :: Arg a b) 
Instance details

Defined in Data.Singletons.Prelude.Semigroup

data Sing (c :: Arg a b) where
newtype Sing (f :: k1 ~> k2) 
Instance details

Defined in Data.Singletons.Internal

newtype Sing (f :: k1 ~> k2) = SLambda {}
data Sing (b :: StateL s a) 
Instance details

Defined in Data.Singletons.Prelude.Traversable

data Sing (b :: StateL s a) where
  • SStateL :: forall s a (b :: StateL s a) (x :: s ~> (s, a)). Sing x -> Sing (StateL x)
data Sing (b :: StateR s a) 
Instance details

Defined in Data.Singletons.Prelude.Traversable

data Sing (b :: StateR s a) where
  • SStateR :: forall s a (b :: StateR s a) (x :: s ~> (s, a)). Sing x -> Sing (StateR x)
data Sing (d :: (a, b, c)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (d :: (a, b, c)) where
data Sing (c :: Const a b) 
Instance details

Defined in Data.Singletons.Prelude.Const

data Sing (c :: Const a b) where
data Sing (e :: (a, b, c, d)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (e :: (a, b, c, d)) where
data Sing (f :: (a, b, c, d, e)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (f :: (a, b, c, d, e)) where
  • STuple5 :: forall a b c d e (f :: (a, b, c, d, e)) (n1 :: a) (n2 :: b) (n3 :: c) (n4 :: d) (n5 :: e). Sing n1 -> Sing n2 -> Sing n3 -> Sing n4 -> Sing n5 -> Sing ((,,,,) n1 n2 n3 n4 n5)
data Sing (g :: (a, b, c, d, e, f)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (g :: (a, b, c, d, e, f)) where
  • STuple6 :: forall a b c d e f (g :: (a, b, c, d, e, f)) (n1 :: a) (n2 :: b) (n3 :: c) (n4 :: d) (n5 :: e) (n6 :: f). Sing n1 -> Sing n2 -> Sing n3 -> Sing n4 -> Sing n5 -> Sing n6 -> Sing ((,,,,,) n1 n2 n3 n4 n5 n6)
data Sing (h :: (a, b, c, d, e, f, g)) 
Instance details

Defined in Data.Singletons.Prelude.Instances

data Sing (h :: (a, b, c, d, e, f, g)) where
  • STuple7 :: forall a b c d e f g (h :: (a, b, c, d, e, f, g)) (n1 :: a) (n2 :: b) (n3 :: c) (n4 :: d) (n5 :: e) (n6 :: f) (n7 :: g). Sing n1 -> Sing n2 -> Sing n3 -> Sing n4 -> Sing n5 -> Sing n6 -> Sing n7 -> Sing ((,,,,,,) n1 n2 n3 n4 n5 n6 n7)

data Sort Source #

A universe of recognized sorts

Constructors

BooleanSort

booleans (true, false)

IntegralSort

integers (..., -1, 0, 1, ...)

ArraySort Sort Sort

arrays indexed by Sort sort, containing elements of element sort

Instances
Eq Sort Source # 
Instance details

Defined in Data.Expression.Sort

Methods

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

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

Show Sort Source # 
Instance details

Defined in Data.Expression.Sort

Methods

showsPrec :: Int -> Sort -> ShowS #

show :: Sort -> String #

showList :: [Sort] -> ShowS #

SDecide Sort => SDecide Sort Source # 
Instance details

Defined in Data.Expression.Sort

Methods

(%~) :: Sing a -> Sing b -> Decision (a :~: b) #

SingKind Sort Source # 
Instance details

Defined in Data.Expression.Sort

Associated Types

type Demote Sort = (r :: Type) #

SingI BooleanSort Source # 
Instance details

Defined in Data.Expression.Sort

SingI IntegralSort Source # 
Instance details

Defined in Data.Expression.Sort

IEq1 IfThenElseF Source # 
Instance details

Defined in Data.Expression.IfThenElse

Methods

ieq1 :: IEq a => IfThenElseF a j -> IfThenElseF a j -> Bool Source #

IEq1 ArrayF Source # 
Instance details

Defined in Data.Expression.Array

Methods

ieq1 :: IEq a => ArrayF a j -> ArrayF a j -> Bool Source #

IEq1 ArithmeticF Source # 
Instance details

Defined in Data.Expression.Arithmetic

Methods

ieq1 :: IEq a => ArithmeticF a j -> ArithmeticF a j -> Bool Source #

IEq1 NegationF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => NegationF a j -> NegationF a j -> Bool Source #

IEq1 DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => DisjunctionF a j -> DisjunctionF a j -> Bool Source #

IEq1 ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => ConjunctionF a j -> ConjunctionF a j -> Bool Source #

IFoldable IfThenElseF Source # 
Instance details

Defined in Data.Expression.IfThenElse

Methods

ifold :: Monoid m => IfThenElseF (Const m) i' -> Const m i' Source #

IFoldable ArrayF Source # 
Instance details

Defined in Data.Expression.Array

Methods

ifold :: Monoid m => ArrayF (Const m) i' -> Const m i' Source #

IFoldable ArithmeticF Source # 
Instance details

Defined in Data.Expression.Arithmetic

Methods

ifold :: Monoid m => ArithmeticF (Const m) i' -> Const m i' Source #

IFoldable NegationF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => NegationF (Const m) i' -> Const m i' Source #

IFoldable DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => DisjunctionF (Const m) i' -> Const m i' Source #

IFoldable ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => ConjunctionF (Const m) i' -> Const m i' Source #

IFunctor IfThenElseF Source # 
Instance details

Defined in Data.Expression.IfThenElse

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). IfThenElseF a i' -> IfThenElseF b i' Source #

index :: IfThenElseF a i' -> Sing i' Source #

IFunctor ArrayF Source # 
Instance details

Defined in Data.Expression.Array

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ArrayF a i' -> ArrayF b i' Source #

index :: ArrayF a i' -> Sing i' Source #

IFunctor ArithmeticF Source # 
Instance details

Defined in Data.Expression.Arithmetic

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ArithmeticF a i' -> ArithmeticF b i' Source #

index :: ArithmeticF a i' -> Sing i' Source #

IFunctor NegationF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). NegationF a i' -> NegationF b i' Source #

index :: NegationF a i' -> Sing i' Source #

IFunctor DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). DisjunctionF a i' -> DisjunctionF b i' Source #

index :: DisjunctionF a i' -> Sing i' Source #

IFunctor ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ConjunctionF a i' -> ConjunctionF b i' Source #

index :: ConjunctionF a i' -> Sing i' Source #

ITraversable IfThenElseF Source # 
Instance details

Defined in Data.Expression.IfThenElse

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). IfThenElseF a i' -> f (IfThenElseF b i') Source #

ITraversable ArrayF Source # 
Instance details

Defined in Data.Expression.Array

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ArrayF a i' -> f (ArrayF b i') Source #

ITraversable ArithmeticF Source # 
Instance details

Defined in Data.Expression.Arithmetic

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ArithmeticF a i' -> f (ArithmeticF b i') Source #

ITraversable NegationF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). NegationF a i' -> f (NegationF b i') Source #

ITraversable DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). DisjunctionF a i' -> f (DisjunctionF b i') Source #

ITraversable ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ConjunctionF a i' -> f (ConjunctionF b i') Source #

IShow IfThenElseF Source # 
Instance details

Defined in Data.Expression.IfThenElse

IShow ArrayF Source # 
Instance details

Defined in Data.Expression.Array

IShow ArithmeticF Source # 
Instance details

Defined in Data.Expression.Arithmetic

IShow NegationF Source # 
Instance details

Defined in Data.Expression

IShow DisjunctionF Source # 
Instance details

Defined in Data.Expression

IShow ConjunctionF Source # 
Instance details

Defined in Data.Expression

IShow (EqualityF :: (k -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression.Equality

IShow (VarF :: (k -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ishow :: VarF (Const String) i -> Const String i Source #

IShow (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

IShow (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

IEq1 (EqualityF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression.Equality

Methods

ieq1 :: IEq a => EqualityF a j -> EqualityF a j -> Bool Source #

IEq1 (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => ExistentialF v a j -> ExistentialF v a j -> Bool Source #

IEq1 (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => UniversalF v a j -> UniversalF v a j -> Bool Source #

IEq1 (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => VarF a j -> VarF a j -> Bool Source #

IFoldable (EqualityF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression.Equality

Methods

ifold :: Monoid m => EqualityF (Const m) i' -> Const m i' Source #

IFoldable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => ExistentialF v (Const m) i' -> Const m i' Source #

IFoldable (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => UniversalF v (Const m) i' -> Const m i' Source #

IFoldable (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => VarF (Const m) i' -> Const m i' Source #

IFunctor (EqualityF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression.Equality

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). EqualityF a i' -> EqualityF b i' Source #

index :: EqualityF a i' -> Sing i' Source #

IFunctor (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ExistentialF v a i' -> ExistentialF v b i' Source #

index :: ExistentialF v a i' -> Sing i' Source #

IFunctor (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). UniversalF v a i' -> UniversalF v b i' Source #

index :: UniversalF v a i' -> Sing i' Source #

IFunctor (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). VarF a i' -> VarF b i' Source #

index :: VarF a i' -> Sing i' Source #

ITraversable (EqualityF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression.Equality

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). EqualityF a i' -> f (EqualityF b i') Source #

ITraversable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ExistentialF v a i' -> f (ExistentialF v b i') Source #

ITraversable (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). UniversalF v a i' -> f (UniversalF v b i') Source #

ITraversable (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). VarF a i' -> f (VarF b i') Source #

MaybeQuantified (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

MaybeQuantified (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

MaybeQuantified (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

(SingI n1, SingI n2) => SingI (ArraySort n1 n2 :: Sort) Source # 
Instance details

Defined in Data.Expression.Sort

Methods

sing :: Sing (ArraySort n1 n2) #

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

BoundedMeetSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

IfThenElseF :<: f => Parseable IfThenElseF f Source # 
Instance details

Defined in Data.Expression.IfThenElse

ArrayF :<: f => Parseable ArrayF f Source # 
Instance details

Defined in Data.Expression.Array

ArithmeticF :<: f => Parseable ArithmeticF f Source # 
Instance details

Defined in Data.Expression.Arithmetic

NegationF :<: f => Parseable NegationF f Source # 
Instance details

Defined in Data.Expression

DisjunctionF :<: f => Parseable DisjunctionF f Source # 
Instance details

Defined in Data.Expression

ConjunctionF :<: f => Parseable ConjunctionF f Source # 
Instance details

Defined in Data.Expression

(EqualityF :: (Sort -> Type) -> Sort -> Type) :<: f => Parseable (EqualityF :: (k -> Type) -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression.Equality

(ExistentialF v :<: f, SingI v) => Parseable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

(UniversalF v :<: f, SingI v) => Parseable (UniversalF v :: (Sort -> Type) -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

(VarF :: (Sort -> Type) -> Sort -> Type) :<: f => Parseable (VarF :: k -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

SingI d => SingI (TyCon1 (ArraySort d) :: Sort ~> Sort) Source # 
Instance details

Defined in Data.Expression.Sort

Methods

sing :: Sing (TyCon1 (ArraySort d)) #

SingI (TyCon2 ArraySort) Source # 
Instance details

Defined in Data.Expression.Sort

Methods

sing :: Sing (TyCon2 ArraySort) #

data Sing (a :: Sort) Source # 
Instance details

Defined in Data.Expression.Sort

data Sing (a :: Sort) where
type Demote Sort Source # 
Instance details

Defined in Data.Expression.Sort

type DynamicallySortedFix f = DynamicallySorted (IFix f) Source #

An expression of some sort (obtained for example during parsing)

data DynamicallySorted (d :: Sort -> *) where Source #

A value of some sort

Constructors

DynamicallySorted :: forall (s :: Sort) d. Sing s -> d s -> DynamicallySorted d 
Instances
(forall (s :: Sort). Eq (d s)) => Eq (DynamicallySorted d) Source # 
Instance details

Defined in Data.Expression.Sort

(forall (s :: Sort). Show (d s)) => Show (DynamicallySorted d) Source # 
Instance details

Defined in Data.Expression.Sort

data DynamicSort where Source #

Some sort (obtained for example during parsing)

Constructors

DynamicSort :: forall (s :: Sort). Sing s -> DynamicSort 
Instances
Eq DynamicSort Source # 
Instance details

Defined in Data.Expression.Sort

withSort :: forall a (s :: Sort). Sing s -> (SingI s => a) -> a Source #

Turn implicit sort parameter into explicit one

toStaticSort :: forall (s :: Sort). SingI s => DynamicSort -> Maybe (Sing s) Source #

Tries to convert some sort (DynamicSort) to a requested sort.

toDynamicallySorted :: forall d (s :: Sort). SingI s => d s -> DynamicallySorted d Source #

Converts a statically sorted expression to a dynamically sorted one.

toStaticallySorted :: forall d (s :: Sort). SingI s => DynamicallySorted d -> Maybe (d s) Source #

Tries to convert an expression (DynamicallySorted) of some sort to an expression of requested sort. Performs no conversions.

parseSort :: Parser DynamicSort Source #

Parser that accepts sort definitions such as bool, int, array int int, array int (array ...).

type QFLogicF = EqualityF :+: (ConjunctionF :+: (DisjunctionF :+: (NegationF :+: VarF))) Source #

A functor representing propositional logic embedded in first order logic (quantifier-free, boolean variables aka propositions, logical connectives and, or, not, equality of propositions)

type QFLiaF = ArithmeticF :+: (IfThenElseF :+: QFLogicF) Source #

A functor representing the language of quantifier-free linear integer arithmetic theory in first order logic (integer constants, integer variables, addition, multiplication, divisibility, ordering)

type LiaF = ExistentialF BooleanSort :+: (ExistentialF IntegralSort :+: (UniversalF BooleanSort :+: (UniversalF IntegralSort :+: QFLiaF))) Source #

A functor much like QFLiaF with quantifiers over booleans and integers

type QFALiaF = ArrayF :+: QFLiaF Source #

A functor representing the language of quantifier-free linear integer arithmetic and array theories in first order logic (much like QFLiaF with additional array variables, select, and store)

type ALiaF = ExistentialF BooleanSort :+: (ExistentialF IntegralSort :+: (UniversalF BooleanSort :+: (UniversalF IntegralSort :+: QFALiaF))) Source #

A functor much like QFALiaF with quantifiers over booleans and integers

type Var = IFix VarF Source #

A language consisting solely of variables (useful for listing variables outside of any particular context, such as bound variables of quantified formula)

type QFLogic = IFix QFLogicF Source #

A language obtained as fixpoint of QFLogicF

type QFLia = IFix QFLiaF Source #

A language obtained as fixpoint of QFLiaF

type Lia = IFix LiaF Source #

A language obtained as fixpoint of LiaF

type QFALia = IFix QFALiaF Source #

A language obtained as fixpoint of QFALiaF

type ALia = IFix ALiaF Source #

A language obtained as fixpoint of ALiaF

type VariableName = String Source #

Type of names assigned to variables

data VarF a (s :: Sort) where Source #

A functor representing a sorted variable, each variable is identified by its name and sort

Constructors

Var :: VariableName -> Sing s -> VarF a s 
Instances
IShow (VarF :: (k -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ishow :: VarF (Const String) i -> Const String i Source #

IEq1 (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => VarF a j -> VarF a j -> Bool Source #

IFoldable (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => VarF (Const m) i' -> Const m i' Source #

IFunctor (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). VarF a i' -> VarF b i' Source #

index :: VarF a i' -> Sing i' Source #

ITraversable (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). VarF a i' -> f (VarF b i') Source #

MaybeQuantified (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

BoundedMeetSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

(VarF :: (Sort -> Type) -> Sort -> Type) :<: f => Parseable (VarF :: k -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

data ConjunctionF a (s :: Sort) where Source #

A functor representing a logical connective for conjunction

Constructors

And :: [a BooleanSort] -> ConjunctionF a BooleanSort 
Instances
IEq1 ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => ConjunctionF a j -> ConjunctionF a j -> Bool Source #

IFoldable ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => ConjunctionF (Const m) i' -> Const m i' Source #

IFunctor ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ConjunctionF a i' -> ConjunctionF b i' Source #

index :: ConjunctionF a i' -> Sing i' Source #

ITraversable ConjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ConjunctionF a i' -> f (ConjunctionF b i') Source #

IShow ConjunctionF Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

BoundedMeetSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

ConjunctionF :<: f => Parseable ConjunctionF f Source # 
Instance details

Defined in Data.Expression

data DisjunctionF a (s :: Sort) where Source #

A functor representing a logical connective for disjunction

Constructors

Or :: [a BooleanSort] -> DisjunctionF a BooleanSort 
Instances
IEq1 DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => DisjunctionF a j -> DisjunctionF a j -> Bool Source #

IFoldable DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => DisjunctionF (Const m) i' -> Const m i' Source #

IFunctor DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). DisjunctionF a i' -> DisjunctionF b i' Source #

index :: DisjunctionF a i' -> Sing i' Source #

ITraversable DisjunctionF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). DisjunctionF a i' -> f (DisjunctionF b i') Source #

IShow DisjunctionF Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

BoundedMeetSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

DisjunctionF :<: f => Parseable DisjunctionF f Source # 
Instance details

Defined in Data.Expression

data NegationF a (s :: Sort) where Source #

A functor representing a logical connective for negation

Constructors

Not :: a BooleanSort -> NegationF a BooleanSort 
Instances
IEq1 NegationF Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => NegationF a j -> NegationF a j -> Bool Source #

IFoldable NegationF Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => NegationF (Const m) i' -> Const m i' Source #

IFunctor NegationF Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). NegationF a i' -> NegationF b i' Source #

index :: NegationF a i' -> Sing i' Source #

ITraversable NegationF Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). NegationF a i' -> f (NegationF b i') Source #

IShow NegationF Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (QFALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

BoundedMeetSemiLattice (QFLia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (QFLogic BooleanSort) Source # 
Instance details

Defined in Data.Expression

NegationF :<: f => Parseable NegationF f Source # 
Instance details

Defined in Data.Expression

data UniversalF (v :: Sort) a (s :: Sort) where Source #

A functor representing a mono-sorted universal quantifier binding a number of variables within a formula

Constructors

Forall :: [Var v] -> a BooleanSort -> UniversalF v a BooleanSort 
Instances
IShow (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

IEq1 (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => UniversalF v a j -> UniversalF v a j -> Bool Source #

IFoldable (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => UniversalF v (Const m) i' -> Const m i' Source #

IFunctor (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). UniversalF v a i' -> UniversalF v b i' Source #

index :: UniversalF v a i' -> Sing i' Source #

ITraversable (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). UniversalF v a i' -> f (UniversalF v b i') Source #

MaybeQuantified (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

(UniversalF v :<: f, SingI v) => Parseable (UniversalF v :: (Sort -> Type) -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

data ExistentialF (v :: Sort) a (s :: Sort) where Source #

A functor representing a mono-sorted existential quantifier binding a number of variables within a formula

Constructors

Exists :: [Var v] -> a BooleanSort -> ExistentialF v a BooleanSort 
Instances
IShow (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

IEq1 (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ieq1 :: IEq a => ExistentialF v a j -> ExistentialF v a j -> Bool Source #

IFoldable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

ifold :: Monoid m => ExistentialF v (Const m) i' -> Const m i' Source #

IFunctor (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

imap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ExistentialF v a i' -> ExistentialF v b i' Source #

index :: ExistentialF v a i' -> Sing i' Source #

ITraversable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Methods

itraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ExistentialF v a i' -> f (ExistentialF v b i') Source #

MaybeQuantified (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

Heyting (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Heyting (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Lattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedJoinSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

BoundedMeetSemiLattice (ALia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: ALia BooleanSort #

BoundedMeetSemiLattice (Lia BooleanSort) Source # 
Instance details

Defined in Data.Expression

Methods

top :: Lia BooleanSort #

(ExistentialF v :<: f, SingI v) => Parseable (ExistentialF v :: (Sort -> Type) -> Sort -> Type) f Source # 
Instance details

Defined in Data.Expression

newtype Substitution f Source #

Substitution that given an expression produces replacement if the expression is to be replaced or nothing otherwise.

Constructors

Substitution 

Fields

Instances
Semigroup (Substitution f) Source # 
Instance details

Defined in Data.Expression

Monoid (Substitution f) Source # 
Instance details

Defined in Data.Expression

substitute :: (IFunctor f, IEq1 f) => IFix f s -> Substitution f -> IFix f s Source #

Executes a substitution.

for :: forall f (s :: Sort). (IFunctor f, IEq1 f) => IFix f s -> IFix f s -> Substitution f Source #

A simple constructor of substitutions that replaces the latter expression with the former.

var :: forall f s. (VarF :<: f, SingI s) => VariableName -> IFix f s Source #

A smart constructor for variables of any sort in any language Takes the variable name and infers the target language and sort from context.

var "a" :: Lia 'IntegralSort

dynvar :: forall f (s :: Sort). VarF :<: f => VariableName -> Sing s -> DynamicallySortedFix f Source #

Like var except it hides the sort inside DynamicallySortedFix

true :: ConjunctionF :<: f => IFix f BooleanSort Source #

Logical tautology

false :: DisjunctionF :<: f => IFix f BooleanSort Source #

Logical contradiction

and :: ConjunctionF :<: f => [IFix f BooleanSort] -> IFix f BooleanSort Source #

A smart constructor for variadic conjunction

or :: DisjunctionF :<: f => [IFix f BooleanSort] -> IFix f BooleanSort Source #

A smart constructor for variadic disjunction

not :: NegationF :<: f => IFix f BooleanSort -> IFix f BooleanSort Source #

A smart constructor for negation

forall :: UniversalF v :<: f => [Var v] -> IFix f BooleanSort -> IFix f BooleanSort Source #

A smart constructor for universally quantified formulae

exists :: ExistentialF v :<: f => [Var v] -> IFix f BooleanSort -> IFix f BooleanSort Source #

A smart constructor for existentially quantified formulae

(.&.) :: ConjunctionF :<: f => IFix f BooleanSort -> IFix f BooleanSort -> IFix f BooleanSort infixr 6 Source #

A smart constructor for binary conjunction

(.|.) :: DisjunctionF :<: f => IFix f BooleanSort -> IFix f BooleanSort -> IFix f BooleanSort infixr 5 Source #

A smart constructor for binary disjunction

(.->.) :: (DisjunctionF :<: f, NegationF :<: f) => IFix f BooleanSort -> IFix f BooleanSort -> IFix f BooleanSort infixr 4 Source #

A smart constructor for implication (an abbreviation for not a .|. b)

(.<-.) :: (DisjunctionF :<: f, NegationF :<: f) => IFix f BooleanSort -> IFix f BooleanSort -> IFix f BooleanSort infixl 4 Source #

A smart constructor for reversed implication (an abbreviation for a .|. not b)

(.<->.) :: (ConjunctionF :<: f, DisjunctionF :<: f, NegationF :<: f) => IFix f BooleanSort -> IFix f BooleanSort -> IFix f BooleanSort infix 3 Source #

A smart constructor for if-and-only-if connective

(./=.) :: forall f s. (NegationF :<: f, EqualityF :<: f, SingI s) => IFix f s -> IFix f s -> IFix f BooleanSort infix 7 Source #

A smart constructor for disequality

literals :: (ConjunctionF :<: f, DisjunctionF :<: f) => IFix f BooleanSort -> [IFix f BooleanSort] Source #

literals decomposes a boolean combination (formed with conjunctions and disjunctions, preferably in negation normal form) into its constituents.

conjuncts :: ConjunctionF :<: f => IFix f BooleanSort -> [IFix f BooleanSort] Source #

conjuncts decomposes a conjunction into conjuncts.

disjuncts :: DisjunctionF :<: f => IFix f BooleanSort -> [IFix f BooleanSort] Source #

disjuncts decomposes a disjunction into disjuncts.

vars :: (VarF :<: f, IFoldable f, IFunctor f) => IFix f s -> [DynamicallySorted Var] Source #

Collects a list of all variables occurring in an expression (bound or free).

freevars :: (IFunctor f, MaybeQuantified f) => IFix f s -> [DynamicallySorted Var] Source #

Collects a list of all free variables occurring in an expression.

freenames :: forall f (s :: Sort). (VarF :<: f, IFunctor f, IFoldable f) => IFix f s -> VariableNamePool Source #

class MaybeQuantified f Source #

Minimal complete definition

isQuantified', freevars'

Instances
(IFunctor f, IFoldable f) => MaybeQuantified (f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Expression

MaybeQuantified (ExistentialF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

MaybeQuantified (UniversalF v :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

MaybeQuantified (VarF :: (Sort -> Type) -> Sort -> Type) Source # 
Instance details

Defined in Data.Expression

(MaybeQuantified f, MaybeQuantified g) => MaybeQuantified (f :+: g :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.Expression

isQuantified :: MaybeQuantified f => IFix f s -> Bool Source #

Test whether an expression contains a quantifier.

isQuantifierFree :: MaybeQuantified f => IFix f s -> Bool Source #

Tests whether an expression is free of any quantifier.

class (NegationF :<: f, HasDual f f) => NNF f Source #

Instances
(NegationF :<: f, HasDual f f) => NNF f Source # 
Instance details

Defined in Data.Expression

nnf :: forall f. NNF f => IFix f BooleanSort -> IFix f BooleanSort Source #

Propagates negation toward boolean atoms (across conjunction, disjunction, quantifiers).

class (VarF :<: f, NegationF :<: f, IFunctor f, IFoldable f, ITraversable f, HasDual f f, MaybeQuantified' f f) => Prenex f Source #

Instances
((VarF :: (Sort -> Type) -> Sort -> Type) :<: f, NegationF :<: f, IFunctor f, IFoldable f, ITraversable f, HasDual f f, MaybeQuantified' f f) => Prenex f Source # 
Instance details

Defined in Data.Expression

prenex :: forall f. Prenex f => IFix f BooleanSort -> IFix f BooleanSort Source #

Puts an expression into prenex form (quantifier prefix and a quantifier-free formula).

class (VarF :<: f, Bind f f, Bind' f f, MaybeQuantified'' f f, IFoldable f, ITraversable f) => Flatten f Source #

Instances
((VarF :: (Sort -> Type) -> Sort -> Type) :<: f, Bind f f, Bind' f f, MaybeQuantified'' f f, IFoldable f, ITraversable f) => Flatten f Source # 
Instance details

Defined in Data.Expression

flatten :: forall f. Flatten f => IFix f BooleanSort -> IFix f BooleanSort Source #

Replaces non-variable and non-constant arguments to uninterpreted functions (such as select and store) with a fresh bound (universally or existentially) variable that is bound to the original term.

class (VarF :<: f, EqualityF :<: f, Bind f f, Bind' f f, MaybeQuantified'' f f, Forall f f, Axiomatized f f, IFoldable f, ITraversable f) => Unstore f Source #

Instances
((VarF :: (Sort -> Type) -> Sort -> Type) :<: f, (EqualityF :: (Sort -> Type) -> Sort -> Type) :<: f, Bind f f, Bind' f f, MaybeQuantified'' f f, Forall f f, Axiomatized f f, IFoldable f, ITraversable f) => Unstore f Source # 
Instance details

Defined in Data.Expression

unstore :: forall f. Unstore f => IFix f BooleanSort -> IFix f BooleanSort Source #

Replaces store with an instance of its axiomatization.