• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
        • Defprojection
        • Deflist
        • Defaggregate
        • Define
        • Defmapping
          • Defsurj
          • Defiso
          • Defmapping-implementation
            • Defmapping-event-generation
              • Defmapping-gen-everything
              • Defmapping-gen-appconds
              • Defmapping-gen-beta-injective
              • Defmapping-gen-alpha-injective
              • Defmapping-gen-nonappcond-thms
              • Defmapping-gen-thms
              • Defmapping-gen-ext-table
              • Defmapping-gen-appcond-thm
                • Defmapping-differentiate-a/b-vars
                • Defmapping-gen-appcond-thms
                • Defmapping-gen-print-result
                • Defmapping-gen-var-aa/bb
                • Defmapping-gen-var-b1...bm
                • Defmapping-gen-var-a1...an
              • Defmapping-check-redundancy
              • Defmapping-table
              • Defmapping-fn
              • Defmapping-input-processing
              • Defmapping-macro-definition
            • Definj
          • Defenum
          • Add-io-pairs
          • Defalist
          • Defmapappend
          • Returns-specifiers
          • Defarbrec
          • Defines
          • Define-sk
          • Error-value-tuples
          • Defmax-nat
          • Defmin-int
          • Deftutorial
          • Extended-formals
          • Defrule
          • Defval
          • Defsurj
          • Defiso
          • Defconstrained-recognizer
          • Deffixer
          • Defmvtypes
          • Defconsts
          • Defthm-unsigned-byte-p
          • Support
          • Defthm-signed-byte-p
          • Defthm-natp
          • Defund-sk
          • Defmacro+
          • Defsum
          • Defthm-commutative
          • Definj
          • Defirrelevant
          • Defredundant
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defmapping-event-generation

    Defmapping-gen-appcond-thm

    Generate a theorem event from an applicability condition.

    Signature
    (defmapping-gen-appcond-thm appcond appcond-thm-names 
                                thm-names$ thm-enable$ wrld) 
     
      → 
    (mv local-event exported-event)
    Arguments
    appcond — Guard (evmac-appcondp appcond).
    appcond-thm-names — Guard (symbol-symbol-alistp appcond-thm-names).
    thm-names$ — Guard (symbol-symbol-alistp thm-names$).
    thm-enable$ — Guard (keyword-listp thm-enable$).
    wrld — Guard (plist-worldp wrld).
    Returns
    local-event — A pseudo-event-formp.
    exported-event — A pseudo-event-formp.

    All the applicability conditions that must hold for the defmapping call are turned into theorems exported from the encapsulate. To keep the ACL2 history ``clean'', we generate the theorem in local form with a :by hint (the references the local theorem name of the applicability condition; this name generally differs from the theorem name determined by :thm-names), and in non-local, redundant form without hints.

    Definitions and Theorems

    Function: defmapping-gen-appcond-thm

    (defun defmapping-gen-appcond-thm
           (appcond appcond-thm-names
                    thm-names$ thm-enable$ wrld)
     (declare
          (xargs :guard (and (evmac-appcondp appcond)
                             (symbol-symbol-alistp appcond-thm-names)
                             (symbol-symbol-alistp thm-names$)
                             (keyword-listp thm-enable$)
                             (plist-worldp wrld))))
     (let ((__function__ 'defmapping-gen-appcond-thm))
      (declare (ignorable __function__))
      (b*
       (((evmac-appcond appcond) appcond)
        (thm-name (cdr (assoc-eq appcond.name thm-names$)))
        (thm-formula (untranslate appcond.formula t wrld))
        (thm-hints
         (cons
          (cons
             '"Goal"
             (cons ':by
                   (cons (cdr (assoc-eq appcond.name appcond-thm-names))
                         'nil)))
          'nil))
        (defthmr/defthmdr (if (member-eq appcond.name thm-enable$)
                              'defthmr
                            'defthmdr))
        (local-event
         (cons
          'local
          (cons
               (cons defthmr/defthmdr
                     (cons thm-name
                           (cons thm-formula
                                 (cons ':hints (cons thm-hints 'nil)))))
               'nil)))
        (exported-event (cons defthmr/defthmdr
                              (cons thm-name (cons thm-formula 'nil)))))
       (mv local-event exported-event))))