• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
            • Abstract-syntax
              • 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
              • Absdeclor
              • Strunispec
              • Stor-spec
              • Keyword-uscores
              • Align-spec
              • Label
              • Expr-option
              • Spec/qual
              • Lsuffix
              • Hex-frac-const
              • Desiniter
              • Tyname
              • Iconst
              • Dirabsdeclor-option
              • Dec-frac-const
              • Dec-core-fconst
              • Extdecl
              • 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
              • Hex-quad
              • Eprefix
                • Eprefix-case
                • Eprefix-fix
                  • Eprefix-equiv
                  • Eprefixp
                  • Eprefix-upcase-u
                  • Eprefix-upcase-l
                  • Eprefix-locase-u8
                  • Eprefix-locase-u
                  • Eprefix-kind
                • Const-expr
                • Block-item
                • 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
                • Iconst-option
                • 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
                • Initdeclor-list
                • Genassoc-list
                • Filepath-transunit-map
                • Extdecl-list
                • Expr-list
                • Enumer-list
                • Attrib-spec-list
                • Type-spec-list
                • Ident-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
              • Parser
              • Validator
              • Printer
              • Formalized-subset
              • Mapping-to-language-definition
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • 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
    • Eprefix

    Eprefix-fix

    Fixing function for eprefix structures.

    Signature
    (eprefix-fix x) → new-x
    Arguments
    x — Guard (eprefixp x).
    Returns
    new-x — Type (eprefixp new-x).

    Definitions and Theorems

    Function: eprefix-fix$inline

    (defun eprefix-fix$inline (x)
      (declare (xargs :guard (eprefixp x)))
      (let ((__function__ 'eprefix-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (eprefix-kind x)
               (:locase-u8 (cons :locase-u8 (list)))
               (:locase-u (cons :locase-u (list)))
               (:upcase-u (cons :upcase-u (list)))
               (:upcase-l (cons :upcase-l (list))))
             :exec x)))

    Theorem: eprefixp-of-eprefix-fix

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

    Theorem: eprefix-fix-when-eprefixp

    (defthm eprefix-fix-when-eprefixp
      (implies (eprefixp x)
               (equal (eprefix-fix x) x)))

    Function: eprefix-equiv$inline

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

    Theorem: eprefix-equiv-is-an-equivalence

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

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

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

    Theorem: eprefix-fix-under-eprefix-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-eprefix-fix

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