• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
          • Circuits
          • Language
            • Grammar
            • Early-version
              • Abstract-syntax
                • Binary-op
                • Literal
                • Instruction
                • Hash-op
                • Literal-type
                • Operand
                • Unary-op
                • Identifier
                • Commit-op
                • Mapping
                • Function
                • Programdef
                • Finalize-type
                • Closure
                • Register-type
                • Finalizer
                • Value-type
                • Record-type
                • Command
                • Plaintext-type
                • Finalization-option
                • Visibility
                • Register
                • Reference
                • Programid
                • Locator
                • Finalization
                • Entry-type
                • Regaccess
                • Program
                • Interface-type
                • Ident+ptype
                • Ident+etype
                • Function-output
                • Finalize-output
                • Finalize-input
                • Closure-output
                • Closure-input
                • Assert-op
                • Function-input
                  • Function-input-fix
                    • Function-input-equiv
                    • Make-function-input
                    • Function-input->type
                    • Function-input->reg
                    • Change-function-input
                    • Function-inputp
                  • Equal-op
                  • Finalize-command
                  • Ternary-op
                  • Import
                  • Ident+ptype-list
                  • Operand-list
                  • Ident+etype-list
                  • Programdef-list
                  • Instruction-list
                  • Import-list
                  • Identifier-list
                  • Function-output-list
                  • Function-input-list
                  • Finalize-output-list
                  • Finalize-input-list
                  • Command-list
                  • Closure-output-list
                  • Closure-input-list
                • Parser
                • Concrete-syntax
              • Concrete-syntax
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Function-input

    Function-input-fix

    Fixing function for function-input structures.

    Signature
    (function-input-fix x) → new-x
    Arguments
    x — Guard (function-inputp x).
    Returns
    new-x — Type (function-inputp new-x).

    Definitions and Theorems

    Function: function-input-fix$inline

    (defun function-input-fix$inline (x)
      (declare (xargs :guard (function-inputp x)))
      (let ((__function__ 'function-input-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((reg (register-fix (cdr (std::da-nth 0 (cdr x)))))
                  (type (value-type-fix (cdr (std::da-nth 1 (cdr x))))))
               (cons :function-input (list (cons 'reg reg)
                                           (cons 'type type))))
             :exec x)))

    Theorem: function-inputp-of-function-input-fix

    (defthm function-inputp-of-function-input-fix
      (b* ((new-x (function-input-fix$inline x)))
        (function-inputp new-x))
      :rule-classes :rewrite)

    Theorem: function-input-fix-when-function-inputp

    (defthm function-input-fix-when-function-inputp
      (implies (function-inputp x)
               (equal (function-input-fix x) x)))

    Function: function-input-equiv$inline

    (defun function-input-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (function-inputp acl2::x)
                                  (function-inputp acl2::y))))
      (equal (function-input-fix acl2::x)
             (function-input-fix acl2::y)))

    Theorem: function-input-equiv-is-an-equivalence

    (defthm function-input-equiv-is-an-equivalence
      (and (booleanp (function-input-equiv x y))
           (function-input-equiv x x)
           (implies (function-input-equiv x y)
                    (function-input-equiv y x))
           (implies (and (function-input-equiv x y)
                         (function-input-equiv y z))
                    (function-input-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: function-input-equiv-implies-equal-function-input-fix-1

    (defthm function-input-equiv-implies-equal-function-input-fix-1
      (implies (function-input-equiv acl2::x x-equiv)
               (equal (function-input-fix acl2::x)
                      (function-input-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: function-input-fix-under-function-input-equiv

    (defthm function-input-fix-under-function-input-equiv
      (function-input-equiv (function-input-fix acl2::x)
                            acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-function-input-fix-1-forward-to-function-input-equiv

    (defthm
          equal-of-function-input-fix-1-forward-to-function-input-equiv
      (implies (equal (function-input-fix acl2::x)
                      acl2::y)
               (function-input-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-function-input-fix-2-forward-to-function-input-equiv

    (defthm
          equal-of-function-input-fix-2-forward-to-function-input-equiv
      (implies (equal acl2::x (function-input-fix acl2::y))
               (function-input-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: function-input-equiv-of-function-input-fix-1-forward

    (defthm function-input-equiv-of-function-input-fix-1-forward
      (implies (function-input-equiv (function-input-fix acl2::x)
                                     acl2::y)
               (function-input-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: function-input-equiv-of-function-input-fix-2-forward

    (defthm function-input-equiv-of-function-input-fix-2-forward
      (implies
           (function-input-equiv acl2::x (function-input-fix acl2::y))
           (function-input-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)