• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Concrete-syntax
            • Ascii-identifiers
            • Unambiguity
            • Preprocessing
            • Abstract-syntax
              • Abstract-syntax-trees
                • Expr
                • Exprs/decls/stmts
                • Type-spec
                • Binop
                • Stmt
                • Amb-expr/tyname
                • Dirdeclor
                • Unop
                • Asm-stmt
                • Dec/oct/hex-const
                • Simple-escape
                • Attrib
                • Ident
                • Amb-decl/stmt
                • Dirabsdeclor
                • Decl-spec
                • Structdecl
                • Fundef
                • Transunit-ensemble
                • Asm-name-spec
                • Amb-declor/absdeclor
                • Param-declor
                • Declor
                • Type-qual
                • Tyname
                • Absdeclor
                • Struni-spec
                • Stor-spec
                • Keyword-uscores
                • Align-spec
                • Label
                • Expr-option
                • Spec/qual
                • Lsuffix
                • Hex-frac-const
                • Desiniter
                • Iconst
                • Dirabsdeclor-option
                • Dec-frac-const
                • Dec-core-fconst
                • Extdecl
                  • Extdecl-case
                  • Extdecl-fix
                    • Extdeclp
                    • Extdecl-equiv
                    • Extdecl-fundef
                    • Extdecl-decl
                    • Extdecl-asm
                    • Extdecl-kind
                    • Extdecl-empty
                  • Amb?-declor/absdeclor
                  • Isuffix
                  • Initdeclor
                  • Hex-core-fconst
                  • Const-expr-option
                  • Attrib-spec
                  • Structdeclor
                  • Escape
                  • Decl
                  • Amb?-expr/tyname
                  • Ident-option
                  • Bin-expo
                  • Absdeclor-option
                  • Statassert
                  • Param-declon
                  • Member-designor
                  • Initer-option
                  • Initer
                  • Fsuffix
                  • Enumspec
                  • Declor-option
                  • Const
                  • Block-item
                  • Hex-quad
                  • Eprefix
                  • Const-expr
                  • Oct-escape
                  • Inc/dec-op
                  • Fun-spec
                  • Dec-expo
                  • Cprefix-option
                  • Asm-name-spec-option
                  • Amb?-decl/stmt
                  • S-char
                  • Isuffix-option
                  • Genassoc
                  • Fundef-option
                  • Fsuffix-option
                  • Fconst
                  • Eprefix-option
                  • Dec-expo-option
                  • Cprefix
                  • C-char
                  • Type-spec-option
                  • Sign-option
                  • Q-char
                  • Iconst-option
                  • H-char
                  • Asm-output
                  • Asm-input
                  • Const-option
                  • Usuffix
                  • Univ-char-name
                  • Transunit
                  • Hprefix
                  • Enumer
                  • Designor
                  • Attrib-name
                  • Sign
                  • Asm-qual
                  • Typequal/attribspec
                  • Dec-expo-prefix
                  • Bin-expo-prefix
                  • Stringlit
                  • Cconst
                  • Expr/tyname
                  • Decl/stmt
                  • Declor/absdeclor
                  • Asm-clobber
                  • Typequal/attribspec-list
                  • Decl-spec-list
                  • Stringlit-list
                  • Spec/qual-list
                  • Inc/dec-op-list
                  • Desiniter-list
                  • S-char-list
                  • Param-declon-list
                  • Decl-list
                  • C-char-list
                  • Block-item-list
                  • Typequal/attribspec-list-list
                  • Structdeclor-list
                  • Structdecl-list
                  • Q-char-list
                  • Initdeclor-list
                  • H-char-list
                  • Genassoc-list
                  • Filepath-transunit-map
                  • Extdecl-list
                  • Enumer-list
                  • Attrib-spec-list
                  • Type-spec-list
                  • Ident-list
                  • Expr-list
                  • Asm-qual-list
                  • Asm-output-list
                  • Asm-input-list
                  • Asm-clobber-list
                  • Stor-spec-list
                  • Ident-set
                  • Ident-option-set
                  • Eprefix-option-list
                  • Designor-list
                  • Attrib-list
                • Abstract-syntax-irrelevants
                • Abstraction-mapping
              • Implementation-environments
              • Standard
              • Gcc-builtins
              • Purity
            • Atc
            • Language
            • Transformation-tools
            • Representation
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • 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
    • Extdecl

    Extdecl-fix

    Fixing function for extdecl structures.

    Signature
    (extdecl-fix x) → new-x
    Arguments
    x — Guard (extdeclp x).
    Returns
    new-x — Type (extdeclp new-x).

    Definitions and Theorems

    Function: extdecl-fix$inline

    (defun extdecl-fix$inline (x)
     (declare (xargs :guard (extdeclp x)))
     (let ((__function__ 'extdecl-fix))
      (declare (ignorable __function__))
      (mbe
          :logic
          (case (extdecl-kind x)
            (:fundef (b* ((unwrap (fundef-fix (std::da-nth 0 (cdr x)))))
                       (cons :fundef (list unwrap))))
            (:decl (b* ((unwrap (decl-fix (std::da-nth 0 (cdr x)))))
                     (cons :decl (list unwrap))))
            (:empty (cons :empty (list)))
            (:asm (b* ((unwrap (asm-stmt-fix (std::da-nth 0 (cdr x)))))
                    (cons :asm (list unwrap)))))
          :exec x)))

    Theorem: extdeclp-of-extdecl-fix

    (defthm extdeclp-of-extdecl-fix
      (b* ((new-x (extdecl-fix$inline x)))
        (extdeclp new-x))
      :rule-classes :rewrite)

    Theorem: extdecl-fix-when-extdeclp

    (defthm extdecl-fix-when-extdeclp
      (implies (extdeclp x)
               (equal (extdecl-fix x) x)))

    Function: extdecl-equiv$inline

    (defun extdecl-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (extdeclp acl2::x)
                                  (extdeclp acl2::y))))
      (equal (extdecl-fix acl2::x)
             (extdecl-fix acl2::y)))

    Theorem: extdecl-equiv-is-an-equivalence

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

    Theorem: extdecl-equiv-implies-equal-extdecl-fix-1

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

    Theorem: extdecl-fix-under-extdecl-equiv

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

    Theorem: equal-of-extdecl-fix-1-forward-to-extdecl-equiv

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

    Theorem: equal-of-extdecl-fix-2-forward-to-extdecl-equiv

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

    Theorem: extdecl-equiv-of-extdecl-fix-1-forward

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

    Theorem: extdecl-equiv-of-extdecl-fix-2-forward

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

    Theorem: extdecl-kind$inline-of-extdecl-fix-x

    (defthm extdecl-kind$inline-of-extdecl-fix-x
      (equal (extdecl-kind$inline (extdecl-fix x))
             (extdecl-kind$inline x)))

    Theorem: extdecl-kind$inline-extdecl-equiv-congruence-on-x

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

    Theorem: consp-of-extdecl-fix

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