module Algebra.Z
( Z
, Ring(..)
) where
import Test.QuickCheck
import Algebra.Structures.IntegralDomain
import Algebra.Structures.EuclideanDomain
import Algebra.Structures.BezoutDomain
import Algebra.Structures.StronglyDiscrete
import Algebra.Structures.Coherent
import Algebra.Ideal
import Algebra.Matrix
import Algebra.PLM
type Z = Integer
instance Ring Z where
(<*>) = (*)
(<+>) = (+)
neg = negate
one = 1
zero = 0
instance CommutativeRing Z
instance IntegralDomain Z
propIntegralDomainZ :: Z -> Z -> Z -> Property
propIntegralDomainZ = propIntegralDomain
instance EuclideanDomain Z where
d = abs
quotientRemainder = quotRem
propEuclideanDomainZ :: Z -> Z -> Z -> Property
propEuclideanDomainZ = propEuclideanDomain
propBezoutDomainZ :: Ideal Z -> Z -> Z -> Z -> Property
propBezoutDomainZ = propBezoutDomain
propStronglyDiscreteZ :: Z -> Ideal Z -> Bool
propStronglyDiscreteZ = propStronglyDiscrete
instance Coherent Z where
solve = solveB
propCoherentZ :: Vector Z -> Bool
propCoherentZ = propCoherent
propSolveMxNZ :: Matrix Z -> Bool
propSolveMxNZ = propSolveMxN
propSolveGeneralEquationZ :: Vector Z -> Z -> Bool
propSolveGeneralEquationZ = propSolveGeneralEquation
propSolveGeneralZ :: Matrix Z -> Vector Z -> Property
propSolveGeneralZ = propSolveGeneral
propPLMZ :: Ideal Z -> Bool
propPLMZ id = propPLM id (computePLM_B id)