• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
              • Atc-event-and-code-generation
                • Atc-symbolic-computation-states
                • Atc-symbolic-execution-rules
                  • Atc-exec-expr-pure-rules
                  • Atc-exec-expr-when-asg-arrsub-rules-generation
                  • Integer-value-disjoint-rules
                  • Atc-uaconvert-values-rules
                  • Atc-exec-unary-nonpointer-rules-generation
                  • Atc-exec-unary-nonpointer-rules
                  • Atc-exec-expr-when-asg-indir-rules
                  • Atc-exec-expr-when-asg-arrsub-rules
                  • Atc-exec-cast-rules-generation
                  • Atc-exec-cast-rules
                  • Atc-exec-binary-strict-pure-rules-generation
                    • Atc-convert-integer-value-rules
                    • Atc-array-read-rules
                    • Array-value-disjoint-rules
                    • Atc-exec-expr-when-asg-indir-rule-generation
                    • Atc-identifier-rules
                    • Atc-object-designator-rules
                    • Atc-flexible-array-member-rules
                    • Atc-exec-stmt-rules
                    • Atc-exec-indir-rules
                    • Atc-uaconvert-values-rules-generation
                    • Atc-exec-arrsub-rules
                    • Value-bridge-theorems
                    • Atc-test-value-rules
                    • Atc-exec-const-rules
                    • *atc-integer-ops-2-return-rewrite-rules*
                    • *atc-integer-ops-2-type-prescription-rules*
                    • Atc-apconvert-rules
                    • Atc-integer-conv-rules
                    • Atc-adjust-type-rules
                    • Atc-exec-block-item-list-rules
                    • Atc-exec-arrsub-rules-generation
                    • Atc-exec-fun-rules
                    • Atc-static-variable-pointer-rules
                    • Atc-exec-indir-rules-generation
                    • Atc-exec-binary-strict-pure-rules
                    • Atc-array-write-rules
                    • Array-value-rules
                    • Atc-pointed-integer-rules
                    • Atc-array-length-rules
                    • *atc-exec-cast-rules*
                    • Atc-value-array->elemtype-rules
                    • Atc-limit-rules
                    • Type-of-value-under-array-predicates
                    • Atc-value-integer->get-rules
                    • Atc-distributivity-over-if-rewrite-rules
                    • *atc-integer-convs-type-prescription-rules*
                    • Atc-value-array->elements-rules
                    • Atc-syntaxp-hyp-for-expr-pure
                    • *atc-uaconvert-values-rules*
                    • *atc-integer-ops-1-return-rewrite-rules*
                    • *atc-integer-convs-return-rewrite-rules*
                    • Valuepred-when-value-kind
                    • Valuepred-to-type-of-value-equalities
                    • Atc-promote-value-rules
                    • *atc-integer-ops-1-type-prescription-rules*
                    • *atc-all-rules*
                    • Atc-integer-ifix-rules
                    • Atc-exec-expr-when-asg-ident-rules
                    • *atc-type-prescription-rules*
                    • Atc-hide-rules
                    • Type-of-value-when-valuepred
                    • Atc-value-integerp-rules
                    • Atc-not-error-rules
                    • Value-listp-when-valuepred-listp
                    • Value-kind-when-valuepred
                    • Atc-value-arithmeticp-rules
                    • Atc-type-kind-rules
                    • *atc-compound-recognizer-rules*
                    • Atc-value-pointer-rules
                    • Atc-boolean-equality-rules
                    • Atc-tyname-to-type-rules
                    • Atc-integer-size-rules
                    • Atc-init-scope-rules
                    • Atc-boolean-from-sint
                    • Valuep-when-valuepred
                    • Atc-if*-rules
                    • Atc-exec-ident-rules
                    • Atc-integer-const-rules
                    • Atc-sint-get-rules
                    • Atc-exec-expr-when-call-rules
                    • Atc-type-of-value-option-rules
                    • Atc-identifier-other-rules
                    • Atc-boolean-from-integer-return-rules
                    • *atc-exec-unary-nonpointer-rules*
                    • *atc-convert-integer-value-rules*
                    • Atc-lognot-sint-rules
                    • Atc-sint-from-boolean-rules
                    • Atc-value-optionp-rules
                    • Atc-type-of-value-rules
                    • Atc-exec-obj-declon-rules
                    • Atc-compustatep-rules
                    • Value-tau-rules
                    • Atc-valuep-rules
                    • Atc-exec-expr-pure-list-rules
                    • Atc-exec-block-item-rules
                    • Atc-boolean-fron/to-sint-rules
                    • *atc-other-executable-counterpart-rules*
                    • Value-promoted-arithmeticp-alt-def
                    • Atc-exec-initer-rules
                    • *atc-type-of-value-rules*
                    • *atc-identifier-rules*
                    • *atc-flexible-array-member-rules*
                    • *atc-exec-expr-pure-rules*
                    • *atc-boolean-from-integer-return-rules*
                    • *atc-array-read-rules*
                    • Valuep-possibilities
                    • Value-unsigned-integerp-alt-def
                    • Value-signed-integerp-alt-def
                    • Atc-value-listp-rules
                    • *atc-pointed-integers-type-prescription-rules*
                    • *atc-pointed-integer-rules*
                    • *atc-array-write-return-rewrite-rules*
                    • *atc-array-read-return-rewrite-rules*
                    • Atc-exec-expr-when-pure-rules
                    • Array-tau-rules
                    • *atc-not-error-rules*
                    • *atc-integer-conv-rules*
                    • *atc-exec-expr-when-asg-arrsub-rules*
                    • *atc-array-write-type-prescription-rules*
                    • *atc-array-read-type-prescription-rules*
                    • *atc-array-length-rules*
                    • *atc-adjust-type-rules*
                    • Atc-sint-from-boolean
                    • Atc-init-value-to-value-rules
                    • *atc-value-integer->get-rules*
                    • *atc-static-variable-pointer-rules*
                    • *atc-integer-size-rules*
                    • *atc-integer-constructors-return-rules*
                    • *atc-exec-stmt-rules*
                    • *atc-exec-expr-when-asg-indir-rules*
                    • *atc-exec-const-rules*
                    • *atc-distributivity-over-if-rewrite-rules*
                    • Atc-wrapper-rules
                    • Atc-value-result-fix-rules
                    • Atc-value-kind-rules
                    • Atc-array-length-write-rules
                    • *atc-value-kind-rules*
                    • *atc-value-array->elemtype-rules*
                    • *atc-type-kind-rules*
                    • *atc-test-value-rules*
                    • *atc-promote-value-rules*
                    • *atc-integer-ifix-rules*
                    • *atc-integer-fix-rules*
                    • *atc-integer-const-rules*
                    • *atc-exec-indir-rules*
                    • *atc-exec-arrsub-rules*
                    • *atc-computation-state-return-rules*
                    • *atc-array-length-write-rules*
                    • *atc-apconvert-rules*
                    • Atc-misc-rewrite-rules
                    • *atc-valuep-rules*
                    • *atc-tyname-to-type-rules*
                    • *atc-object-designator-rules*
                    • *atc-init-scope-rules*
                    • *atc-exec-expr-when-call-rules*
                    • *atc-exec-expr-when-asg-rules*
                    • *atc-exec-expr-when-asg-ident-rules*
                    • *atc-exec-block-item-rules*
                    • Atc-computation-state-return-rules
                    • *atc-wrapper-rules*
                    • *atc-value-result-fix-rules*
                    • *atc-value-optionp-rules*
                    • *atc-value-listp-rules*
                    • *atc-value-fix-rules*
                    • *atc-type-of-value-option-rules*
                    • *atc-sint-get-rules*
                    • *atc-sint-from-boolean*
                    • *atc-misc-rewrite-rules*
                    • *atc-lognot-sint-rules*
                    • *atc-limit-rules*
                    • *atc-init-value-to-value-rules*
                    • *atc-exec-obj-declon-rules*
                    • *atc-exec-initer-rules*
                    • *atc-exec-ident-rules*
                    • *atc-exec-fun-rules*
                    • *atc-exec-expr-when-pure-rules*
                    • *atc-exec-expr-pure-list-rules*
                    • *atc-exec-block-item-list-rules*
                    • *atc-boolean-from-sint*
                    • Atc-value-fix-rules
                    • Atc-integer-fix-rules
                    • Atc-integer-constructors-return-rules
                    • Atc-exec-expr-when-asg-rules
                  • Atc-gen-ext-declon-lists
                  • Atc-function-and-loop-generation
                  • Atc-statement-generation
                  • Atc-gen-fileset
                  • Atc-gen-everything
                  • Atc-gen-obj-declon
                  • Atc-gen-fileset-event
                  • Atc-tag-tables
                  • Atc-expression-generation
                  • Atc-generation-contexts
                  • Atc-gen-wf-thm
                  • Term-checkers-atc
                  • Atc-variable-tables
                  • Term-checkers-common
                  • Atc-gen-init-fun-env-thm
                  • Atc-gen-appconds
                  • Read-write-variables
                  • Atc-gen-thm-assert-events
                  • Test*
                  • Atc-gen-prog-const
                  • Atc-gen-expr-bool
                  • Atc-theorem-generation
                  • Atc-tag-generation
                  • Atc-gen-expr-pure
                  • Atc-function-tables
                  • Atc-object-tables
                • Fty-pseudo-term-utilities
                • Atc-term-recognizers
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
              • Pure-expression-execution
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Atc-symbolic-execution-rules

    Atc-exec-binary-strict-pure-rules-generation

    Code to generate the rules for executing strict pure binary operations.

    Since there are 16 binary operations and 10 integer types, there are 1600 instances of these rules. Generating all of them in the same file takes a bit of time; for example, a machine takes about 300 seconds to process all of them, which is actually less than 0.2 seconds for each instance, which is not particularly slow, but things add up.

    So we split the generation across 16 files, one per operation, to take advantage of parallel certification. Each file contains a make-event form that generates (i) the rules for the operation, (ii) a named constant with the rules of the operation, and (iii) a named constant with the rule events. The argument of the make-event is a call of atc-exec-binary-rules-for-op-gen defined in this file. Then the top-level file exec-binary-strict-pure-rules.lisp puts together all the rule names, and generates a defsection with all the rule events, which are redundant and so are processed quickly, but in that way all the rules appear in XDOC.

    Definitions and Theorems

    Function: atc-exec-binary-rules-gen-op-ltype-rtype

    (defun atc-exec-binary-rules-gen-op-ltype-rtype (op ltype rtype)
     (declare (xargs :guard (and (binopp op)
                                 (typep ltype)
                                 (typep rtype))))
     (declare (xargs :guard (and (type-nonchar-integerp ltype)
                                 (type-nonchar-integerp rtype))))
     (let ((__function__ 'atc-exec-binary-rules-gen-op-ltype-rtype))
      (declare (ignorable __function__))
      (b*
       ((lfixtype (integer-type-to-fixtype ltype))
        (rfixtype (integer-type-to-fixtype rtype))
        (rpred (pack rfixtype 'p))
        (op-kind (binop-kind op))
        (op-values (pack op-kind '-values))
        (op-arithmetic-values (and (or (binop-case op :div)
                                       (binop-case op :mul)
                                       (binop-case op :rem)
                                       (binop-case op :add)
                                       (binop-case op :sub)
                                       (binop-case op :eq)
                                       (binop-case op :ne))
                                   (pack op-kind '-arithmetic-values)))
        (op-real-values (and (or (binop-case op :lt)
                                 (binop-case op :gt)
                                 (binop-case op :le)
                                 (binop-case op :ge))
                             (pack op-kind '-real-values)))
        (op-integer-values (pack op-kind '-integer-values))
        (op-ltype-and-value (pack op-kind '- lfixtype '-and-value))
        (type (uaconvert-types ltype rtype))
        (promotedp (and (member-eq op-kind '(:shl :shr))
                        (member-eq (type-kind ltype)
                                   '(:schar :uchar :sshort :ushort))))
        (name (pack op-ltype-and-value '-when-
                    rfixtype))
        (op-ltype-rtype (pack op-kind '- lfixtype '- rfixtype))
        (op-type-type (pack op-kind '-
                            (type-kind type)
                            '-
                            (type-kind type)))
        (op-type-type-okp (pack op-type-type '-okp))
        (op-ltype-rtype-okp
             (and (or (member-eq op-kind '(:div :rem :shl :shr))
                      (and (member-eq op-kind '(:add :sub :mul))
                           (type-signed-integerp type)))
                  (pack op-ltype-rtype '-okp)))
        (op-ltype (and (member-eq op-kind '(:shl :shr))
                       (pack op-kind '- (type-kind ltype))))
        (op-ltype-okp (and op-ltype (pack op-ltype '-okp)))
        (formula
         (cons
          'implies
          (cons
           (cons 'and
                 (cons (atc-syntaxp-hyp-for-expr-pure 'y)
                       (cons (cons rpred '(y))
                             (and op-ltype-rtype-okp
                                  (cons (cons op-ltype-rtype-okp '(x y))
                                        'nil)))))
           (cons (cons 'equal
                       (cons (cons op-ltype-and-value '(x y))
                             (cons (cons op-ltype-rtype '(x y))
                                   'nil)))
                 'nil))))
        (enables
         (cons
          op-ltype-and-value
          (append
           (if (member-eq op-kind '(:shl :shr))
               '(shl-values-to-shl-integer-values
                     shr-values-to-shr-integer-values
                     value-integerp-when-scharp
                     value-integerp-when-ucharp
                     value-integerp-when-sshortp
                     value-integerp-when-ushortp
                     value-integerp-when-sintp
                     value-integerp-when-uintp
                     value-integerp-when-slongp
                     value-integerp-when-ulongp
                     value-integerp-when-sllongp
                     value-integerp-when-ullongp)
             (list op-values))
           (append
            (and op-arithmetic-values
                 (list op-arithmetic-values))
            (append
             (and op-real-values (list op-real-values))
             (cons
              op-integer-values
              (cons
               op-ltype-rtype
               (append
                (and op-ltype (list op-ltype))
                (append
                 (and (member-eq op-kind
                                 '(:mul :div
                                        :rem :add
                                        :sub :lt
                                        :gt :le
                                        :ge :eq
                                        :ne :bitand
                                        :bitxor :bitior))
                      (or (not (equal type ltype))
                          (not (equal type rtype)))
                      (list op-type-type))
                 (append
                  (and promotedp (list (pack op-kind '-sint)))
                  (append
                   (and op-ltype-rtype-okp
                        (list op-ltype-rtype-okp))
                   (append
                    (and op-ltype-okp (list op-ltype-okp))
                    (append
                     (and
                         (member-eq op-kind '(:mul :div :rem :add :sub))
                         op-ltype-rtype-okp
                         (or (not (equal type ltype))
                             (not (equal type rtype)))
                         (list op-type-type-okp))
                     (append
                      (and promotedp
                           (list (pack op-kind '-sint-okp)))
                      (append
                       (if (member-eq op-kind '(:shl :shr))
                           *atc-promote-value-rules*
                         *atc-uaconvert-values-rules*)
                       (cons
                        'result-integer-value
                        (append
                         *atc-value-integer->get-rules*
                         (append
                          (and (member-eq op-kind '(:shl :shr))
                               *atc-sint-get-rules*)
                          (append
                           (and (member-eq op-kind '(:shl :shr))
                                '(integer-type-bits-when-type-sint
                                      integer-type-bits-when-type-uint
                                      integer-type-bits-when-type-slong
                                      integer-type-bits-when-type-ulong
                                      integer-type-bits-when-type-sllong
                                      integer-type-bits-when-type-ullong
                                      type-of-value-when-sintp
                                      type-of-value-when-uintp
                                      type-of-value-when-slongp
                                      type-of-value-when-ulongp
                                      type-of-value-when-sllongp
                                      type-of-value-when-ullongp))
                           (cons
                            'apconvert-expr-value-when-not-value-array
                            (cons
                             'value-integer
                             (cons
                              'value-sint-to-sint-from-integer
                              (cons
                               'value-uint-to-uint-from-integer
                               (cons
                                'value-slong-to-slong-from-integer
                                (cons
                                 'value-ulong-to-ulong-from-integer
                                 (cons
                                  'value-sllong-to-sllong-from-integer
                                  (cons
                                   'value-ullong-to-ullong-from-integer
                                   (cons
                                    'sint-integerp-alt-def
                                    (cons
                                     'uint-integerp-alt-def
                                     (cons
                                      'slong-integerp-alt-def
                                      (cons
                                       'ulong-integerp-alt-def
                                       (cons
                                        'sllong-integerp-alt-def
                                        (cons
                                         'ullong-integerp-alt-def
                                         (cons
                                          'uint-from-integer-mod
                                          (cons
                                           'ulong-from-integer-mod
                                           (cons
                                            'ullong-from-integer-mod
                                            (cons
                                             'value-unsigned-integerp-alt-def
                                             (append
                                              (and
                                               (member-eq
                                                    op-kind
                                                    '(:add :sub :mul
                                                           :div :rem))
                                               '(value-arithmeticp-when-uintp
                                                 value-arithmeticp-when-sintp
                                                 value-arithmeticp-when-ulongp
                                                 value-arithmeticp-when-slongp
                                                 value-arithmeticp-when-ullongp
                                                 value-arithmeticp-when-sllongp))
                                              (append
                                               (and
                                                (member-eq
                                                     op-kind
                                                     '(:add :sub :mul
                                                            :div :rem))
                                                '(type-of-value-when-sintp
                                                  type-of-value-when-uintp
                                                  type-of-value-when-slongp
                                                  type-of-value-when-ulongp
                                                  type-of-value-when-sllongp
                                                  type-of-value-when-ullongp))
                                               (append
                                                (and
                                                 (member-eq
                                                      op-kind
                                                      '(:add :sub :mul
                                                             :div :rem))
                                                 '((:e uint-max)
                                                   (:e ulong-max)
                                                   (:e ullong-max)
                                                   (:e sint-min)
                                                   (:e sint-max)
                                                   (:e slong-min)
                                                   (:e slong-max)
                                                   (:e sllong-min)
                                                   (:e sllong-max)))
                                                (cons
                                                 'integer-type-rangep
                                                 (and
                                                  (not
                                                   (member-eq
                                                     op-kind
                                                     '(:add :sub :mul
                                                            :div :rem)))
                                                  '(integer-type-min
                                                    integer-type-max
                                                    bit-width-value-choices)))))))))))))))))))))))))))))))))))))))))))
        (event
         (cons
          'defruled
          (cons
           name
           (cons
            formula
            (cons
             ':enable
             (cons
              enables
              (cons
               ':disable
               (cons
                  (append (and (member-eq op-kind '(:shl :shr))
                               '((:e int-bits)
                                 (:e integer-type-bits)
                                 (:e integer-type-min)
                                 (:e integer-type-max)))
                          '(equal-of-error
                                equal-of-value-schar
                                equal-of-value-uchar
                                equal-of-value-sshort
                                equal-of-value-ushort
                                equal-of-value-sint
                                equal-of-value-uint equal-of-value-slong
                                equal-of-value-ulong
                                equal-of-value-sllong
                                equal-of-value-ullong))
                  'nil)))))))))
       (mv name event))))

    Theorem: symbolp-of-atc-exec-binary-rules-gen-op-ltype-rtype.name

    (defthm symbolp-of-atc-exec-binary-rules-gen-op-ltype-rtype.name
      (b* (((mv ?name acl2::?event)
            (atc-exec-binary-rules-gen-op-ltype-rtype op ltype rtype)))
        (symbolp name))
      :rule-classes :rewrite)

    Theorem: pseudo-event-formp-of-atc-exec-binary-rules-gen-op-ltype-rtype.event

    (defthm
     pseudo-event-formp-of-atc-exec-binary-rules-gen-op-ltype-rtype.event
     (b* (((mv ?name acl2::?event)
           (atc-exec-binary-rules-gen-op-ltype-rtype op ltype rtype)))
       (pseudo-event-formp event))
     :rule-classes :rewrite)

    Function: atc-exec-binary-rules-gen-op-ltype

    (defun atc-exec-binary-rules-gen-op-ltype (op ltype rtypes)
     (declare (xargs :guard (and (binopp op)
                                 (typep ltype)
                                 (type-listp rtypes))))
     (declare (xargs :guard (and (type-nonchar-integerp ltype)
                                 (type-nonchar-integer-listp rtypes))))
     (let ((__function__ 'atc-exec-binary-rules-gen-op-ltype))
      (declare (ignorable __function__))
      (b* (((when (endp rtypes)) (mv nil nil))
           ((mv name event)
            (atc-exec-binary-rules-gen-op-ltype-rtype
                 op ltype (car rtypes)))
           ((mv names events)
            (atc-exec-binary-rules-gen-op-ltype op ltype (cdr rtypes))))
        (mv (cons name names)
            (cons event events)))))

    Theorem: symbol-listp-of-atc-exec-binary-rules-gen-op-ltype.names

    (defthm symbol-listp-of-atc-exec-binary-rules-gen-op-ltype.names
      (b* (((mv ?names ?events)
            (atc-exec-binary-rules-gen-op-ltype op ltype rtypes)))
        (symbol-listp names))
      :rule-classes :rewrite)

    Theorem: pseudo-event-form-listp-of-atc-exec-binary-rules-gen-op-ltype.events

    (defthm
     pseudo-event-form-listp-of-atc-exec-binary-rules-gen-op-ltype.events
     (b* (((mv ?names ?events)
           (atc-exec-binary-rules-gen-op-ltype op ltype rtypes)))
       (pseudo-event-form-listp events))
     :rule-classes :rewrite)

    Function: atc-exec-binary-rules-gen-op

    (defun atc-exec-binary-rules-gen-op (op ltypes rtypes)
     (declare (xargs :guard (and (binopp op)
                                 (type-listp ltypes)
                                 (type-listp rtypes))))
     (declare (xargs :guard (and (type-nonchar-integer-listp ltypes)
                                 (type-nonchar-integer-listp rtypes))))
     (let ((__function__ 'atc-exec-binary-rules-gen-op))
      (declare (ignorable __function__))
      (b*
       (((when (endp ltypes)) (mv nil nil))
        (ltype (car ltypes))
        (lfixtype (integer-type-to-fixtype ltype))
        (lpred (pack lfixtype 'p))
        (ltype-fix (pack lfixtype '-fix))
        (op-kind (binop-kind op))
        (op-values (pack op-kind '-values))
        (op-ltype-and-value (pack op-kind '- lfixtype '-and-value))
        (op-values-when-ltype (pack op-kind '-values-when- lfixtype))
        (fun-event
         (cons
              'defund
              (cons op-ltype-and-value
                    (cons '(x y)
                          (cons (cons op-values
                                      (cons (cons ltype-fix '(x)) '(y)))
                                'nil)))))
        (thm-event
         (cons
          'defruled
          (cons
           op-values-when-ltype
           (cons
            (cons
             'implies
             (cons
                (cons 'and
                      (cons (atc-syntaxp-hyp-for-expr-pure 'x)
                            (cons (cons lpred '(x)) 'nil)))
                (cons (cons 'equal
                            (cons (cons op-values '(x y))
                                  (cons (cons op-ltype-and-value '(x y))
                                        'nil)))
                      'nil)))
            (cons ':enable
                  (cons (cons op-ltype-and-value 'nil)
                        'nil))))))
        ((mv names events)
         (atc-exec-binary-rules-gen-op-ltype op (car ltypes)
                                             rtypes))
        ((mv more-names more-events)
         (atc-exec-binary-rules-gen-op op (cdr ltypes)
                                       rtypes)))
       (mv (append (list op-values-when-ltype)
                   names more-names)
           (append (list fun-event thm-event)
                   events more-events)))))

    Theorem: symbol-listp-of-atc-exec-binary-rules-gen-op.names

    (defthm symbol-listp-of-atc-exec-binary-rules-gen-op.names
      (b* (((mv ?names ?events)
            (atc-exec-binary-rules-gen-op op ltypes rtypes)))
        (symbol-listp names))
      :rule-classes :rewrite)

    Theorem: pseudo-event-form-listp-of-atc-exec-binary-rules-gen-op.events

    (defthm
         pseudo-event-form-listp-of-atc-exec-binary-rules-gen-op.events
      (b* (((mv ?names ?events)
            (atc-exec-binary-rules-gen-op op ltypes rtypes)))
        (pseudo-event-form-listp events))
      :rule-classes :rewrite)

    Function: atc-exec-binary-rules-gen

    (defun atc-exec-binary-rules-gen (ops ltypes rtypes)
     (declare (xargs :guard (and (binop-listp ops)
                                 (type-listp ltypes)
                                 (type-listp rtypes))))
     (declare (xargs :guard (and (type-nonchar-integer-listp ltypes)
                                 (type-nonchar-integer-listp rtypes))))
     (let ((__function__ 'atc-exec-binary-rules-gen))
      (declare (ignorable __function__))
      (b*
       (((when (endp ops)) (mv nil nil))
        (op (car ops))
        (op-kind (binop-kind op))
        (op-values (pack op-kind '-values))
        (exec-binary-strict-pure-when-op
             (pack 'exec-binary-strict-pure-when-
                   op-kind))
        (thm-event
         (cons
          'defruled
          (cons
           exec-binary-strict-pure-when-op
           (cons
            (cons
             'implies
             (cons
              (cons
               'and
               (cons
                (cons 'equal
                      (cons 'op
                            (cons (cons (pack 'binop- op-kind) 'nil)
                                  'nil)))
                (cons
                 '(not (equal (value-kind x) :array))
                 (cons
                  '(not (equal (value-kind y) :array))
                  (cons
                       (cons 'equal
                             (cons 'val
                                   (cons (cons op-values '(x y)) 'nil)))
                       '((valuep val)))))))
              '((equal
                     (exec-binary-strict-pure op (expr-value x objdes-x)
                                              (expr-value y objdes-y))
                     (expr-value val nil)))))
            '(:enable
                  (exec-binary-strict-pure
                       eval-binary-strict-pure
                       apconvert-expr-value-when-not-value-array))))))
        ((mv names events)
         (atc-exec-binary-rules-gen-op op ltypes rtypes))
        ((mv more-names more-events)
         (atc-exec-binary-rules-gen (cdr ops)
                                    ltypes rtypes)))
       (mv (append (list exec-binary-strict-pure-when-op)
                   names more-names)
           (append (list thm-event)
                   events more-events)))))

    Theorem: symbol-listp-of-atc-exec-binary-rules-gen.names

    (defthm symbol-listp-of-atc-exec-binary-rules-gen.names
      (b* (((mv ?names ?events)
            (atc-exec-binary-rules-gen ops ltypes rtypes)))
        (symbol-listp names))
      :rule-classes :rewrite)

    Theorem: pseudo-event-form-listp-of-atc-exec-binary-rules-gen.events

    (defthm pseudo-event-form-listp-of-atc-exec-binary-rules-gen.events
      (b* (((mv ?names ?events)
            (atc-exec-binary-rules-gen ops ltypes rtypes)))
        (pseudo-event-form-listp events))
      :rule-classes :rewrite)

    Function: atc-exec-binary-rules-for-op-gen

    (defun atc-exec-binary-rules-for-op-gen (op)
      (declare (xargs :guard (binopp op)))
      (let ((__function__ 'atc-exec-binary-rules-for-op-gen))
        (declare (ignorable __function__))
        (b* (((mv names events)
              (atc-exec-binary-rules-gen (list op)
                                         *nonchar-integer-types*
                                         *nonchar-integer-types*))
             (atc-exec-op-rules (pack '*atc-exec-
                                      (binop-kind op)
                                      '-rules*))
             (defconst-names
                  (cons 'defconst
                        (cons atc-exec-op-rules
                              (cons (cons 'quote (cons names 'nil))
                                    'nil))))
             (atc-exec-op-events (pack '*atc-exec-
                                       (binop-kind op)
                                       '-events*))
             (defconst-events
                  (cons 'defconst
                        (cons atc-exec-op-events
                              (cons (cons 'quote (cons events 'nil))
                                    'nil)))))
          (cons 'progn
                (append events
                        (cons defconst-names
                              (cons defconst-events 'nil)))))))

    Theorem: pseudo-event-formp-of-atc-exec-binary-rules-for-op-gen

    (defthm pseudo-event-formp-of-atc-exec-binary-rules-for-op-gen
      (b* ((event (atc-exec-binary-rules-for-op-gen op)))
        (pseudo-event-formp event))
      :rule-classes :rewrite)