• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
          • Let
          • Declare
          • Mbe
          • Apply$
          • Fmt
          • Loop$
          • Return-last
          • Mv-let
          • Df
          • Pseudo-termp
          • Defwarrant
          • Time$
          • Mbt
          • Ec-call
          • Mv-nth
          • Sys-call
          • Msg
          • Er
          • Value-triple
          • O-p
          • Comp
          • Member
          • O<
          • Cw
          • Flet
          • Or
          • Hons
          • Cbd
          • Mv
          • Defbadge
          • Append
          • *ACL2-exports*
          • Comment
          • Eql
          • List
          • Unsigned-byte-p
            • Defbyte
              • Defbytelist
              • Defbyte-standard-instances
              • Defbyte-ihs-theorems
              • Defbyte-implementation
                • Defbyte-fn
                  • Defbyte-infop
                  • Defbyte-check-size
                  • Defbyte-fix-support-lemma
                  • Defbyte-table
                  • Defbyte-macro-definition
                  • *defbyte-table-name*
              • Unsigned-byte-p-discussion
              • Unsigned-byte-listp
              • Bitops/signed-byte-p
              • Unsigned-byte-fix
              • Bytep
              • Nibblep
              • Ihs/unsigned-byte-p-lemmas
              • Unsigned-byte-p*
              • Unsigned-byte-p-basics
            • Posp
            • Natp
            • The
            • Nth
            • And
            • Len
            • Time-tracker
            • Term-order
            • True-listp
            • Msgp
            • Booleanp
            • <
            • If
            • Pseudo-term-listp
            • +
            • Not
            • With-global-stobj
            • Bitp
            • Equal
            • Cdr
            • Car
            • String-listp
            • Nat-listp
            • Implies
            • Iff
            • Character-listp
            • Alistp
            • Cons
            • Symbol-listp
            • Macrolet
            • Quote
            • Integerp
            • Consp
            • True-list-listp
            • State-global-let*
            • Compress1
            • Symbolp
            • Stringp
            • *common-lisp-symbols-from-main-lisp-package*
            • Characterp
            • Prog2$
            • *
            • Last-prover-steps
            • Hons-acons
            • Let*
            • Eq
            • With-guard-checking
            • @
            • Length
            • With-local-stobj
            • Hard-error
            • -
            • Zp
            • Search
            • Intersection$
            • Assign
            • Aset1
            • Symbol-name
            • Union$
            • Set-gc-strategy
            • In-tau-intervalp
            • Cons-with-hint
            • Break-on-error
            • Pand
            • Case-match
            • Fast-alist-fork
            • Sys-call+
            • Signed-byte-p
            • ACL2-count
            • Remove-duplicates
            • With-serialize-character
            • Observation
            • Hons-resize
            • Make-tau-interval
            • Logbitp
            • Termp
            • Position
            • Assoc
            • *standard-co*
            • Hons-acons!
            • Update-nth
            • Take
            • Aref1
            • Read-run-time
            • Keywordp
            • Symbol-package-name
            • Symbol-alistp
            • Hons-wash
            • Expt
            • Coerce
            • Get-internal-time
            • Intern
            • Non-exec
            • Case
            • Standard-oi
            • Standard-co
            • Formula
            • Nthcdr
            • Atom
            • Without-evisc
            • Good-bye
            • With-local-state
            • Spec-mv-let
            • Intern-in-package-of-symbol
            • Binary-+
            • <=
            • Ash
            • With-fast-alist
            • Set-difference$
            • Hons-clear
            • Flush-compress
            • Rationalp
            • Por
            • Rassoc
            • Remove-assoc
            • =
            • Pargs
            • Nfix
            • Hons-copy
            • Alphorder
            • Subsetp
            • Logand
            • Remove1-assoc
            • No-duplicatesp
            • Mv-list
            • Canonical-pathname
            • Aset2
            • Floor
            • Serialize-read
            • Random$
            • Fmt-to-comment-window
            • F-put-global
            • Compress2
            • Concatenate
            • Fast-alist-clean
            • Assert$
            • Remove
            • Remove1
            • Intersectp
            • Endp
            • Put-assoc
            • Princ$
            • Primitive
            • Keyword-value-listp
            • True-list-fix
            • Swap-stobjs
            • Integer-listp
            • Illegal
            • Hons-get
            • With-output-lock
            • Setenv$
            • Open-output-channel!
            • Fast-alist-free
            • Er-progn
            • Cw-print-base-radix
            • Reverse
            • Cond
            • Complex
            • Add-to-set
            • Truncate
            • Digit-char-p
            • Code-char
            • Char-code
            • Set-print-case
            • Set-print-base
            • Read-ACL2-oracle
            • Error1
            • Print-object$
            • Plet
            • Integer-length
            • Zip
            • With-live-state
            • Hons-assoc-equal
            • Extend-pathname
            • Logior
            • With-guard-checking-event
            • Term-listp
            • Print-object$+
            • Fmx-cw
            • String
            • Mod
            • In-package
            • Unary--
            • Set-print-radix
            • Resize-list
            • Pkg-witness
            • Revappend
            • Null
            • Term-list-listp
            • Make-fast-alist
            • Header
            • Boole$
            • Subseq
            • With-guard-checking-error-triple
            • /
            • Make-list
            • Logxor
            • Char-upcase
            • Char-downcase
            • Strip-cars
            • Set-fmt-hard-right-margin
            • Make-ord
            • Ifix
            • Fast-alist-free-on-exit
            • F-get-global
            • Aref2
            • Standard-char-p
            • Lognot
            • Last
            • Must-be-equal
            • Integer-range-p
            • Getenv$
            • Binary-append
            • Er-hard
            • Eqlablep
            • Cpu-core-count
            • Boolean-listp
            • Allocate-fixnum-range
            • ACL2-numberp
            • Butlast
            • Pairlis$
            • Mod-expt
            • Hons-equal
            • Gc$
            • Substitute
            • Ceiling
            • With-stolen-alist
            • Mv?-let
            • String-upcase
            • String-downcase
            • Round
            • Count
            • Char
            • Sys-call-status
            • Progn$
            • Pprogn
            • Lexorder
            • Hons-summary
            • Break$
            • Assert*
            • Alpha-char-p
            • Strip-cdrs
            • Serialize-write
            • Keyword-listp
            • Upper-case-p
            • Lower-case-p
            • Logeqv
            • List*
            • Proofs-co
            • Maximum-length
            • Fix
            • Explode-nonnegative-integer
            • Eqlable-listp
            • Dimensions
            • Default
            • Arity
            • Sublis
            • Max
            • Evenp
            • Explode-atom
            • Change
            • Zerop
            • String<
            • String-equal
            • Abs
            • Set-print-base-radix
            • Print-base-p
            • Nonnegative-integer-quotient
            • Intern$
            • Getprop
            • Binary-*
            • Aset1-trusted
            • Symbol<
            • String-append
            • Rfix
            • Mv?
            • Logic-fns-list-listp
            • Fast-alist-fork!
            • Er-hard?
            • Char-equal
            • 1+
            • *standard-oi*
            • Sys-call*
            • Pos-listp
            • Mbt*
            • Hons-wash!
            • Hons-clear!
            • Signum
            • Rem
            • Real/rationalp
            • Rational-listp
            • O-first-coeff
            • Logic-fnsp
            • Logic-fns-listp
            • Hons-copy-persistent
            • Gc-strategy
            • Fast-alist-summary
            • String>=
            • String<=
            • Acons
            • O-first-expt
            • Fast-alist-clean!
            • >=
            • >
            • Subst
            • Logcount
            • Getpropc
            • Evens
            • Er-soft
            • Digit-to-char
            • Comp-gcl
            • Atom-listp
            • Arities-okp
            • ACL2-number-listp
            • /=
            • Cadr
            • *standard-ci*
            • Unary-/
            • The-true-list
            • Realfix
            • O-rst
            • Fast-alist-len
            • Complex/complex-rationalp
            • Array2p
            • Array1p
            • Logtest
            • Logandc1
            • Char<
            • Trace-co
            • Putprop
            • Get-real-time
            • Eqlable-alistp
            • Count-keys
            • Assoc-string-equal
            • Logorc1
            • Logandc2
            • Denominator
            • 1-
            • Packn
            • Logic-termp
            • Logic-term-list-listp
            • Fmt!
            • Fms
            • Cw!
            • Assoc-keyword
            • String>
            • Numerator
            • Logorc2
            • Char>=
            • Update-nth-array
            • The-number
            • Odds
            • Makunbound-global
            • Make-character-list
            • Make
            • List$
            • Int=
            • Get-cpu-time
            • Fmt-to-comment-window!
            • Fms!
            • F-boundp-global
            • Complex-rationalp
            • Alist-to-doublets
            • Access
            • Min
            • Lognor
            • Listp
            • Identity
            • Char>
            • Char<=
            • Zpf
            • Standard-char-listp
            • O-finp
            • Number-subtrees
            • Logic-term-listp
            • Last-cdr
            • Fmt1!
            • Fmt-to-comment-window!+
            • Character-alistp
            • Oddp
            • Minusp
            • Lognand
            • Imagpart
            • Conjugate
            • Xor
            • Unquote
            • String-alistp
            • Packn-pos
            • Maybe-flush-and-compress1
            • Kwote
            • Fmt1
            • Fmt-to-comment-window+
            • Cw-print-base-radix!
            • Alist-keys-subsetp
            • Realpart
            • Plusp
            • First
            • Symbol-name-lst
            • R-symbol-alistp
            • R-eqlable-alistp
            • Fmx
            • Cw!+
            • Cons-subtrees
            • Cons-count-bounded
            • Cddr
            • Caar
            • Proper-consp
            • Kwote-lst
            • Improper-consp
            • Cw+
            • Rest
            • Standard-char-p+
            • Mbe1
            • Caddr
            • Pairlis-x2
            • Pairlis-x1
            • O>=
            • O<=
            • O-infp
            • Merge-sort-lexorder
            • Fix-true-list
            • Cdddr
            • Set-fmt-soft-right-margin
            • Real-listp
            • O>
            • Cddar
            • Cdar
            • Cdadr
            • Cdaar
            • Cadar
            • Caadr
            • Caaar
            • Cadddr
            • Caddar
            • Third
            • Tenth
            • Sixth
            • Seventh
            • Second
            • Ninth
            • Fourth
            • Fifth
            • Eighth
            • Cddddr
            • Cdddar
            • Cddadr
            • Cddaar
            • Cdaddr
            • Cdadar
            • Cdaadr
            • Cdaaar
            • Cadadr
            • Cadaar
            • Caaddr
            • Caadar
            • Caaadr
            • Caaaar
            • Hons-shrink-alist!
            • Hons-shrink-alist
            • Flush-hons-get-hash-table-link
            • Delete-assoc
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defbyte-implementation

    Defbyte-fn

    Events generated by defbyte.

    Signature
    (defbyte-fn type size signed pred fix equiv parents short long wrld) 
      → 
    event
    Arguments
    wrld — Guard (plist-worldp wrld).
    Returns
    event — A ACL2::maybe-pseudo-event-formp.

    For now we only perform partial validation of the inputs. Future implementations may perform a more thorough validation.

    Definitions and Theorems

    Function: defbyte-fn

    (defun defbyte-fn (type size signed
                            pred fix equiv parents short long wrld)
     (declare (xargs :guard (plist-worldp wrld)))
     (let ((__function__ 'defbyte-fn))
      (declare (ignorable __function__))
      (b*
       (((unless (symbolp type))
         (raise
          "The TYPE input must be a symbol, ~
                    but it is ~x0 instead."
          type))
        ((mv size-valid size-value)
         (defbyte-check-size size wrld))
        ((unless size-valid)
         (raise
          "The SIZE input must be ~
                    (1) an explicit positive integer value, or ~
                    (2) a named constant whose value is a positive integer, or ~
                    (3) a call of a nullary function (defined or constrained) ~
                    that provably denotes a positive integer; ~
                    but it is ~x0 instead."
          size))
        ((unless (booleanp signed))
         (raise
          "The :SIGNED input must be a boolean, ~
                    but it is ~x0 instead."
          signed))
        ((unless (symbolp pred))
         (raise
          "The :PRED input must be a symbol, ~
                    but it is ~x0 instead."
          pred))
        ((unless (symbolp fix))
         (raise
          "The :FIX input must be a symbol, ~
                    but it is ~x0 instead."
          fix))
        ((unless (symbolp equiv))
         (raise
          "The :EQUIV input must be a symbol, ~
                    but it is ~x0 instead."
          equiv))
        (binpred (if signed 'signed-byte-p
                   'unsigned-byte-p))
        (pkg (symbol-package-name type))
        (pkg (if (equal pkg *main-lisp-package-name*)
                 "ACL2"
               pkg))
        (pkg-witness (pkg-witness pkg))
        (pred (or pred (add-suffix-to-fn type "-P")))
        (fix (or fix (add-suffix-to-fn type "-FIX")))
        (equiv (or equiv (add-suffix-to-fn type "-EQUIV")))
        (booleanp-of-pred (acl2::packn-pos (list 'booleanp-of- pred)
                                           pkg-witness))
        (pred-forward-binpred
             (acl2::packn-pos (list pred '-forward- binpred)
                              pkg-witness))
        (binpred-rewrite-pred
             (acl2::packn-pos (list binpred '-rewrite- pred)
                              pkg-witness))
        (pred-compound-recognizer
          (acl2::packn-pos (list (if signed 'integerp-when- 'natp-when-)
                                 pred)
                           pkg-witness))
        (pred-of-fix (acl2::packn-pos (list pred '-of- fix)
                                      pkg-witness))
        (fix-when-pred (acl2::packn-pos (list fix '-when- pred)
                                        pkg-witness))
        (type-size-is-posp (if size-value nil
                             (acl2::packn-pos (list type '-is-posp)
                                              pkg-witness)))
        (pred-additional-theorems
             (add-suffix-to-fn pred "-ADDITIONAL-THEOREMS"))
        (x (intern-in-package-of-symbol "X" pkg-witness))
        (yes/no (intern-in-package-of-symbol "YES/NO" pkg-witness))
        (fixed-x (intern-in-package-of-symbol "FIXED-X" pkg-witness))
        (type-ref
          (concatenate
               'string
               "@(tsee "
               (common-lisp::string-downcase (symbol-package-name type))
               "::"
               (common-lisp::string-downcase (symbol-name type))
               ")"))
        (pred-ref
          (concatenate
               'string
               "@(tsee "
               (common-lisp::string-downcase (symbol-package-name type))
               "::"
               (common-lisp::string-downcase (symbol-name type))
               ")"))
        ((mv lower-bound upper-bound)
         (if signed
          (if size-value (mv (- (expt 2 (1- size-value)))
                             (expt 2 (1- size-value)))
           (mv (cons '-
                     (cons (cons 'expt
                                 (cons '2
                                       (cons (cons '1- (cons size 'nil))
                                             'nil)))
                           'nil))
               (cons 'expt
                     (cons '2
                           (cons (cons '1- (cons size 'nil))
                                 'nil)))))
          (if size-value (mv 0 (expt 2 size-value))
            (mv 0
                (cons 'expt
                      (cons '2 (cons size 'nil)))))))
        (type-size-is-posp-event?
         (and
          type-size-is-posp
          (cons
           (cons
            'defrule
            (cons
                 type-size-is-posp
                 (cons (cons 'posp (cons size 'nil))
                       '(:rule-classes (:rewrite :type-prescription)))))
           'nil)))
        (pred-event
         (if
          (function-symbolp pred wrld)
          (cons
           'defsection
           (cons
            pred-additional-theorems
            (cons
             ':parents
             (cons
              (cons pred (cons type 'nil))
              (cons
               ':short
               (cons
                (concatenate 'string
                             "Additional theorems about "
                             pred-ref ".")
                (cons
                 (cons
                  'defrule
                  (cons
                   pred-forward-binpred
                   (cons
                    (cons
                     'implies
                     (cons
                          (cons pred (cons x 'nil))
                          (cons (cons binpred (cons size (cons x 'nil)))
                                'nil)))
                    (cons
                     ':rule-classes
                     (cons
                         ':forward-chaining
                         (cons ':in-theory
                               (cons (cons 'quote
                                           (cons (cons pred 'nil) 'nil))
                                     'nil)))))))
                 (cons
                  (cons
                   'defruled
                   (cons
                    binpred-rewrite-pred
                    (cons
                     (cons
                          'equal
                          (cons (cons binpred (cons size (cons x 'nil)))
                                (cons (cons pred (cons x 'nil)) 'nil)))
                     (cons ':in-theory
                           (cons (cons 'quote
                                       (cons (cons pred 'nil) 'nil))
                                 'nil)))))
                  (cons
                   (cons
                    'theory-invariant
                    (cons
                     (cons
                        'incompatible
                        (cons (cons ':rewrite
                                    (cons binpred-rewrite-pred 'nil))
                              (cons (cons ':definition (cons pred 'nil))
                                    'nil)))
                     'nil))
                   (cons
                    (cons
                     'defrule
                     (cons
                      pred-compound-recognizer
                      (cons
                       (cons
                           'implies
                           (cons (cons pred (cons x 'nil))
                                 (cons (cons (if signed 'integerp 'natp)
                                             (cons x 'nil))
                                       'nil)))
                       (cons
                        ':rule-classes
                        (cons
                         ':compound-recognizer
                         (cons
                          ':in-theory
                          (cons
                           (cons
                            'quote
                            (cons
                             (cons
                              pred-forward-binpred
                              '(acl2::unsigned-byte-p-forward-to-nonnegative-integerp
                                 acl2::signed-byte-p-forward-to-integerp
                                 integerp natp))
                             'nil))
                           'nil)))))))
                    'nil))))))))))
          (cons
           'define
           (cons
            pred
            (cons
             (cons x 'nil)
             (cons
              ':returns
              (cons
               (cons
                yes/no
                (cons
                 'booleanp
                 (cons
                  ':name
                  (cons
                   booleanp-of-pred
                   (cons
                    ':hints
                    (cons
                     (cons
                      (cons
                       '"Goal"
                       (cons
                        ':in-theory
                        (cons
                         (cons
                          'quote
                          (cons
                           (cons pred
                                 (cons (cons ':t (cons binpred 'nil))
                                       '(booleanp-compound-recognizer)))
                           'nil))
                         'nil)))
                      'nil)
                     'nil))))))
               (cons
                ':parents
                (cons
                 (cons type 'nil)
                 (cons
                  ':short
                  (cons
                   (concatenate 'string
                                "Recognizer for " type-ref ".")
                   (cons
                    (cons
                     'mbe
                     (cons
                      ':logic
                      (cons
                       (cons binpred (cons size (cons x 'nil)))
                       (cons
                        ':exec
                        (cons
                         (cons
                          'and
                          (cons
                           (cons 'integerp (cons x 'nil))
                           (cons
                            (cons '<=
                                  (cons lower-bound (cons x 'nil)))
                            (cons
                                 (cons '<
                                       (cons x (cons upper-bound 'nil)))
                                 'nil))))
                         'nil)))))
                    (cons
                     ':guard-hints
                     (cons
                      (cons
                       (cons
                        '"Goal"
                        (cons
                         ':in-theory
                         (cons
                          (cons
                           'quote
                           (cons
                            (cons
                             binpred
                             (cons
                                 'integer-range-p
                                 (cons '(:e expt)
                                       (and type-size-is-posp
                                            (list type-size-is-posp)))))
                            'nil))
                          'nil)))
                       'nil)
                      (cons
                       ':no-function
                       (cons
                        't
                        (cons
                         '///
                         (cons
                          (cons
                           'defrule
                           (cons
                            pred-forward-binpred
                            (cons
                             (cons
                              'implies
                              (cons
                               (cons pred (cons x 'nil))
                               (cons
                                (cons binpred (cons size (cons x 'nil)))
                                'nil)))
                             (cons
                              ':rule-classes
                              (cons
                               ':forward-chaining
                               (cons
                                ':in-theory
                                (cons
                                     (cons 'quote
                                           (cons (cons pred 'nil) 'nil))
                                     'nil)))))))
                          (cons
                           (cons
                            'defruled
                            (cons
                             binpred-rewrite-pred
                             (cons
                              (cons
                               'equal
                               (cons
                                (cons binpred (cons size (cons x 'nil)))
                                (cons (cons pred (cons x 'nil)) 'nil)))
                              (cons
                               ':in-theory
                               (cons (cons 'quote
                                           (cons (cons pred 'nil) 'nil))
                                     'nil)))))
                           (cons
                            (cons
                             'theory-invariant
                             (cons
                              (cons
                               'incompatible
                               (cons
                                (cons ':rewrite
                                      (cons binpred-rewrite-pred 'nil))
                                (cons
                                    (cons ':definition (cons pred 'nil))
                                    'nil)))
                              'nil))
                            (cons
                             (cons
                              'defrule
                              (cons
                               pred-compound-recognizer
                               (cons
                                (cons
                                 'implies
                                 (cons
                                  (cons pred (cons x 'nil))
                                  (cons
                                       (cons (if signed 'integerp 'natp)
                                             (cons x 'nil))
                                       'nil)))
                                (cons
                                 ':rule-classes
                                 (cons
                                  ':compound-recognizer
                                  (cons
                                   ':in-theory
                                   (cons
                                    (cons
                                     'quote
                                     (cons
                                      (cons
                                       pred-forward-binpred
                                       '(acl2::unsigned-byte-p-forward-to-nonnegative-integerp
                                         acl2::signed-byte-p-forward-to-integerp
                                         integerp natp))
                                      'nil))
                                    'nil)))))))
                             'nil)))))))))))))))))))))
        (fix-event
         (cons
          'define
          (cons
           fix
           (cons
            (cons (cons x (cons pred 'nil)) 'nil)
            (cons
             ':returns
             (cons
              (cons
               fixed-x
               (cons
                pred
                (cons
                 ':name
                 (cons
                  pred-of-fix
                  (cons
                   ':hints
                   (cons
                    (cons
                     (cons
                      '"Goal"
                      (cons
                       ':in-theory
                       (cons
                        (cons
                         'quote
                         (cons
                          (cons
                           pred
                           (cons
                             fix
                             (cons binpred
                                   '(posp integer-range-p expt (:e expt)
                                          fix zip))))
                          'nil))
                        (and
                         type-size-is-posp
                         (cons
                          ':use
                          (cons
                           (cons
                            type-size-is-posp
                            (cons
                             (cons
                              ':instance
                              (cons
                                'defbyte-fix-support-lemma
                                (cons (cons 'z (cons size 'nil)) 'nil)))
                             'nil))
                           'nil))))))
                     'nil)
                    'nil))))))
              (cons
               ':parents
               (cons
                (cons type 'nil)
                (cons
                 ':short
                 (cons
                  (concatenate 'string
                               "Fixer for " type-ref ".")
                  (cons
                   (cons
                       'mbe
                       (cons ':logic
                             (cons (cons 'if
                                         (cons (cons pred (cons x 'nil))
                                               (cons x '(0))))
                                   (cons ':exec (cons x 'nil)))))
                   (cons
                    ':no-function
                    (cons
                     't
                     (cons
                      '///
                      (cons
                       (cons
                        'defrule
                        (cons
                         fix-when-pred
                         (cons
                          (cons
                           'implies
                           (cons
                              (cons pred (cons x 'nil))
                              (cons (cons 'equal
                                          (cons (cons fix (cons x 'nil))
                                                (cons x 'nil)))
                                    'nil)))
                          (cons ':in-theory
                                (cons (cons 'quote
                                            (cons (cons fix 'nil) 'nil))
                                      'nil)))))
                       'nil)))))))))))))))
        (type-event
         (cons
          'defsection
          (cons
           type
           (append
            (and parents (list :parents parents))
            (append
             (and short (list :short short))
             (append
              (and long (list :long long))
              (cons
               (cons
                'deffixtype
                (cons
                 type
                 (cons
                  ':pred
                  (cons
                   pred
                   (cons
                    ':fix
                    (cons
                       fix
                       (cons ':equiv
                             (cons equiv '(:define t :forward t)))))))))
               'nil)))))))
        (table-event
         (cons
          'table
          (cons
              *defbyte-table-name*
              (cons (cons 'quote (cons type 'nil))
                    (cons (cons 'quote
                                (cons (make-defbyte-info :size size
                                                         :signed signed)
                                      'nil))
                          'nil))))))
       (cons
        'encapsulate
        (cons
         'nil
         (cons
          '(logic)
          (append
              type-size-is-posp-event?
              (cons '(acl2::evmac-prepare-proofs)
                    (cons pred-event
                          (cons fix-event
                                (cons type-event
                                      (cons table-event 'nil))))))))))))