-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Factoring integers and polynomials -- -- This package contains a reference implementation library of factoring -- algorithms for integers and univariate polynomials @package factor @version 1.5 module Factor.Gaussian data Gaussian Gaussian :: Integer -> Integer -> Gaussian real :: Integer -> Gaussian imaginary :: Integer -> Gaussian zero :: Gaussian one :: Gaussian negate :: Gaussian -> Gaussian add :: Gaussian -> Gaussian -> Gaussian subtract :: Gaussian -> Gaussian -> Gaussian multiply :: Gaussian -> Gaussian -> Gaussian norm :: Gaussian -> Integer division :: Gaussian -> Gaussian -> (Gaussian, Gaussian) quotient :: Gaussian -> Gaussian -> Gaussian remainder :: Gaussian -> Gaussian -> Gaussian divides :: Gaussian -> Gaussian -> Bool egcd :: Gaussian -> Gaussian -> (Gaussian, (Gaussian, Gaussian)) gcd :: Gaussian -> Gaussian -> Gaussian instance GHC.Classes.Ord Factor.Gaussian.Gaussian instance GHC.Classes.Eq Factor.Gaussian.Gaussian instance GHC.Show.Show Factor.Gaussian.Gaussian module Factor.Util type Factor f a = Either f a runFactor :: Show f => Factor f a -> a data Verbose a ResultVerbose :: a -> Verbose a CommentVerbose :: String -> Verbose a -> Verbose a timestampFormat :: String comment :: String -> Verbose () runQuiet :: Verbose a -> a runVerbose :: Verbose a -> IO a runTimestampVerbose :: Verbose a -> IO a isUnit :: Integer -> Bool divides :: Integer -> Integer -> Bool properDivisor :: Integer -> Integer -> Bool division :: Integer -> Integer -> (Integer, Integer) divisionClosest :: Integer -> Integer -> (Integer, Integer) exactQuotient :: Integer -> Integer -> Maybe Integer divPower :: Integer -> Integer -> (Integer, Integer) factorial :: Integer -> Integer egcd :: Integer -> Integer -> (Integer, (Integer, Integer)) coprime :: Integer -> Integer -> Bool chineseRemainder :: Integer -> Integer -> Integer -> Integer -> Integer nthRoot :: Integer -> Integer -> Integer nthRootClosest :: Integer -> Integer -> Integer destNthPower :: Integer -> Integer -> Maybe Integer isNthPower :: Integer -> Integer -> Bool destSquare :: Integer -> Maybe Integer isSquare :: Integer -> Bool type Width = Int bitsInteger :: Integer -> [Bool] widthInteger :: Integer -> Width widthIntegerToString :: Integer -> String uniformInteger :: RandomGen r => Width -> r -> (Integer, r) uniformOddInteger :: RandomGen r => Width -> r -> (Integer, r) type Log2Integer = Double type Log2Probability = Double log2 :: Double -> Double log2e :: Double log2Integer :: Integer -> Log2Integer logInteger :: Integer -> Double exp2Integer :: Log2Integer -> Integer data Residue Residue :: Residue NonResidue :: Residue ZeroResidue :: Residue multiplyResidue :: Residue -> Residue -> Residue jacobiSymbol :: Integer -> Integer -> Residue singleton :: a -> [a] doubleton :: a -> a -> [a] tripleton :: a -> a -> a -> [a] unfoldlN :: (b -> (a, b)) -> Int -> b -> ([a], b) unfoldrN :: (b -> (a, b)) -> Int -> b -> ([a], b) unabbrevList :: [String] -> String abbrevList :: String -> [String] -> String underline :: String -> String data Table Table :: Bool -> Bool -> Int -> Table [borderTable] :: Table -> Bool [alignLeftTable] :: Table -> Bool [paddingTable] :: Table -> Int fmtTable :: Table -> [[String]] -> String ppTable :: [[String]] -> String instance GHC.Show.Show Factor.Util.Residue instance GHC.Classes.Ord Factor.Util.Residue instance GHC.Classes.Eq Factor.Util.Residue instance GHC.Show.Show Factor.Util.Table instance GHC.Base.Functor Factor.Util.Verbose instance GHC.Base.Applicative Factor.Util.Verbose instance GHC.Base.Monad Factor.Util.Verbose module Factor.Prime type Prime = Integer primes :: [Prime] type PrimePower = (Prime, Integer) multiplyPrimePowers :: [PrimePower] -> [PrimePower] -> [PrimePower] productPrimePowers :: [[PrimePower]] -> [PrimePower] factor :: [Prime] -> Integer -> ([PrimePower], Integer) factorProduct :: [Prime] -> [Integer] -> ([PrimePower], [Integer]) trialDivision :: Integer -> ([PrimePower], Integer) primesUnder :: Integer -> Integer primesUnderEstimate :: Log2Integer -> Log2Integer nthPrime :: Integer -> Integer nthPrimeEstimate :: Log2Integer -> Log2Integer smoothUnderLowerBound :: Integer -> Log2Integer -> Log2Integer smoothUnder :: Integer -> Log2Integer -> Log2Integer smoothProb :: Integer -> Width -> Log2Probability smoothProbTrials :: Integer -> Width -> Integer -> Log2Probability type Gfp = Integer valid :: Prime -> Gfp -> Bool fromInt :: Prime -> Int -> Gfp fromInteger :: Prime -> Integer -> Gfp toSmallestInteger :: Prime -> Gfp -> Integer negate :: Prime -> Gfp -> Gfp add :: Prime -> Gfp -> Gfp -> Gfp sum :: Prime -> [Gfp] -> Gfp subtract :: Prime -> Gfp -> Gfp -> Gfp multiply :: Prime -> Gfp -> Gfp -> Gfp square :: Prime -> Gfp -> Gfp cube :: Prime -> Gfp -> Gfp product :: Prime -> [Gfp] -> Gfp multiplyExp :: Prime -> Gfp -> Gfp -> Integer -> Gfp exp :: Prime -> Gfp -> Integer -> Gfp exp2 :: Prime -> Gfp -> Integer -> Gfp invertF :: Prime -> Gfp -> Factor Integer Gfp invert :: Prime -> Gfp -> Gfp divideF :: Prime -> Gfp -> Gfp -> Factor Integer Gfp divide :: Prime -> Gfp -> Gfp -> Gfp elements :: Prime -> [Gfp] uniform :: RandomGen r => Prime -> r -> (Gfp, r) uniformNonZero :: RandomGen r => Prime -> r -> (Gfp, r) millerRabinTrials :: Int isPrime :: RandomGen r => Integer -> r -> (Bool, r) nextPrime :: RandomGen r => Integer -> r -> (Prime, r) previousPrime :: RandomGen r => Integer -> r -> (Prime, r) uniformPrime :: RandomGen r => Int -> r -> (Prime, r) uniformComposite :: RandomGen r => Int -> r -> (Integer, r) isResidue :: Prime -> Integer -> Bool nonResidue :: Prime -> Integer -> Bool nextResidue :: Prime -> Integer -> Integer nextNonResidue :: Prime -> Integer -> Integer sqrt :: Prime -> Gfp -> Gfp module Factor.Term type Index = Int type Var = String data Term IntegerTerm :: Integer -> Term PrimeIndexTerm :: Index -> Term NumberWidthTerm :: Width -> Term PrimeWidthTerm :: Width -> Term CompositeWidthTerm :: Width -> Term NegateTerm :: Term -> Term AddTerm :: Term -> Term -> Term SubtractTerm :: Term -> Term -> Term MultiplyTerm :: Term -> Term -> Term ExpTerm :: Term -> Term -> Term VarTerm :: Var -> Term ModTerm :: Term -> Term -> Term LetTerm :: Var -> Term -> Term -> Term modulo :: Term -> Integer -> Term fromGfp :: Prime -> Gfp -> Term fromPrimePower :: PrimePower -> Term fromPrimePowers :: [PrimePower] -> Term mkSum :: [Term] -> Term mkProduct :: [Term] -> Term subterms :: Term -> [Term] data Result RewriteResult :: Term -> Result UnchangedResult :: Result ErrorResult :: Result newtype Rewrite Rewrite :: (Term -> Result) -> Rewrite [unRewrite] :: Rewrite -> Term -> Result applyRewrite :: Rewrite -> Term -> Maybe Term applyRewriteUnsafe :: Rewrite -> Term -> Term idRewrite :: Rewrite errorRewrite :: Rewrite tryRewrite :: Rewrite -> Rewrite thenRewrite :: Rewrite -> Rewrite -> Rewrite orelseRewrite :: Rewrite -> Rewrite -> Rewrite firstRewrite :: [Rewrite] -> Rewrite subtermRewrite :: Rewrite -> Rewrite bottomUpRewrite :: Rewrite -> Rewrite instVarRewrite :: Var -> Term -> Rewrite expandLetRewrite :: Rewrite -> (Rewrite -> Rewrite) -> Rewrite expandLetsRewrite :: Rewrite -> Rewrite uniform :: RandomGen r => Term -> r -> (Term, r) negativeIntegerRewrite :: Rewrite negateNegateRewrite :: Rewrite addNegate2Rewrite :: Rewrite subtractNegate2Rewrite :: Rewrite multiplyNegateRewrite :: Rewrite nnfInteger :: Term -> Term nnf :: Term -> Term multiplyOneRewrite :: Rewrite expOneRewrite :: Rewrite expZeroRewrite :: Rewrite simplify :: Term -> Term isReservedWord :: String -> Bool spaceParser :: Parsec String st () spacesParser :: Parsec String st () spaces1Parser :: Parsec String st () integerParser :: Parsec String st Integer indexParser :: Parsec String st Index widthParser :: Parsec String st Width classIndexParser :: Char -> Parsec String st Index primeIndexParser :: Parsec String st Index classWidthParser :: Char -> Parsec String st Width numberWidthParser :: Parsec String st Width primeWidthParser :: Parsec String st Width compositeWidthParser :: Parsec String st Width varParser :: Parsec String st Var termParser :: Parsec String st Term parse :: String -> Either ParseError Term fromString :: String -> Maybe Term indexToDoc :: Index -> Doc widthToDoc :: Width -> Doc atomicToDoc :: Term -> Doc expToDoc :: Term -> Doc prodToDoc :: Term -> Doc negateToDoc :: Term -> Doc sumToDoc :: Term -> Doc modToDoc :: Term -> Doc toDoc :: Term -> Doc toString :: Term -> String instance GHC.Show.Show Factor.Term.Term instance GHC.Classes.Ord Factor.Term.Term instance GHC.Classes.Eq Factor.Term.Term instance GHC.Show.Show Factor.Term.Result instance GHC.Classes.Ord Factor.Term.Result instance GHC.Classes.Eq Factor.Term.Result module Factor.Zx data Monomial Monomial :: Int -> Integer -> Monomial [degreeMonomial] :: Monomial -> Int [coeffMonomial] :: Monomial -> Integer isZeroMonomial :: Monomial -> Bool constantMonomial :: Integer -> Monomial negateMonomial :: Monomial -> Monomial toTermMonomial :: Var -> Monomial -> Term data Zx Zx :: Int -> IntMap Integer -> Zx [degree] :: Zx -> Int [coeffMap] :: Zx -> IntMap Integer valid :: Zx -> Bool fromNormCoeffMap :: IntMap Integer -> Zx isZero :: Zx -> Bool isOne :: Zx -> Bool isConstant :: Zx -> Bool isLinear :: Zx -> Bool isMonic :: Zx -> Bool powerCoeff :: Zx -> Int -> Integer constantCoeff :: Zx -> Integer linearCoeff :: Zx -> Integer leadingCoeff :: Zx -> Integer trailingCoeff :: Zx -> (Int, Integer) monomials :: Zx -> [(Int, Integer)] lengthMonomials :: Zx -> Int filterMonomials :: (Int -> Integer -> Bool) -> Zx -> Zx constant :: Integer -> Zx variable :: Zx monomial :: Int -> Integer -> Zx simpleRoot :: Integer -> Zx evaluate :: Zx -> Integer -> Integer derivative :: Zx -> Zx fromMonomial :: Monomial -> Zx fromMonomials :: [Monomial] -> Zx toMonomials :: Zx -> [Monomial] fromCoeff :: [Integer] -> Zx toCoeff :: Zx -> [Integer] toTerm :: Var -> Zx -> Term zero :: Zx one :: Zx negate :: Zx -> Zx add :: Zx -> Zx -> Zx sum :: [Zx] -> Zx subtract :: Zx -> Zx -> Zx multiply :: Zx -> Zx -> Zx square :: Zx -> Zx product :: [Zx] -> Zx multiplyConstant :: Integer -> Zx -> Zx multiplyPower :: Int -> Zx -> Zx multiplyExp :: Zx -> Zx -> Integer -> Zx exp :: Zx -> Integer -> Zx compose :: Zx -> Zx -> Zx division :: Zx -> Zx -> (Zx, Zx) quotient :: Zx -> Zx -> Zx remainder :: Zx -> Zx -> Zx divides :: Zx -> Zx -> Bool exactQuotientConstant :: Integer -> Zx -> Zx content :: Zx -> Integer isPrimitive :: Zx -> Bool contentPrimitive :: Zx -> (Integer, Zx) primitive :: Zx -> Zx gcd :: Zx -> Zx -> Zx gcdPrimitive :: Zx -> Zx -> Zx squareFree :: Zx -> Bool squareFreeDecomposition :: Zx -> [Zx] squareFreeRecomposition :: [Zx] -> Zx composePlusMinusSqrt :: Zx -> Integer -> Zx swinnertonDyer :: [Zx] instance GHC.Classes.Ord Factor.Zx.Monomial instance GHC.Classes.Eq Factor.Zx.Monomial instance GHC.Classes.Ord Factor.Zx.Zx instance GHC.Classes.Eq Factor.Zx.Zx instance GHC.Show.Show Factor.Zx.Zx instance GHC.Show.Show Factor.Zx.Monomial module Factor.Gfpx data Gfpx Gfpx :: Int -> IntMap Gfp -> Gfpx [degree] :: Gfpx -> Int [coeffMap] :: Gfpx -> IntMap Gfp valid :: Prime -> Gfpx -> Bool fromNormCoeffMap :: IntMap Gfp -> Gfpx fromCoeffMap :: IntMap Gfp -> Gfpx isZero :: Gfpx -> Bool isOne :: Gfpx -> Bool isConstant :: Gfpx -> Bool isLinear :: Gfpx -> Bool isMonic :: Gfpx -> Bool constMonic :: Prime -> Gfpx -> (Gfp, Gfpx) powerCoeff :: Gfpx -> Int -> Gfp constantCoeff :: Gfpx -> Gfp linearCoeff :: Gfpx -> Gfp leadingCoeff :: Gfpx -> Gfp monomials :: Gfpx -> [(Int, Gfp)] lengthMonomials :: Gfpx -> Int filterMonomials :: (Int -> Gfp -> Bool) -> Gfpx -> Gfpx constant :: Gfp -> Gfpx variable :: Gfpx monomial :: Int -> Gfp -> Gfpx simpleRoot :: Prime -> Gfp -> Gfpx evaluate :: Prime -> Gfpx -> Gfp -> Gfp derivative :: Prime -> Gfpx -> Gfpx fromCoeff :: [Gfp] -> Gfpx fromZx :: Prime -> Zx -> Gfpx toZx :: Gfpx -> Zx toSmallestZx :: Prime -> Gfpx -> Zx uniform :: RandomGen r => Prime -> Int -> r -> (Gfpx, r) polyToTerm :: Prime -> Var -> Gfpx -> Term toTerm :: Prime -> Var -> Gfpx -> Term zero :: Gfpx one :: Gfpx negate :: Prime -> Gfpx -> Gfpx add :: Prime -> Gfpx -> Gfpx -> Gfpx sum :: Prime -> [Gfpx] -> Gfpx subtract :: Prime -> Gfpx -> Gfpx -> Gfpx multiply :: Prime -> Gfpx -> Gfpx -> Gfpx square :: Prime -> Gfpx -> Gfpx cube :: Prime -> Gfpx -> Gfpx product :: Prime -> [Gfpx] -> Gfpx multiplyConstant :: Prime -> Gfp -> Gfpx -> Gfpx multiplyPower :: Int -> Gfpx -> Gfpx multiplyExp :: Prime -> Gfpx -> Gfpx -> Integer -> Gfpx exp :: Prime -> Gfpx -> Integer -> Gfpx compose :: Prime -> Gfpx -> Gfpx -> Gfpx division :: Prime -> Gfpx -> Gfpx -> (Gfpx, Gfpx) quotient :: Prime -> Gfpx -> Gfpx -> Gfpx remainder :: Prime -> Gfpx -> Gfpx -> Gfpx divides :: Prime -> Gfpx -> Gfpx -> Bool properDivisor :: Prime -> Gfpx -> Gfpx -> Bool egcd :: Prime -> Gfpx -> Gfpx -> (Gfpx, (Gfpx, Gfpx)) gcd :: Prime -> Gfpx -> Gfpx -> Gfpx chineseRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx -> Gfpx -> Gfpx multiplyRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx -> Gfpx squareRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx multiplyExpRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx -> Integer -> Gfpx expRemainder :: Prime -> Gfpx -> Gfpx -> Integer -> Gfpx composeRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx -> Gfpx invertRemainderF :: Prime -> Gfpx -> Gfpx -> Factor Gfpx Gfpx invertRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx divideRemainderF :: Prime -> Gfpx -> Gfpx -> Gfpx -> Factor Gfpx Gfpx divideRemainder :: Prime -> Gfpx -> Gfpx -> Gfpx -> Gfpx roots :: Prime -> Gfpx -> [Gfp] totallySplits :: Zx -> Prime -> Maybe [Gfp] irreducible :: Prime -> Gfpx -> Bool liftRoot :: Zx -> Prime -> Gfp -> [(Integer, Integer)] frobenius :: Prime -> Gfpx -> Gfpx frobeniusRange :: Prime -> Gfpx -> Bool frobeniusInverse :: Prime -> Gfpx -> Gfpx squareFree :: Prime -> Gfpx -> Bool squareFreeDecomposition :: Prime -> Gfpx -> [Gfpx] squareFreeRecomposition :: Prime -> [Gfpx] -> Gfpx matrixBerlekamp :: Prime -> Gfpx -> [[Gfp]] nullBerlekamp :: Prime -> [[Gfp]] -> Maybe [Gfp] splitBerlekamp :: Prime -> Gfpx -> Maybe (Gfpx, Gfpx) factorDistinctDegree :: Prime -> Gfpx -> [(Gfpx, Int)] factorEqualDegreeBerlekamp :: Prime -> Gfpx -> Int -> [Gfpx] factorEqualDegree :: RandomGen r => Prime -> Gfpx -> Int -> r -> ([Gfpx], r) factorSquareFreeBerlekamp :: Prime -> Gfpx -> [Gfpx] factorSquareFree :: RandomGen r => Prime -> Gfpx -> r -> ([Gfpx], r) factorMonicBerlekamp :: Prime -> Gfpx -> [(Gfpx, Integer)] factorMonic :: RandomGen r => Prime -> Gfpx -> r -> ([(Gfpx, Integer)], r) instance GHC.Classes.Ord Factor.Gfpx.Gfpx instance GHC.Classes.Eq Factor.Gfpx.Gfpx instance GHC.Show.Show Factor.Gfpx.Gfpx module Factor.Value data Value ZValue :: Integer -> Value ZxValue :: Zx -> Var -> Value GfpValue :: Prime -> Gfp -> Value GfpxValue :: Prime -> Gfpx -> Var -> Value free :: Value -> Set Var normalize :: Value -> Value negate :: Value -> Value add :: Value -> Value -> Value subtract :: Value -> Value -> Value multiply :: Value -> Value -> Value exp :: Value -> Value -> Value fromTerm :: Term -> Value toTerm :: Value -> Term toString :: Value -> String type Env = Map Var Value emptyEnv :: Env lookupEnv :: Env -> Var -> Value extendEnv :: Env -> Var -> Value -> Env data Context ZContext :: Context GfpContext :: Prime -> Context combineContext :: Context -> Context -> Context modContext :: Value -> Context context :: Value -> Context reduceInContext :: Context -> Value -> Value importIntoContext :: Context -> Value -> Value align :: Value -> Value -> (Value, Value) interpret :: Env -> Context -> Term -> Value instance GHC.Show.Show Factor.Value.Value instance GHC.Classes.Ord Factor.Value.Value instance GHC.Classes.Eq Factor.Value.Value instance GHC.Show.Show Factor.Value.Context instance GHC.Classes.Ord Factor.Value.Context instance GHC.Classes.Eq Factor.Value.Context module Factor.Nfzw data Nfzw Nfzw :: Integer -> Integer -> Nfzw valid :: Nfzw -> Bool filterValidLine :: (Nfzw -> Bool) -> Integer -> [Nfzw] filterValid :: (Nfzw -> Bool) -> [Nfzw] zero :: Nfzw isZero :: Nfzw -> Bool negate :: Nfzw -> Nfzw toInteger :: Integer -> Nfzw -> Integer norm :: Zx -> Nfzw -> Integer type Ideal = (Gfp, Prime) ideals :: Zx -> [Ideal] inIdeal :: Nfzw -> Ideal -> Bool factor :: Zx -> [Ideal] -> Nfzw -> ([(Ideal, Integer)], Integer) instance GHC.Classes.Ord Factor.Nfzw.Nfzw instance GHC.Classes.Eq Factor.Nfzw.Nfzw instance GHC.Show.Show Factor.Nfzw.Nfzw module Factor.Ec data Curve Curve :: Prime -> Gfp -> Gfp -> Curve [kCurve] :: Curve -> Prime [aCurve] :: Curve -> Gfp [bCurve] :: Curve -> Gfp data Point Point :: Gfp -> Gfp -> Point [xPoint] :: Point -> Gfp [yPoint] :: Point -> Gfp Infinity :: Point rhs :: Curve -> Gfpx rhsEvaluate :: Curve -> Gfp -> Gfp onCurve :: Curve -> Point -> Bool xPoints :: Curve -> Gfp -> [Point] points :: Curve -> [Point] discriminant :: Curve -> Gfp singular :: Curve -> Bool uniformCurve :: RandomGen r => Prime -> r -> ((Curve, Point), r) uniformPoint :: RandomGen r => Curve -> r -> (Point, r) negate :: Curve -> Point -> Point addLambdaF :: Curve -> Gfp -> Gfp -> Gfp -> Gfp -> Gfp -> Factor Integer Point doubleF :: Curve -> Point -> Factor Integer Point double :: Curve -> Point -> Point addF :: Curve -> Point -> Point -> Factor Integer Point add :: Curve -> Point -> Point -> Point addMultiplyF :: Curve -> Point -> Point -> Integer -> Factor Integer Point addMultiply :: Curve -> Point -> Point -> Integer -> Point multiplyF :: Curve -> Point -> Integer -> Factor Integer Point multiply :: Curve -> Point -> Integer -> Point data TargetConfig CurvePointTargetConfig :: Int -> TargetConfig PrimeTargetConfig :: Int -> TargetConfig data Config Config :: [TargetConfig] -> Config [targetConfig] :: Config -> [TargetConfig] defaultConfig :: Config limitPrimesConfig :: Maybe Int -> Config -> Config factorPrime :: [(Curve, Point)] -> Prime -> Factor Integer [(Curve, Point)] factorPrimes :: [(Curve, Point)] -> [Prime] -> Factor Integer [(Curve, Point)] factorTargets :: RandomGen r => Integer -> ([(Curve, Point)], Int) -> [TargetConfig] -> r -> Verbose (Maybe Integer, r) factor :: RandomGen r => Config -> Integer -> r -> Verbose (Maybe Integer, r) data DivisionPolynomial DivisionPolynomial :: Gfpx -> Gfpx -> Gfpx -> DivisionPolynomial [psiDivisionPolynomial] :: DivisionPolynomial -> Gfpx [phiDivisionPolynomial] :: DivisionPolynomial -> Gfpx [omegaDivisionPolynomial] :: DivisionPolynomial -> Gfpx psiDivisionPolynomials :: Curve -> [Gfpx] divisionPolynomials :: Curve -> [DivisionPolynomial] data End End :: Gfpx -> Gfpx -> End evaluateEnd :: Curve -> End -> Point -> Point identityEnd :: Curve -> Gfpx -> End composeEnd :: Curve -> Gfpx -> End -> End -> End negateEnd :: Curve -> End -> End addLambdaEnd :: Curve -> Gfpx -> Gfpx -> Gfpx -> Gfpx -> Gfpx -> Gfpx -> Factor Gfpx End doubleEnd :: Curve -> Gfpx -> End -> Factor Gfpx End addEnd :: Curve -> Gfpx -> End -> End -> Factor Gfpx End addMultiplyEnd :: Curve -> Gfpx -> End -> End -> Integer -> Factor Gfpx End multiplyEnd :: Curve -> Gfpx -> End -> Integer -> Factor Gfpx End frobeniusEnd :: Curve -> Gfpx -> End traceOfFrobeniusMod2 :: Curve -> Integer traceOfFrobeniusModOddPrime :: Curve -> Prime -> Gfpx -> Integer traceOfFrobenius :: Curve -> Integer supersingular :: Curve -> Bool order :: Curve -> Integer instance GHC.Classes.Ord Factor.Ec.Curve instance GHC.Classes.Eq Factor.Ec.Curve instance GHC.Classes.Ord Factor.Ec.Point instance GHC.Classes.Eq Factor.Ec.Point instance GHC.Show.Show Factor.Ec.TargetConfig instance GHC.Classes.Ord Factor.Ec.TargetConfig instance GHC.Classes.Eq Factor.Ec.TargetConfig instance GHC.Show.Show Factor.Ec.Config instance GHC.Classes.Ord Factor.Ec.Config instance GHC.Classes.Eq Factor.Ec.Config instance GHC.Show.Show Factor.Ec.DivisionPolynomial instance GHC.Classes.Ord Factor.Ec.DivisionPolynomial instance GHC.Classes.Eq Factor.Ec.DivisionPolynomial instance GHC.Classes.Ord Factor.Ec.End instance GHC.Classes.Eq Factor.Ec.End instance GHC.Show.Show Factor.Ec.End instance GHC.Show.Show Factor.Ec.Point instance GHC.Show.Show Factor.Ec.Curve module Factor.Bz factorCoeffBound :: Zx -> Integer monicGfpx :: Prime -> Zx -> Gfpx suitablePrime :: Zx -> Prime henselLiftQuadratic :: Zx -> (Integer, (Gfpx, Gfpx, Gfpx, Gfpx)) -> (Integer, (Gfpx, Gfpx, Gfpx, Gfpx)) henselLiftModulus :: Zx -> Prime -> (Int, Integer) henselLiftFactors :: Zx -> Prime -> Int -> [Gfpx] -> [Gfpx] recombineFactors :: Zx -> Integer -> [Gfpx] -> [Zx] factorSquareFree :: Zx -> [Zx] factorPrimitive :: Zx -> [(Zx, Integer)] factor :: Zx -> (Integer, [(Zx, Integer)]) irreducible :: Zx -> Bool module Factor.Nfs data PolynomialDegree FixedPolynomialDegree :: Int -> PolynomialDegree OptimalPolynomialDegree :: PolynomialDegree data PolynomialBase FixedPolynomialBase :: Integer -> PolynomialBase ClosestPolynomialBase :: PolynomialBase FloorPolynomialBase :: PolynomialBase data PolynomialCoeff FixedPolynomialCoeff :: [Integer] -> PolynomialCoeff SmallestPolynomialCoeff :: PolynomialCoeff PositivePolynomialCoeff :: PolynomialCoeff data PolynomialConfig PolynomialConfig :: PolynomialDegree -> PolynomialBase -> PolynomialCoeff -> PolynomialConfig [polynomialDegree] :: PolynomialConfig -> PolynomialDegree [polynomialBase] :: PolynomialConfig -> PolynomialBase [polynomialCoeff] :: PolynomialConfig -> PolynomialCoeff defaultPolynomialConfig :: PolynomialConfig fixedPolynomialConfig :: Zx -> Integer -> PolynomialConfig selectPolynomialDegree :: PolynomialDegree -> Integer -> Int selectPolynomialBase :: PolynomialBase -> Integer -> Int -> Integer selectPolynomialCoeff :: PolynomialCoeff -> Integer -> Int -> Integer -> [Integer] selectPolynomial :: PolynomialConfig -> Integer -> (Zx, Integer) type FactorBase = [Prime] data FactorBaseConfig FixedFactorBase :: Integer -> FactorBaseConfig OptimalFactorBase :: Double -> FactorBaseConfig defaultFactorBaseConfig :: FactorBaseConfig maxFactorBase :: FactorBaseConfig -> Integer -> Integer destSmoothInteger :: FactorBase -> Integer -> Maybe Integer isSmoothInteger :: FactorBase -> Integer -> Bool notSmoothInteger :: FactorBase -> Integer -> Bool rationalNorm :: Integer -> Nfzw -> Integer algebraicNorm :: Zx -> Nfzw -> Integer isSmoothNfzw :: Zx -> Integer -> FactorBase -> FactorBase -> Nfzw -> Bool smoothNfzw :: Zx -> Integer -> FactorBase -> FactorBase -> [Nfzw] data QuadraticCharacterConfig FixedQuadraticCharacterConfig :: Int -> QuadraticCharacterConfig LinearQuadraticCharacterConfig :: Int -> Double -> QuadraticCharacterConfig defaultQuadraticCharacterConfig :: QuadraticCharacterConfig quadraticCharacters :: QuadraticCharacterConfig -> Integer -> Int isQuadraticCharacter :: Zx -> [Nfzw] -> Ideal -> Bool nextQuadraticCharacter :: Zx -> [Nfzw] -> [Ideal] -> (Ideal, [Ideal]) takeQuadraticCharacters :: Zx -> [Nfzw] -> Int -> [Ideal] -> ([Ideal], [Ideal]) isQuadraticResidue :: Ideal -> Nfzw -> Bool notQuadraticResidue :: Ideal -> Nfzw -> Bool productIsQuadraticResidue :: Ideal -> [Nfzw] -> Bool type Row = [Bool] formRow :: Zx -> Integer -> [Prime] -> [Ideal] -> [Ideal] -> Nfzw -> Row rationalRow :: [Prime] -> Integer -> Row algebraicRow :: Zx -> [Ideal] -> [Ideal] -> Nfzw -> Row oddPower :: Eq a => [(a, Integer)] -> a -> ([(a, Integer)], Bool) gaussianElimination :: [Row] -> [[Int]] rationalSquareRoot :: Integer -> Integer -> Zx -> [Prime] -> [Nfzw] -> Integer algebraicSquareRoot :: Integer -> Zx -> Integer -> Zx -> [Ideal] -> [Nfzw] -> (Integer -> Bool) -> Verbose (Maybe Integer) data Config Config :: PolynomialConfig -> FactorBaseConfig -> FactorBaseConfig -> QuadraticCharacterConfig -> Int -> Bool -> Config [polynomialConfig] :: Config -> PolynomialConfig [rationalFactorBaseConfig] :: Config -> FactorBaseConfig [algebraicFactorBaseConfig] :: Config -> FactorBaseConfig [quadraticCharacterConfig] :: Config -> QuadraticCharacterConfig [extraRankConfig] :: Config -> Int [verboseConfig] :: Config -> Bool defaultConfig :: Config setVerboseConfig :: Bool -> Config -> Config setQuadraticCharacterConfig :: Maybe Int -> Config -> Config verboseList :: Config -> String -> [String] -> String factorSquareRoots :: Config -> Integer -> Zx -> Integer -> FactorBase -> Zx -> [Ideal] -> [[Nfzw]] -> Verbose (Maybe Integer) factorWithPolynomial :: Config -> Integer -> Zx -> Integer -> Verbose (Maybe Integer) factor :: Config -> Integer -> Verbose (Maybe Integer) instance GHC.Show.Show Factor.Nfs.PolynomialDegree instance GHC.Classes.Ord Factor.Nfs.PolynomialDegree instance GHC.Classes.Eq Factor.Nfs.PolynomialDegree instance GHC.Show.Show Factor.Nfs.PolynomialBase instance GHC.Classes.Ord Factor.Nfs.PolynomialBase instance GHC.Classes.Eq Factor.Nfs.PolynomialBase instance GHC.Show.Show Factor.Nfs.PolynomialCoeff instance GHC.Classes.Ord Factor.Nfs.PolynomialCoeff instance GHC.Classes.Eq Factor.Nfs.PolynomialCoeff instance GHC.Show.Show Factor.Nfs.PolynomialConfig instance GHC.Classes.Ord Factor.Nfs.PolynomialConfig instance GHC.Classes.Eq Factor.Nfs.PolynomialConfig instance GHC.Show.Show Factor.Nfs.FactorBaseConfig instance GHC.Classes.Ord Factor.Nfs.FactorBaseConfig instance GHC.Classes.Eq Factor.Nfs.FactorBaseConfig instance GHC.Show.Show Factor.Nfs.QuadraticCharacterConfig instance GHC.Classes.Ord Factor.Nfs.QuadraticCharacterConfig instance GHC.Classes.Eq Factor.Nfs.QuadraticCharacterConfig instance GHC.Show.Show Factor.Nfs.Config instance GHC.Classes.Ord Factor.Nfs.Config instance GHC.Classes.Eq Factor.Nfs.Config module Factor type IntegerFactorer r = Config -> Integer -> r -> Verbose ([PrimePower], r) data Config Config :: Integer -> Config -> Config -> Config [trialDivisionConfig] :: Config -> Integer [ecmConfig] :: Config -> Config [nfsConfig] :: Config -> Config defaultConfig :: Config powerInteger :: Integer -> Integer -> Maybe (Integer, Integer) nfsFactorInteger :: RandomGen r => IntegerFactorer r ecmFactorInteger :: RandomGen r => IntegerFactorer r primeFactorInteger :: RandomGen r => IntegerFactorer r -> IntegerFactorer r powerFactorInteger :: RandomGen r => IntegerFactorer r -> IntegerFactorer r mergeFactorInteger :: RandomGen r => IntegerFactorer r -> Config -> Integer -> Integer -> r -> Verbose ([PrimePower], r) factorInteger :: RandomGen r => IntegerFactorer r factorZx :: Zx -> [(Zx, Integer)] factorGfpx :: RandomGen r => Prime -> Gfpx -> r -> ([(Gfpx, Integer)], r) factorValue :: RandomGen r => Config -> Value -> r -> Verbose (Term, r) instance GHC.Show.Show Factor.Config instance GHC.Classes.Ord Factor.Config instance GHC.Classes.Eq Factor.Config