• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
          • Renaming-variables
          • Dead-code-eliminator
          • Renamings
          • Disambiguator
          • Unique-variables
          • Dead-code-eliminator-static-safety
          • No-function-definitions
          • Unique-functions
          • Renaming-functions
            • Statements/blocks/cases/fundefs-renamefun
            • Expressions-renamefun
            • Fundef-list-renamefun
            • Expression-option-renamefun
            • Funcall-option-renamefun
              • Add-funs-to-fun-renaming
              • Add-fun-to-fun-renaming
              • Fun-renamefun
            • Dead-code-eliminator-no-loop-initializers
            • Dead-code-eliminator-no-function-definitions
            • No-loop-initializers
            • For-loop-init-rewriter
          • Language
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Renaming-functions

    Funcall-option-renamefun

    Check if two optional function calls are related by function renaming.

    Signature
    (funcall-option-renamefun old new ren) → _
    Arguments
    old — Guard (funcall-optionp old).
    new — Guard (funcall-optionp new).
    ren — Guard (renamingp ren).
    Returns
    _ — Type (reserr-optionp _).

    Either both function calls must be present or both must be absent. If present, they must be related.

    Definitions and Theorems

    Function: funcall-option-renamefun

    (defun funcall-option-renamefun (old new ren)
     (declare (xargs :guard (and (funcall-optionp old)
                                 (funcall-optionp new)
                                 (renamingp ren))))
     (let ((__function__ 'funcall-option-renamefun))
       (declare (ignorable __function__))
       (funcall-option-case
            old :none
            (if (funcall-option-case new :none)
                nil
              (reserrf (list :mismatch (funcall-option-fix old)
                             (funcall-option-fix new))))
            :some
            (funcall-option-case
                 new
                 :none (reserrf (list :mismatch (funcall-option-fix old)
                                      (funcall-option-fix new)))
                 :some (funcall-renamefun (funcall-option-some->val old)
                                          (funcall-option-some->val new)
                                          ren)))))

    Theorem: reserr-optionp-of-funcall-option-renamefun

    (defthm reserr-optionp-of-funcall-option-renamefun
      (b* ((_ (funcall-option-renamefun old new ren)))
        (reserr-optionp _))
      :rule-classes :rewrite)

    Theorem: funcall-option-renamefun-of-funcall-option-fix-old

    (defthm funcall-option-renamefun-of-funcall-option-fix-old
      (equal (funcall-option-renamefun (funcall-option-fix old)
                                       new ren)
             (funcall-option-renamefun old new ren)))

    Theorem: funcall-option-renamefun-funcall-option-equiv-congruence-on-old

    (defthm
        funcall-option-renamefun-funcall-option-equiv-congruence-on-old
      (implies (funcall-option-equiv old old-equiv)
               (equal (funcall-option-renamefun old new ren)
                      (funcall-option-renamefun old-equiv new ren)))
      :rule-classes :congruence)

    Theorem: funcall-option-renamefun-of-funcall-option-fix-new

    (defthm funcall-option-renamefun-of-funcall-option-fix-new
      (equal (funcall-option-renamefun old (funcall-option-fix new)
                                       ren)
             (funcall-option-renamefun old new ren)))

    Theorem: funcall-option-renamefun-funcall-option-equiv-congruence-on-new

    (defthm
        funcall-option-renamefun-funcall-option-equiv-congruence-on-new
      (implies (funcall-option-equiv new new-equiv)
               (equal (funcall-option-renamefun old new ren)
                      (funcall-option-renamefun old new-equiv ren)))
      :rule-classes :congruence)

    Theorem: funcall-option-renamefun-of-renaming-fix-ren

    (defthm funcall-option-renamefun-of-renaming-fix-ren
      (equal (funcall-option-renamefun old new (renaming-fix ren))
             (funcall-option-renamefun old new ren)))

    Theorem: funcall-option-renamefun-renaming-equiv-congruence-on-ren

    (defthm funcall-option-renamefun-renaming-equiv-congruence-on-ren
      (implies (renaming-equiv ren ren-equiv)
               (equal (funcall-option-renamefun old new ren)
                      (funcall-option-renamefun old new ren-equiv)))
      :rule-classes :congruence)