
(/VERSIONCHECK 2) 

(DEFUN |PrimeField| (#0=#:G1848)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1849)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|PrimeField|)
                       '|domainEqualList|)
                   . #2=(|PrimeField|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|PrimeField;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#) (HREM |$ConstructorCache| '|PrimeField|))))))))))) 

(DEFUN |PrimeField;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|PrimeField|))
        (LETT |dv$| (LIST '|PrimeField| DV$1) . #0#)
        (LETT $ (GETREFV 40) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|PrimeField| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (AND (|HasCategory| $ '(|CharacteristicZero|))
             (|augmentPredVector| $ 1))
        (AND (|HasCategory| $ '(|CharacteristicNonZero|))
             (|augmentPredVector| $ 2))
        (AND (|HasCategory| $ '(|Finite|)) (|augmentPredVector| $ 4))
        (QSETREFV $ 11 (SPADCALL |#1| (QREFELT $ 10)))
        (COND
          ((QREFELT $ 11))
          ('T (|error| "Argument to prime field must be a prime")))
        $)))) 

(MAKEPROP '|PrimeField| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|InnerPrimeField| 6) (|local| |#1|)
             (|Boolean|) (|Integer|) (|IntegerPrimesPackage| 8)
             (0 . |prime?|) '#:G1815 (|NonNegativeInteger|)
             (|PositiveInteger|) (|SparseUnivariatePolynomial| $)
             (|Union| 14 '"failed") (|Union| $ '"failed")
             (|CardinalNumber|) (|OnePointCompletion| 13) (|Vector| $)
             (|Matrix| $)
             (|Union| '"prime" '"polynomial" '"normal" '"cyclic")
             (|Table| 13 12) (|Union| 19 '"failed")
             (|Record| (|:| |factor| 8) (|:| |exponent| 8)) (|List| 24)
             (|List| $) (|Union| 12 '"failed") (|Fraction| 8)
             (|Factored| $) (|Union| 26 '"failed")
             (|Record| (|:| |coef1| $) (|:| |coef2| $))
             (|Union| 31 '"failed")
             (|Record| (|:| |coef1| $) (|:| |coef2| $)
                 (|:| |generator| $))
             (|Record| (|:| |quotient| $) (|:| |remainder| $))
             (|Record| (|:| |coef| 26) (|:| |generator| $))
             (|Record| (|:| |unit| $) (|:| |canonical| $)
                 (|:| |associate| $))
             (|String|) (|OutputForm|) (|SingleInteger|))
          '#() 'NIL
          (CONS (|makeByteWordVec2| 1
                    '(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
                      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))
                (CONS '#(|FiniteAlgebraicExtensionField&|
                         |FiniteFieldCategory&| |ExtensionField&|
                         |FieldOfPrimeCharacteristic&| |Field&|
                         |EuclideanDomain&| NIL
                         |UniqueFactorizationDomain&| |GcdDomain&|
                         |DivisionRing&| |IntegralDomain&|
                         |VectorSpace&| |Algebra&| |Algebra&| |Module&|
                         |DifferentialRing&| NIL |Module&| NIL NIL NIL
                         NIL NIL |Ring&| NIL NIL NIL NIL NIL
                         |AbelianGroup&| NIL NIL |AbelianMonoid&|
                         |Monoid&| NIL NIL |Finite&| |SemiGroup&|
                         |AbelianSemiGroup&| |SetCategory&| NIL
                         |RetractableTo&| NIL NIL NIL NIL NIL
                         |BasicType&| NIL)
                      (CONS '#((|FiniteAlgebraicExtensionField| $$)
                               (|FiniteFieldCategory|)
                               (|ExtensionField| $$)
                               (|FieldOfPrimeCharacteristic|) (|Field|)
                               (|EuclideanDomain|)
                               (|PrincipalIdealDomain|)
                               (|UniqueFactorizationDomain|)
                               (|GcdDomain|) (|DivisionRing|)
                               (|IntegralDomain|) (|VectorSpace| $$)
                               (|Algebra| 28) (|Algebra| $$)
                               (|Module| $$) (|DifferentialRing|)
                               (|CharacteristicNonZero|) (|Module| 28)
                               (|EntireRing|) (|CommutativeRing|)
                               (|CharacteristicZero|)
                               (|BiModule| $$ $$) (|BiModule| 28 28)
                               (|Ring|) (|LeftModule| $$)
                               (|RightModule| 28) (|LeftModule| 28)
                               (|Rng|) (|RightModule| $$)
                               (|AbelianGroup|)
                               (|CancellationAbelianMonoid|)
                               (|SemiRing|) (|AbelianMonoid|)
                               (|Monoid|) (|SemiRng|) (|StepThrough|)
                               (|Finite|) (|SemiGroup|)
                               (|AbelianSemiGroup|) (|SetCategory|)
                               (|ConvertibleTo| 8) (|RetractableTo| $$)
                               (|canonicalsClosed|)
                               (|canonicalUnitNormal|)
                               (|noZeroDivisors|) (|CommutativeStar|)
                               (|unitsKnown|) (|BasicType|)
                               (|CoercibleTo| 38))
                            (|makeByteWordVec2| 10 '(1 9 7 8 10)))))
          '|lookupIncomplete|)) 
