• 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
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defmapping-event-generation

    Defmapping-gen-beta-injective

    Generate the :beta-injective theorem.

    Signature
    (defmapping-gen-beta-injective domb$ alpha$ beta$ a1...an 
                                   b1...bm unconditional$ thm-names$ 
                                   thm-enable$ appcond-thm-names wrld) 
     
      → 
    (mv local-event exported-event)
    Arguments
    domb$ — Guard (pseudo-termfnp domb$).
    alpha$ — Guard (pseudo-termfnp alpha$).
    beta$ — Guard (pseudo-termfnp beta$).
    a1...an — Guard (symbol-listp a1...an).
    b1...bm — Guard (symbol-listp b1...bm).
    unconditional$ — Guard (booleanp unconditional$).
    thm-names$ — Guard (symbol-symbol-alistp thm-names$).
    thm-enable$ — Guard (keyword-listp thm-enable$).
    appcond-thm-names — Guard (symbol-symbol-alistp appcond-thm-names).
    wrld — Guard (plist-worldp wrld).
    Returns
    local-event — A pseudo-event-formp.
    exported-event — A pseudo-event-formp.

    This function is called if only if the :alpha-of-beta-thm input is t.

    We generate hints based on the proofs in the design notes. The :cases hints correspond, in the proof in the design notes, to the inference step that applies \alpha to both sides of the equality \beta(b)=\beta(b'). The hints for these proofs are the same whether :unconditional is t or nil.

    Definitions and Theorems

    Function: defmapping-gen-beta-injective

    (defun defmapping-gen-beta-injective
           (domb$ alpha$ beta$ a1...an
                  b1...bm unconditional$ thm-names$
                  thm-enable$ appcond-thm-names wrld)
     (declare
          (xargs :guard (and (pseudo-termfnp domb$)
                             (pseudo-termfnp alpha$)
                             (pseudo-termfnp beta$)
                             (symbol-listp a1...an)
                             (symbol-listp b1...bm)
                             (booleanp unconditional$)
                             (symbol-symbol-alistp thm-names$)
                             (keyword-listp thm-enable$)
                             (symbol-symbol-alistp appcond-thm-names)
                             (plist-worldp wrld))))
     (let ((__function__ 'defmapping-gen-beta-injective))
      (declare (ignorable __function__))
      (b*
       ((bb1...bbm (defmapping-gen-var-aa/bb b1...bm))
        (name (cdr (assoc-eq :beta-injective thm-names$)))
        (formula
         (b*
          ((antecedent (if unconditional$ *t*
                         (conjoin2 (apply-term domb$ b1...bm)
                                   (apply-term domb$ bb1...bbm))))
           (consequent
              (cons 'equal
                    (cons (cons 'equal
                                (cons (apply-term beta$ b1...bm)
                                      (cons (apply-term beta$ bb1...bbm)
                                            'nil)))
                          (cons (conjoin-equalities b1...bm bb1...bbm)
                                'nil))))
           (formula (implicate antecedent consequent)))
          (untranslate formula t wrld)))
        (hints
         (b*
          ((alpha-of-beta
                (cdr (assoc-eq :alpha-of-beta appcond-thm-names)))
           (alpha-of-beta-instance
            (cons
               ':instance
               (cons alpha-of-beta
                     (alist-to-doublets (pairlis$ b1...bm bb1...bbm)))))
           (n (len a1...an))
           (cases-hints-formula
            (if
             (= n 1)
             (cons
              'equal
              (cons
                 (apply-term* alpha$ (apply-term beta$ b1...bm))
                 (cons (apply-term* alpha$ (apply-term beta$ bb1...bbm))
                       'nil)))
             (cons
              'equal
              (cons
               (apply-term alpha$
                           (make-mv-nth-calls (apply-term beta$ b1...bm)
                                              n))
               (cons
                    (apply-term
                         alpha$
                         (make-mv-nth-calls (apply-term beta$ bb1...bbm)
                                            n))
                    'nil))))))
          (cons
           (cons
            '"Goal"
            (cons
             ':in-theory
             (cons
              'nil
              (cons
               ':cases
               (cons
                   (cons cases-hints-formula 'nil)
                   (cons ':use
                         (cons (cons alpha-of-beta
                                     (cons alpha-of-beta-instance 'nil))
                               'nil)))))))
           'nil)))
        (defthmr/defthmdr (if (member-eq :beta-injective thm-enable$)
                              'defthmr
                            'defthmdr))
        (local-event
         (cons
             'local
             (cons (cons defthmr/defthmdr
                         (cons name
                               (cons formula
                                     (cons ':hints (cons hints 'nil)))))
                   'nil)))
        (exported-event (cons defthmr/defthmdr
                              (cons name (cons formula 'nil)))))
       (mv local-event exported-event))))