• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
      • Arithmetic
        • Lispfloat
        • Arithmetic-1
        • Number-theory
          • Tonelli-shanks-modular-sqrt-algorithm
          • Defprime
            • Defprime-alias
            • Prime
            • Dm::primep
            • Has-square-root?
            • Prime-fix
            • Secp256k1-group-prime
            • Secp256k1-field-prime
            • Jubjub-subgroup-prime
            • Edwards-bls12-subgroup-prime
            • Bn-254-group-prime
            • Bls12-381-scalar-field-prime
            • Baby-jubjub-subgroup-prime
            • Goldilocks-prime
          • Proof-by-arith
          • Arith-equivs
          • Number-theory
          • Arithmetic-3
          • Arithmetic-2
          • Arithmetic-light
          • Arithmetic-5
        • Bit-vectors
        • Algebra
    • Number-theory

    Defprime

    Introduce a prime and related machinery.

    General Form:

    (defprime name
              number
              pratt-cert
              &key
              :evisc     ; default t
              :parents   ; default :auto
              :short     ; default :auto
              :long      ; default :auto
              :doc       ; default t
              )

    Inputs:

    name — (required)

    Name of the prime to introduce, a symbol.

    number — (required)

    Numeric value of the prime, a natural number.

    pratt-cert — (required)

    Pratt certificate for the prime.

    :evisc — default t

    Whether to print occurrences of the prime using its symbolic name.

    :parents — default :auto

    Xdoc :parents for the prime.

    :short — default :auto

    Xdoc :short description for the prime.

    :long — default :auto

    Xdoc :long section for the prime.

    :doc — default t

    Whether to generate xdoc for the prime.

    Description:

    Defprime generates, for a prime named FOO:

    • A constant, *FOO*, representing the prime.
    • A theorem that *FOO* is prime.
    • A 0-ary function, FOO, representing the prime. This is disabled but its :executable-counterpart is not (disable the :executable-counterpart to prevent execution during proofs).
    • A theorem that the function FOO always returns a prime.
    • A :linear rule stating that the function FOO is equal to the prime (i.e., its integer value).
    • A utility, eviscerate-FOO, to cause the prime to be printed using a symbolic name. This is in turn invoked by defprime to turn on evisceration, unless the :evisc argument is nil.
    • A utility, uneviscerate-FOO, to turn off the evisceration mentioned just above.
    • A constant, *FOO-pratt-cert*, for the Pratt certificate supplied for FOO.
    • A defxdoc form for the prime, using the supplied :short, :long, and :parents, or suitable defaults for each.
    • A call of ACL2::add-io-pairs to cause primep to be fast when called on the prime.
    • A table event that records the call of defprime.