• 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
                  • Value-type-case
                  • Value-type-fix
                    • Value-type-equiv
                    • Value-typep
                    • Value-type-plaintext
                    • Value-type-record
                    • Value-type-extrecord
                    • Value-type-kind
                  • 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
                  • 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
    • Value-type

    Value-type-fix

    Fixing function for value-type structures.

    Signature
    (value-type-fix x) → new-x
    Arguments
    x — Guard (value-typep x).
    Returns
    new-x — Type (value-typep new-x).

    Definitions and Theorems

    Function: value-type-fix$inline

    (defun value-type-fix$inline (x)
     (declare (xargs :guard (value-typep x)))
     (let ((__function__ 'value-type-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (case (value-type-kind x)
          (:plaintext
               (b* ((type (plaintext-type-fix (std::da-nth 0 (cdr x))))
                    (vis (visibility-fix (std::da-nth 1 (cdr x)))))
                 (cons :plaintext (list type vis))))
          (:record (b* ((name (identifier-fix (std::da-nth 0 (cdr x)))))
                     (cons :record (list name))))
          (:extrecord (b* ((loc (locator-fix (std::da-nth 0 (cdr x)))))
                        (cons :extrecord (list loc)))))
        :exec x)))

    Theorem: value-typep-of-value-type-fix

    (defthm value-typep-of-value-type-fix
      (b* ((new-x (value-type-fix$inline x)))
        (value-typep new-x))
      :rule-classes :rewrite)

    Theorem: value-type-fix-when-value-typep

    (defthm value-type-fix-when-value-typep
      (implies (value-typep x)
               (equal (value-type-fix x) x)))

    Function: value-type-equiv$inline

    (defun value-type-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (value-typep acl2::x)
                                  (value-typep acl2::y))))
      (equal (value-type-fix acl2::x)
             (value-type-fix acl2::y)))

    Theorem: value-type-equiv-is-an-equivalence

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

    Theorem: value-type-equiv-implies-equal-value-type-fix-1

    (defthm value-type-equiv-implies-equal-value-type-fix-1
      (implies (value-type-equiv acl2::x x-equiv)
               (equal (value-type-fix acl2::x)
                      (value-type-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: value-type-fix-under-value-type-equiv

    (defthm value-type-fix-under-value-type-equiv
      (value-type-equiv (value-type-fix acl2::x)
                        acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-value-type-fix-1-forward-to-value-type-equiv

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

    Theorem: equal-of-value-type-fix-2-forward-to-value-type-equiv

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

    Theorem: value-type-equiv-of-value-type-fix-1-forward

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

    Theorem: value-type-equiv-of-value-type-fix-2-forward

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

    Theorem: value-type-kind$inline-of-value-type-fix-x

    (defthm value-type-kind$inline-of-value-type-fix-x
      (equal (value-type-kind$inline (value-type-fix x))
             (value-type-kind$inline x)))

    Theorem: value-type-kind$inline-value-type-equiv-congruence-on-x

    (defthm value-type-kind$inline-value-type-equiv-congruence-on-x
      (implies (value-type-equiv x x-equiv)
               (equal (value-type-kind$inline x)
                      (value-type-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-value-type-fix

    (defthm consp-of-value-type-fix
      (consp (value-type-fix x))
      :rule-classes :type-prescription)