• 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
              • Dimb-exprs/decls/stmts
              • Dimb-make/adjust-expr-binary
              • Dimb-params-to-names
              • Dimb-transunit
              • Dimb-cast/call-to-call
              • Dimb-dirdeclor
              • Dimb-make/adjust-expr-cast
              • Dimb-fundef
              • Dimb-make/adjust-expr-unary
              • Dimb-expr
              • Dimb-amb-declor/absdeclor
              • Dimb-cast/call-to-cast
              • Dimb-declor
              • Dimb-transunit-ensemble
              • Dimb-cast/addsub-to-cast
              • Dimb-cast/addsub-to-addsub
              • Dimb-add-ident
              • Dimb-kind
              • Dimb-amb-expr/tyname
              • Dimb-cast/mul-to-cast
              • Dimb-cast/and-to-cast
              • Dimb-cast/mul-to-mul
              • Dimb-cast/and-to-and
              • Dimb-kind-option
              • Dimb-extdecl-list
              • Dimb-extdecl
              • Dimb-type-spec
              • Dimb-param-declor
              • Dimb-lookup-ident
              • Dimb-decl-spec
              • Dimb-param-declon
              • Dimb-add-idents-objfun
              • Dimb-amb-decl/stmt
              • Dimb-add-ident-objfun
              • Dimb-table
                • Dimb-tablep
                • Dimb-table-fix
                  • Dimb-table-equiv
                • Dimb-pop-scope
                • Dimb-initdeclor
                • Dimb-push-scope
                • Dimb-declor-option
                • Dimb-enumspec
                • Dimb-decl
                • Dimb-stmt
                • Dimb-structdeclor
                • Dimb-scope
                • Dimb-initdeclor-list
                • Dimb-decl-spec-list
                • Dimb-absdeclor
                • Dimb-dirabsdeclor
                • Dimb-align-spec
                • Dimb-struni-spec
                • Dimb-init-table
                • Dimb-spec/qual-list
                • Dimb-spec/qual
                • Irr-dimb-table
                • Irr-dimb-kind
                • Dimb-param-declon-list
                • Dimb-enumer-list
                • Dimb-enumer
                • Dimb-dirabsdeclor-option
                • Dimb-block-item
                • Dimb-structdeclor-list
                • Dimb-structdecl-list
                • Dimb-statassert
                • Dimb-label
                • Dimb-desiniter-list
                • Dimb-desiniter
                • Dimb-decl-list
                • Dimb-const-expr-option
                • Dimb-absdeclor-option
                • Dimb-structdecl
                • Dimb-member-designor
                • Dimb-initer-option
                • Dimb-genassoc-list
                • Dimb-genassoc
                • Dimb-expr-option
                • Dimb-expr-list
                • Dimb-designor-list
                • Dimb-designor
                • Dimb-const-expr
                • Dimb-block-item-list
                • Dimb-tyname
                • Dimb-initer
              • Abstract-syntax
              • Parser
              • Validator
              • Printer
              • Formalized-subset
              • Mapping-to-language-definition
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Ascii-identifiers
              • Unambiguity
              • Preprocessing
              • Abstraction-mapping
              • Standard
              • 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
    • Dimb-table

    Dimb-table-fix

    (dimb-table-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (dimb-table-fix x) → fty::newx
    Arguments
    x — Guard (dimb-tablep x).
    Returns
    fty::newx — Type (dimb-tablep fty::newx).

    In the logic, we apply dimb-scope-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: dimb-table-fix$inline

    (defun dimb-table-fix$inline (x)
      (declare (xargs :guard (dimb-tablep x)))
      (let ((__function__ 'dimb-table-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (dimb-scope-fix (car x))
                     (dimb-table-fix (cdr x))))
             :exec x)))

    Theorem: dimb-tablep-of-dimb-table-fix

    (defthm dimb-tablep-of-dimb-table-fix
      (b* ((fty::newx (dimb-table-fix$inline x)))
        (dimb-tablep fty::newx))
      :rule-classes :rewrite)

    Theorem: dimb-table-fix-when-dimb-tablep

    (defthm dimb-table-fix-when-dimb-tablep
      (implies (dimb-tablep x)
               (equal (dimb-table-fix x) x)))

    Function: dimb-table-equiv$inline

    (defun dimb-table-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (dimb-tablep acl2::x)
                                  (dimb-tablep acl2::y))))
      (equal (dimb-table-fix acl2::x)
             (dimb-table-fix acl2::y)))

    Theorem: dimb-table-equiv-is-an-equivalence

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

    Theorem: dimb-table-equiv-implies-equal-dimb-table-fix-1

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

    Theorem: dimb-table-fix-under-dimb-table-equiv

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

    Theorem: equal-of-dimb-table-fix-1-forward-to-dimb-table-equiv

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

    Theorem: equal-of-dimb-table-fix-2-forward-to-dimb-table-equiv

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

    Theorem: dimb-table-equiv-of-dimb-table-fix-1-forward

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

    Theorem: dimb-table-equiv-of-dimb-table-fix-2-forward

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

    Theorem: car-of-dimb-table-fix-x-under-dimb-scope-equiv

    (defthm car-of-dimb-table-fix-x-under-dimb-scope-equiv
      (dimb-scope-equiv (car (dimb-table-fix acl2::x))
                        (car acl2::x)))

    Theorem: car-dimb-table-equiv-congruence-on-x-under-dimb-scope-equiv

    (defthm car-dimb-table-equiv-congruence-on-x-under-dimb-scope-equiv
      (implies (dimb-table-equiv acl2::x x-equiv)
               (dimb-scope-equiv (car acl2::x)
                                 (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-dimb-table-fix-x-under-dimb-table-equiv

    (defthm cdr-of-dimb-table-fix-x-under-dimb-table-equiv
      (dimb-table-equiv (cdr (dimb-table-fix acl2::x))
                        (cdr acl2::x)))

    Theorem: cdr-dimb-table-equiv-congruence-on-x-under-dimb-table-equiv

    (defthm cdr-dimb-table-equiv-congruence-on-x-under-dimb-table-equiv
      (implies (dimb-table-equiv acl2::x x-equiv)
               (dimb-table-equiv (cdr acl2::x)
                                 (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-dimb-scope-fix-x-under-dimb-table-equiv

    (defthm cons-of-dimb-scope-fix-x-under-dimb-table-equiv
      (dimb-table-equiv (cons (dimb-scope-fix acl2::x) acl2::y)
                        (cons acl2::x acl2::y)))

    Theorem: cons-dimb-scope-equiv-congruence-on-x-under-dimb-table-equiv

    (defthm cons-dimb-scope-equiv-congruence-on-x-under-dimb-table-equiv
      (implies (dimb-scope-equiv acl2::x x-equiv)
               (dimb-table-equiv (cons acl2::x acl2::y)
                                 (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-dimb-table-fix-y-under-dimb-table-equiv

    (defthm cons-of-dimb-table-fix-y-under-dimb-table-equiv
      (dimb-table-equiv (cons acl2::x (dimb-table-fix acl2::y))
                        (cons acl2::x acl2::y)))

    Theorem: cons-dimb-table-equiv-congruence-on-y-under-dimb-table-equiv

    (defthm cons-dimb-table-equiv-congruence-on-y-under-dimb-table-equiv
      (implies (dimb-table-equiv acl2::y y-equiv)
               (dimb-table-equiv (cons acl2::x acl2::y)
                                 (cons acl2::x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-dimb-table-fix

    (defthm consp-of-dimb-table-fix
      (equal (consp (dimb-table-fix acl2::x))
             (consp acl2::x)))

    Theorem: dimb-table-fix-under-iff

    (defthm dimb-table-fix-under-iff
      (iff (dimb-table-fix acl2::x)
           (consp acl2::x)))

    Theorem: dimb-table-fix-of-cons

    (defthm dimb-table-fix-of-cons
      (equal (dimb-table-fix (cons a x))
             (cons (dimb-scope-fix a)
                   (dimb-table-fix x))))

    Theorem: len-of-dimb-table-fix

    (defthm len-of-dimb-table-fix
      (equal (len (dimb-table-fix acl2::x))
             (len acl2::x)))

    Theorem: dimb-table-fix-of-append

    (defthm dimb-table-fix-of-append
      (equal (dimb-table-fix (append std::a std::b))
             (append (dimb-table-fix std::a)
                     (dimb-table-fix std::b))))

    Theorem: dimb-table-fix-of-repeat

    (defthm dimb-table-fix-of-repeat
      (equal (dimb-table-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (dimb-scope-fix acl2::x))))

    Theorem: list-equiv-refines-dimb-table-equiv

    (defthm list-equiv-refines-dimb-table-equiv
      (implies (list-equiv acl2::x acl2::y)
               (dimb-table-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-dimb-table-fix

    (defthm nth-of-dimb-table-fix
      (equal (nth acl2::n (dimb-table-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (dimb-scope-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: dimb-table-equiv-implies-dimb-table-equiv-append-1

    (defthm dimb-table-equiv-implies-dimb-table-equiv-append-1
      (implies (dimb-table-equiv acl2::x fty::x-equiv)
               (dimb-table-equiv (append acl2::x acl2::y)
                                 (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: dimb-table-equiv-implies-dimb-table-equiv-append-2

    (defthm dimb-table-equiv-implies-dimb-table-equiv-append-2
      (implies (dimb-table-equiv acl2::y fty::y-equiv)
               (dimb-table-equiv (append acl2::x acl2::y)
                                 (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: dimb-table-equiv-implies-dimb-table-equiv-nthcdr-2

    (defthm dimb-table-equiv-implies-dimb-table-equiv-nthcdr-2
      (implies (dimb-table-equiv acl2::l l-equiv)
               (dimb-table-equiv (nthcdr acl2::n acl2::l)
                                 (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: dimb-table-equiv-implies-dimb-table-equiv-take-2

    (defthm dimb-table-equiv-implies-dimb-table-equiv-take-2
      (implies (dimb-table-equiv acl2::l l-equiv)
               (dimb-table-equiv (take acl2::n acl2::l)
                                 (take acl2::n l-equiv)))
      :rule-classes (:congruence))