• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
            • Restrict-implementation
              • Restrict-event-generation
                • Restrict-gen-verify-guards
                • Restrict-gen-everything
                • Restrict-gen-old-to-new
                • Restrict-gen-new
                • Restrict-gen-restriction-of-rec-calls-consequent-term
                • Restrict-gen-new-to-old
                  • Restrict-gen-appconds
                  • Restrict-gen-restriction-of-rec-calls-consequent-term-aux
                • Restrict-fn
                • Restrict-macro-definition
                • Restrict-input-processing
            • Expdata
            • Casesplit
            • Simplify-term
            • Simplify-defun-sk
            • Parteval
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Restrict-event-generation

    Restrict-gen-new-to-old

    Generate the theorem that relates the new and old functions.

    Signature
    (restrict-gen-new-to-old old restriction new new-to-old 
                             new-to-old-enable old-to-new wrld) 
     
      → 
    (mv local-event exported-event)
    Arguments
    old — Guard (symbolp old).
    restriction — Guard (pseudo-termp restriction).
    new — Guard (symbolp new).
    new-to-old — Guard (symbolp new-to-old).
    new-to-old-enable — Guard (booleanp new-to-old-enable).
    old-to-new — Guard (symbolp old-to-new).
    wrld — Guard (plist-worldp wrld).
    Returns
    local-event — A pseudo-event-formp.
    exported-event — A pseudo-event-formp.

    The macro used to introduce the theorem is determined by whether the theorem must be enabled or not.

    The formula of the theorem equates new and old functions under the restricting predicate, as described in the documentation.

    The theorem is easily proved from the old-to-new one.

    Definitions and Theorems

    Function: restrict-gen-new-to-old

    (defun restrict-gen-new-to-old
           (old restriction new new-to-old
                new-to-old-enable old-to-new wrld)
     (declare (xargs :guard (and (symbolp old)
                                 (pseudo-termp restriction)
                                 (symbolp new)
                                 (symbolp new-to-old)
                                 (booleanp new-to-old-enable)
                                 (symbolp old-to-new)
                                 (plist-worldp wrld))))
     (let ((__function__ 'restrict-gen-new-to-old))
      (declare (ignorable __function__))
      (b*
       ((formals (formals old wrld))
        (formula
             (implicate restriction
                        (cons 'equal
                              (cons (cons new formals)
                                    (cons (cons old formals) 'nil)))))
        (formula (untranslate formula t wrld))
        (hints
         (cons
             (cons '"Goal"
                   (cons ':in-theory
                         (cons (cons 'quote
                                     (cons (cons old-to-new 'nil) 'nil))
                               'nil)))
             'nil)))
       (evmac-generate-defthm new-to-old
                              :formula formula
                              :hints hints
                              :enable new-to-old-enable))))