halg-core-0.6.0.0: Core types and functions of halg computational algebra suite.
Safe HaskellNone
LanguageHaskell2010

Algebra.Ring.Polynomial.Monomial

Synopsis

Documentation

newtype OrderedMonomial ordering n Source #

A wrapper for monomials with a certain (monomial) order.

Constructors

OrderedMonomial (Monomial n) 

Instances

Instances details
Eq (OrderedMonomial ordering n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

(==) :: OrderedMonomial ordering n -> OrderedMonomial ordering n -> Bool #

(/=) :: OrderedMonomial ordering n -> OrderedMonomial ordering n -> Bool #

(Eq (Monomial n), IsOrder n name) => Ord (OrderedMonomial name n) Source #

Special ordering for ordered-monomials.

Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

compare :: OrderedMonomial name n -> OrderedMonomial name n -> Ordering #

(<) :: OrderedMonomial name n -> OrderedMonomial name n -> Bool #

(<=) :: OrderedMonomial name n -> OrderedMonomial name n -> Bool #

(>) :: OrderedMonomial name n -> OrderedMonomial name n -> Bool #

(>=) :: OrderedMonomial name n -> OrderedMonomial name n -> Bool #

max :: OrderedMonomial name n -> OrderedMonomial name n -> OrderedMonomial name n #

min :: OrderedMonomial name n -> OrderedMonomial name n -> OrderedMonomial name n #

KnownNat n => Show (OrderedMonomial ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => Unital (OrderedMonomial ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

one :: OrderedMonomial ord n #

pow :: OrderedMonomial ord n -> Natural -> OrderedMonomial ord n #

productWith :: Foldable f => (a -> OrderedMonomial ord n) -> f a -> OrderedMonomial ord n #

KnownNat n => Division (OrderedMonomial ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

recip :: OrderedMonomial ord n -> OrderedMonomial ord n #

(/) :: OrderedMonomial ord n -> OrderedMonomial ord n -> OrderedMonomial ord n #

(\\) :: OrderedMonomial ord n -> OrderedMonomial ord n -> OrderedMonomial ord n #

(^) :: Integral n0 => OrderedMonomial ord n -> n0 -> OrderedMonomial ord n

KnownNat n => Multiplicative (OrderedMonomial ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

(*) :: OrderedMonomial ord n -> OrderedMonomial ord n -> OrderedMonomial ord n #

pow1p :: OrderedMonomial ord n -> Natural -> OrderedMonomial ord n #

productWith1 :: Foldable1 f => (a -> OrderedMonomial ord n) -> f a -> OrderedMonomial ord n #

Hashable (OrderedMonomial ordering n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

hashWithSalt :: Int -> OrderedMonomial ordering n -> Int #

hash :: OrderedMonomial ordering n -> Int #

NFData (OrderedMonomial ordering n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

rnf :: OrderedMonomial ordering n -> () #

Wrapped (OrderedMonomial ordering n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Associated Types

type Unwrapped (OrderedMonomial ordering n)

Methods

_Wrapped' :: Iso' (OrderedMonomial ordering n) (Unwrapped (OrderedMonomial ordering n))

OrderedMonomial ordering1 n1 ~ t => Rewrapped (OrderedMonomial ordering2 n2) t Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

type Unwrapped (OrderedMonomial ordering n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

type Unwrapped (OrderedMonomial ordering n) = Monomial n

class IsOrder (n :: Nat) (ordering :: Type) where Source #

Class to lookup ordering from its (type-level) name.

Methods

cmpMonomial :: Proxy ordering -> MonomialOrder n Source #

Instances

Instances details
KnownNat n => IsOrder n Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Revlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

IsOrder n ord => IsOrder n (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat n, IsOrder n ord, SingI ws) => IsOrder n (WeightOrder ws ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(IsOrder n ord, IsOrder m ord', KnownNat m, KnownNat n, k ~ (n + m)) => IsOrder k (ProductOrder n m ord ord') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

cmpMonomial :: Proxy (ProductOrder n m ord ord') -> MonomialOrder k Source #

class IsOrder n name => IsMonomialOrder n name Source #

Class for Monomial' orders.

Instances

Instances details
KnownNat n => IsMonomialOrder n Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsMonomialOrder n Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsMonomialOrder n Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

IsMonomialOrder n ord => IsMonomialOrder n (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat k, SingI ws, IsMonomialOrder k ord) => IsMonomialOrder k (WeightOrder ws ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat n, KnownNat m, IsMonomialOrder n o, IsMonomialOrder m o', k ~ (n + m)) => IsMonomialOrder k (ProductOrder n m o o') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

type MonomialOrder n = Monomial n -> Monomial n -> Ordering Source #

Monomial' order (of degree n). This should satisfy following laws: (1) Totality: forall a, b (a < b || a == b || b < a) (2) Additivity: a b == a + c <= b + c (3) Non-negative: forall a, 0 <= a

type IsStrongMonomialOrder ord = Forall (IsMonomialOrder' ord) Source #

Monomial' ordering which can do with monomials of arbitrary large arity.

data ProductOrder (n :: Nat) (m :: Nat) (a :: Type) (b :: Type) where Source #

Constructors

ProductOrder :: SNat n -> SNat m -> ord -> ord' -> ProductOrder n m ord ord' 

Instances

Instances details
(KnownNat n, KnownNat m, IsMonomialOrder n ord, IsMonomialOrder m ord', k ~ (n + m), KnownNat k) => EliminationType k (n :: Nat) (ProductOrder n m ord ord') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat n, KnownNat m, IsMonomialOrder n o, IsMonomialOrder m o', k ~ (n + m)) => IsMonomialOrder k (ProductOrder n m o o') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(IsOrder n ord, IsOrder m ord', KnownNat m, KnownNat n, k ~ (n + m)) => IsOrder k (ProductOrder n m ord ord') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

cmpMonomial :: Proxy (ProductOrder n m ord ord') -> MonomialOrder k Source #

productOrder :: forall ord ord' n m. (IsOrder n ord, IsOrder m ord', KnownNat n, KnownNat m) => Proxy (ProductOrder n m ord ord') -> MonomialOrder (n + m) Source #

productOrder' :: forall n ord ord' m. (IsOrder n ord, IsOrder m ord') => SNat n -> SNat m -> ord -> ord' -> MonomialOrder (n + m) Source #

type WeightProxy (v :: [Nat]) = SList v Source #

data WeightOrder (v :: [Nat]) (ord :: Type) where Source #

Constructors

WeightOrder :: SList (v :: [Nat]) -> Proxy ord -> WeightOrder v ord 

Instances

Instances details
(IsMonomialOrder k ord, ones ~ Replicate n 1, SingI ones, Length ones <= k, KnownNat k) => EliminationType k (n :: Nat) (WeightOrder ones ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat k, SingI ws, IsMonomialOrder k ord) => IsMonomialOrder k (WeightOrder ws ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat n, IsOrder n ord, SingI ws) => IsOrder n (WeightOrder ws ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

tryDiv :: (KnownNat n, Field r) => (r, OrderedMonomial ord n) -> (r, OrderedMonomial ord n) -> (r, OrderedMonomial ord n) Source #

data Lex Source #

Lexicographical order

Constructors

Lex 

Instances

Instances details
Eq Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

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

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

Ord Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

compare :: Lex -> Lex -> Ordering #

(<) :: Lex -> Lex -> Bool #

(<=) :: Lex -> Lex -> Bool #

(>) :: Lex -> Lex -> Bool #

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

max :: Lex -> Lex -> Lex #

min :: Lex -> Lex -> Lex #

Show Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

showsPrec :: Int -> Lex -> ShowS #

show :: Lex -> String #

showList :: [Lex] -> ShowS #

KnownNat n => IsMonomialOrder n Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => EliminationType n (m :: k) Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

class (IsMonomialOrder n ord, KnownNat n) => EliminationType n m ord Source #

Monomial' order which can be use to calculate n-th elimination ideal of m-ary polynomial. This should judge monomial to be bigger if it contains variables to eliminate.

Instances

Instances details
KnownNat n => EliminationType n (m :: k) Lex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(IsMonomialOrder k ord, ones ~ Replicate n 1, SingI ones, Length ones <= k, KnownNat k) => EliminationType k (n :: Nat) (WeightOrder ones ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

(KnownNat n, KnownNat m, IsMonomialOrder n ord, IsMonomialOrder m ord', k ~ (n + m), KnownNat k) => EliminationType k (n :: Nat) (ProductOrder n m ord ord') Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

type WeightedEliminationOrder (n :: Nat) (ord :: Type) = WeightOrder (Replicate n 1) ord Source #

lex :: KnownNat n => MonomialOrder n Source #

Lexicographical order. This *is* a monomial order.

revlex :: KnownNat n => MonomialOrder n Source #

Reversed lexicographical order. This is *not* a monomial order.

graded :: MonomialOrder n -> MonomialOrder n Source #

Convert ordering into graded one.

grlex :: KnownNat n => MonomialOrder n Source #

Graded lexicographical order. This *is* a monomial order.

grevlex :: MonomialOrder n Source #

Graded reversed lexicographical order. This *is* a monomial order.

weightOrder :: forall n ns ord. (KnownNat n, IsOrder n ord, SingI ns) => Proxy (WeightOrder ns ord) -> MonomialOrder n Source #

data Grevlex Source #

Graded reversed lexicographical order. Same as Graded Revlex.

Constructors

Grevlex 

Instances

Instances details
Eq Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

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

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

Ord Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Show Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsMonomialOrder n Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Grevlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

fromList :: SNat n -> [Int] -> Monomial n Source #

convert NAry list into Monomial'.

data Revlex Source #

Reversed lexicographical order

Constructors

Revlex 

Instances

Instances details
Eq Revlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

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

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

Ord Revlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Show Revlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Revlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

data Grlex Source #

Graded lexicographical order. Same as Graded Lex.

Constructors

Grlex 

Instances

Instances details
Eq Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

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

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

Ord Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

compare :: Grlex -> Grlex -> Ordering #

(<) :: Grlex -> Grlex -> Bool #

(<=) :: Grlex -> Grlex -> Bool #

(>) :: Grlex -> Grlex -> Bool #

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

max :: Grlex -> Grlex -> Grlex #

min :: Grlex -> Grlex -> Grlex #

Show Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

showsPrec :: Int -> Grlex -> ShowS #

show :: Grlex -> String #

showList :: [Grlex] -> ShowS #

KnownNat n => IsMonomialOrder n Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Grlex Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

newtype Graded ord Source #

Graded order from another monomial order.

Constructors

Graded ord 

Instances

Instances details
IsMonomialOrder n ord => IsMonomialOrder n (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

IsOrder n ord => IsOrder n (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Eq ord => Eq (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

(==) :: Graded ord -> Graded ord -> Bool #

(/=) :: Graded ord -> Graded ord -> Bool #

Ord ord => Ord (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

compare :: Graded ord -> Graded ord -> Ordering #

(<) :: Graded ord -> Graded ord -> Bool #

(<=) :: Graded ord -> Graded ord -> Bool #

(>) :: Graded ord -> Graded ord -> Bool #

(>=) :: Graded ord -> Graded ord -> Bool #

max :: Graded ord -> Graded ord -> Graded ord #

min :: Graded ord -> Graded ord -> Graded ord #

Read ord => Read (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Show ord => Show (Graded ord) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

showsPrec :: Int -> Graded ord -> ShowS #

show :: Graded ord -> String #

showList :: [Graded ord] -> ShowS #

varMonom :: SNat n -> Ordinal n -> Monomial n Source #

sOnes :: SNat n -> SList (Replicate n 1) Source #

withStrongMonomialOrder :: forall ord n r proxy (proxy' :: Nat -> Type). IsStrongMonomialOrder ord => proxy ord -> proxy' n -> (IsMonomialOrder n ord => r) -> r Source #

cmpAnyMonomial :: (IsStrongMonomialOrder ord, KnownNat n, KnownNat m) => Proxy ord -> Monomial n -> Monomial m -> Ordering Source #

Comparing monomials with different arity, padding with 0 at bottom of the shorter monomial to make the length equal.

orderMonomial :: proxy ord -> Monomial n -> OrderedMonomial ord n Source #

ifoldMapMonom :: (KnownNat n, Monoid m) => (Ordinal n -> Int -> m) -> Monomial n -> m Source #

Orphan instances

KnownNat n => Unital (Monomial n) Source # 
Instance details

Methods

one :: Monomial n #

pow :: Monomial n -> Natural -> Monomial n #

productWith :: Foldable f => (a -> Monomial n) -> f a -> Monomial n #

KnownNat n => Multiplicative (Monomial n) Source # 
Instance details

Methods

(*) :: Monomial n -> Monomial n -> Monomial n #

pow1p :: Monomial n -> Natural -> Monomial n #

productWith1 :: Foldable1 f => (a -> Monomial n) -> f a -> Monomial n #