oalg-base-1.1.4.0: Algebraic structures on oriented entities and limits as a tool kit to solve algebraic problems.
Copyright(c) Erich Gut
LicenseBSD3
Maintainerzerich.gut@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

OAlg.Entity.Sum.Definition

Description

definition of free Sums over Fibred symbols.

Synopsis

Sum

data Sum r a Source #

free sum over Fibred symbols in a with scalars in r.

Definition A Sum s is valid if and only if its underlying SumForm s' is valid and s' is reduced, i.e. s' == reduce s'.

Instances

Instances details
(Fibred a, Entity r) => Show (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

showsPrec :: Int -> Sum r a -> ShowS #

show :: Sum r a -> String #

showList :: [Sum r a] -> ShowS #

(Fibred a, Entity r) => Eq (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

(==) :: Sum r a -> Sum r a -> Bool #

(/=) :: Sum r a -> Sum r a -> Bool #

(Fibred a, OrdRoot a, Ord r, Ord a, Entity r) => Ord (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

compare :: Sum r a -> Sum r a -> Ordering #

(<) :: Sum r a -> Sum r a -> Bool #

(<=) :: Sum r a -> Sum r a -> Bool #

(>) :: Sum r a -> Sum r a -> Bool #

(>=) :: Sum r a -> Sum r a -> Bool #

max :: Sum r a -> Sum r a -> Sum r a #

min :: Sum r a -> Sum r a -> Sum r a #

(Fibred a, Ord a, Semiring r, Commutative r) => Constructable (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

make :: Form (Sum r a) -> Sum r a Source #

Exposable (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Associated Types

type Form (Sum r a) Source #

Methods

form :: Sum r a -> Form (Sum r a) Source #

(Distributive r, Total r, Commutative r, Fibred a) => Validable (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

valid :: Sum r a -> Statement Source #

(Fibred a, Semiring r, Commutative r) => Entity (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

(Fibred a, Ord a, Ring r, Commutative r) => Abelian (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

negate :: Sum r a -> Sum r a Source #

(-) :: Sum r a -> Sum r a -> Sum r a Source #

ztimes :: Z -> Sum r a -> Sum r a Source #

(Fibred a, Ord a, Semiring r, Commutative r) => Additive (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

zero :: Root (Sum r a) -> Sum r a Source #

(+) :: Sum r a -> Sum r a -> Sum r a Source #

ntimes :: N -> Sum r a -> Sum r a Source #

(Fibred a, Semiring r, Commutative r) => Fibred (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Associated Types

type Root (Sum r a) Source #

Methods

root :: Sum r a -> Root (Sum r a) Source #

(Fibred a, Ord a, Semiring r, Commutative r) => Vectorial (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Associated Types

type Scalar (Sum r a) Source #

Methods

(!) :: Scalar (Sum r a) -> Sum r a -> Sum r a Source #

type Form (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

type Form (Sum r a) = SumForm r a
type Root (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

type Root (Sum r a) = Root a
type Scalar (Sum r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

type Scalar (Sum r a) = r

smlc :: Semiring r => Sum r a -> LinearCombination r a Source #

the associated linear combination.

Note The associated linear combination of a sum is sorted according to the second component!

smJoin :: (Semiring r, Commutative r, Fibred a, Ord a) => Sum r (Sum r a) -> Sum r a Source #

joining a sum of sums.

nSum :: (Hom Fbr h, Additive x) => h a x -> Sum N a -> x Source #

additive homomorphism for sums over N.

zSum :: (Hom Fbr h, Abelian x) => h a x -> Sum Z a -> x Source #

additive homomorphism for sums over Z.

smMap :: (Singleton (Root y), Fibred y, Ord y, Semiring r, Commutative r) => (x -> y) -> Sum r x -> Sum r y Source #

additive homomorphism to a totally defined sum.

Form

data SumForm r a Source #

form for a free sum over Fibred symbols in a with scalars in r.

Definition Let r be a Commutative Semiring and a a Fibred structure. A SumForm a is valid if and only if all scalars in a are valid and all symbols in a are valid and have the same root.

Constructors

Zero (Root a) 
S a 
r :! (SumForm r a) infixr 9 
(SumForm r a) :+ (SumForm r a) infixr 6 

Instances

Instances details
Foldable (SumForm N) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

fold :: Monoid m => SumForm N m -> m #

foldMap :: Monoid m => (a -> m) -> SumForm N a -> m #

foldMap' :: Monoid m => (a -> m) -> SumForm N a -> m #

foldr :: (a -> b -> b) -> b -> SumForm N a -> b #

foldr' :: (a -> b -> b) -> b -> SumForm N a -> b #

foldl :: (b -> a -> b) -> b -> SumForm N a -> b #

foldl' :: (b -> a -> b) -> b -> SumForm N a -> b #

foldr1 :: (a -> a -> a) -> SumForm N a -> a #

foldl1 :: (a -> a -> a) -> SumForm N a -> a #

toList :: SumForm N a -> [a] #

null :: SumForm N a -> Bool #

length :: SumForm N a -> Int #

elem :: Eq a => a -> SumForm N a -> Bool #

maximum :: Ord a => SumForm N a -> a #

minimum :: Ord a => SumForm N a -> a #

sum :: Num a => SumForm N a -> a #

product :: Num a => SumForm N a -> a #

(Fibred a, Entity r) => Show (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

showsPrec :: Int -> SumForm r a -> ShowS #

show :: SumForm r a -> String #

showList :: [SumForm r a] -> ShowS #

(Fibred a, Entity r) => Eq (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

(==) :: SumForm r a -> SumForm r a -> Bool #

(/=) :: SumForm r a -> SumForm r a -> Bool #

(Fibred a, Entity r, OrdRoot a, Ord r, Ord a) => Ord (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

compare :: SumForm r a -> SumForm r a -> Ordering #

(<) :: SumForm r a -> SumForm r a -> Bool #

(<=) :: SumForm r a -> SumForm r a -> Bool #

(>) :: SumForm r a -> SumForm r a -> Bool #

(>=) :: SumForm r a -> SumForm r a -> Bool #

max :: SumForm r a -> SumForm r a -> SumForm r a #

min :: SumForm r a -> SumForm r a -> SumForm r a #

LengthN (SumForm N a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

lengthN :: SumForm N a -> N Source #

(Fibred a, Ord a, Semiring r, Commutative r) => Reducible (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

reduce :: SumForm r a -> SumForm r a Source #

(Fibred a, Semiring r, Commutative r) => Validable (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

valid :: SumForm r a -> Statement Source #

(Fibred a, Semiring r, Commutative r) => Entity (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

(Fibred a, Semiring r, Commutative r) => Fibred (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Associated Types

type Root (SumForm r a) Source #

Methods

root :: SumForm r a -> Root (SumForm r a) Source #

type Root (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

type Root (SumForm r a) = Root a

smfLength :: Number r => SumForm r a -> N Source #

the length of a sum form,

smflc :: Semiring r => SumForm r a -> LinearCombination r a Source #

transforming a sum form to its corresponding linear combination..

lcsmf :: Semiring r => Root a -> LinearCombination r a -> SumForm r a Source #

transforming a word to its corresponding sum form.

smfMap :: Singleton (Root y) => (x -> y) -> SumForm r x -> SumForm r y Source #

mapping of sum forms.

smfJoin :: SumForm r (SumForm r a) -> SumForm r a Source #

joining a sum form of sum forms.

smfReduce :: (Fibred a, Ord a, Semiring r, Commutative r) => SumForm r a -> SumForm r a Source #

reducing a sum form to its canonical form,

Linear Combination

newtype LinearCombination r a Source #

list of symbols in a together with a scalar in r.

Note valid linear combinations must not be sorted according to the second component!

Constructors

LinearCombination [(r, a)] 

Instances

Instances details
(Show r, Show a) => Show (LinearCombination r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

(Eq r, Eq a) => Eq (LinearCombination r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

(Validable r, Validable a) => Validable (LinearCombination r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

(Entity a, Entity r) => Entity (LinearCombination r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

lcs :: LinearCombination r a -> [(r, a)] Source #

the underlying list of symbols with their scalar.

lcAggr :: (Eq a, Semiring r) => LinearCombination r a -> LinearCombination r a Source #

aggregating linear combinations with same symbols.

lcSort :: Ord a => LinearCombination r a -> LinearCombination r a Source #

sorting a linear combination according to its symbols.

lcSclFilter :: (r -> Bool) -> LinearCombination r a -> LinearCombination r a Source #

filtering a word according to the scalars.