• 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
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
              • Comp-db-entry
              • Comp-db-arg
              • Json-to-comp-db-entry
              • Json-to-comp-db-entry-list
              • To-preprocess-db
              • To-preprocess-map
              • Comp-db-arguments-absolute-dirs
              • Comp-db-keep-only-preprocessor-args
              • Json-to-comp-db
              • Json-to-comp-db-arguments
              • Comp-db-relativize-keys
              • Json-to-comp-db-get-exec-and-arguments
              • Preprocess-map-from-comp-file
              • Json-to-comp-db-exec-and-arguments
              • Relativize-path
              • Comp-db-arguments-keep-only-preprocessor-args
              • Comp-db-arguments-escape-for-shell
              • Parse-comp-db
              • Json-to-comp-db-get-directory
              • Json-to-comp-db-get-output
              • Json-to-comp-db-get-file
              • Comp-db-drop-shared
              • Comp-db-drop-non-c
              • Comp-db-arg-list-to-string-list
              • Comp-db-absolute-dirs
              • Comp-db-escape-for-shell
              • Json-to-comp-db-try-parse-short-option
              • Preprocess-db-to-map
              • Comp-db-arg-to-string
              • Comp-db
              • Json-to-comp-db-try-parse-equal-arg
              • Defpreprocess-map-fn
              • String-escape-for-shell
              • Comp-db-arg-list
                • Comp-db-arg-list-fix
                  • Comp-db-arg-list-equiv
                  • Comp-db-arg-listp
                • Irr-comp-db-arg
                • Show-warnings
                • *cc-options-space-sep*
                • *cc-options-equal-sep*
                • *cc-options-dir*
              • Printer
              • Output-files
              • Abstract-syntax-operations
              • Implementation-environments
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • Gcc-builtins
              • Preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Comp-db-arg-list

    Comp-db-arg-list-fix

    (comp-db-arg-list-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (comp-db-arg-list-fix x) → fty::newx
    Arguments
    x — Guard (comp-db-arg-listp x).
    Returns
    fty::newx — Type (comp-db-arg-listp fty::newx).

    In the logic, we apply comp-db-arg-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: comp-db-arg-list-fix$inline

    (defun comp-db-arg-list-fix$inline (x)
      (declare (xargs :guard (comp-db-arg-listp x)))
      (mbe :logic
           (if (atom x)
               nil
             (cons (comp-db-arg-fix (car x))
                   (comp-db-arg-list-fix (cdr x))))
           :exec x))

    Theorem: comp-db-arg-listp-of-comp-db-arg-list-fix

    (defthm comp-db-arg-listp-of-comp-db-arg-list-fix
      (b* ((fty::newx (comp-db-arg-list-fix$inline x)))
        (comp-db-arg-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: comp-db-arg-list-fix-when-comp-db-arg-listp

    (defthm comp-db-arg-list-fix-when-comp-db-arg-listp
      (implies (comp-db-arg-listp x)
               (equal (comp-db-arg-list-fix x) x)))

    Function: comp-db-arg-list-equiv$inline

    (defun comp-db-arg-list-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (comp-db-arg-listp acl2::x)
                                  (comp-db-arg-listp acl2::y))))
      (equal (comp-db-arg-list-fix acl2::x)
             (comp-db-arg-list-fix acl2::y)))

    Theorem: comp-db-arg-list-equiv-is-an-equivalence

    (defthm comp-db-arg-list-equiv-is-an-equivalence
      (and (booleanp (comp-db-arg-list-equiv x y))
           (comp-db-arg-list-equiv x x)
           (implies (comp-db-arg-list-equiv x y)
                    (comp-db-arg-list-equiv y x))
           (implies (and (comp-db-arg-list-equiv x y)
                         (comp-db-arg-list-equiv y z))
                    (comp-db-arg-list-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: comp-db-arg-list-equiv-implies-equal-comp-db-arg-list-fix-1

    (defthm comp-db-arg-list-equiv-implies-equal-comp-db-arg-list-fix-1
      (implies (comp-db-arg-list-equiv acl2::x x-equiv)
               (equal (comp-db-arg-list-fix acl2::x)
                      (comp-db-arg-list-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: comp-db-arg-list-fix-under-comp-db-arg-list-equiv

    (defthm comp-db-arg-list-fix-under-comp-db-arg-list-equiv
      (comp-db-arg-list-equiv (comp-db-arg-list-fix acl2::x)
                              acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-comp-db-arg-list-fix-1-forward-to-comp-db-arg-list-equiv

    (defthm
      equal-of-comp-db-arg-list-fix-1-forward-to-comp-db-arg-list-equiv
      (implies (equal (comp-db-arg-list-fix acl2::x)
                      acl2::y)
               (comp-db-arg-list-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-comp-db-arg-list-fix-2-forward-to-comp-db-arg-list-equiv

    (defthm
      equal-of-comp-db-arg-list-fix-2-forward-to-comp-db-arg-list-equiv
      (implies (equal acl2::x (comp-db-arg-list-fix acl2::y))
               (comp-db-arg-list-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: comp-db-arg-list-equiv-of-comp-db-arg-list-fix-1-forward

    (defthm comp-db-arg-list-equiv-of-comp-db-arg-list-fix-1-forward
      (implies (comp-db-arg-list-equiv (comp-db-arg-list-fix acl2::x)
                                       acl2::y)
               (comp-db-arg-list-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: comp-db-arg-list-equiv-of-comp-db-arg-list-fix-2-forward

    (defthm comp-db-arg-list-equiv-of-comp-db-arg-list-fix-2-forward
     (implies
         (comp-db-arg-list-equiv acl2::x (comp-db-arg-list-fix acl2::y))
         (comp-db-arg-list-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: car-of-comp-db-arg-list-fix-x-under-comp-db-arg-equiv

    (defthm car-of-comp-db-arg-list-fix-x-under-comp-db-arg-equiv
      (comp-db-arg-equiv (car (comp-db-arg-list-fix acl2::x))
                         (car acl2::x)))

    Theorem: car-comp-db-arg-list-equiv-congruence-on-x-under-comp-db-arg-equiv

    (defthm
     car-comp-db-arg-list-equiv-congruence-on-x-under-comp-db-arg-equiv
     (implies (comp-db-arg-list-equiv acl2::x x-equiv)
              (comp-db-arg-equiv (car acl2::x)
                                 (car x-equiv)))
     :rule-classes :congruence)

    Theorem: cdr-of-comp-db-arg-list-fix-x-under-comp-db-arg-list-equiv

    (defthm cdr-of-comp-db-arg-list-fix-x-under-comp-db-arg-list-equiv
      (comp-db-arg-list-equiv (cdr (comp-db-arg-list-fix acl2::x))
                              (cdr acl2::x)))

    Theorem: cdr-comp-db-arg-list-equiv-congruence-on-x-under-comp-db-arg-list-equiv

    (defthm
     cdr-comp-db-arg-list-equiv-congruence-on-x-under-comp-db-arg-list-equiv
     (implies (comp-db-arg-list-equiv acl2::x x-equiv)
              (comp-db-arg-list-equiv (cdr acl2::x)
                                      (cdr x-equiv)))
     :rule-classes :congruence)

    Theorem: cons-of-comp-db-arg-fix-x-under-comp-db-arg-list-equiv

    (defthm cons-of-comp-db-arg-fix-x-under-comp-db-arg-list-equiv
      (comp-db-arg-list-equiv (cons (comp-db-arg-fix acl2::x) acl2::y)
                              (cons acl2::x acl2::y)))

    Theorem: cons-comp-db-arg-equiv-congruence-on-x-under-comp-db-arg-list-equiv

    (defthm
     cons-comp-db-arg-equiv-congruence-on-x-under-comp-db-arg-list-equiv
     (implies (comp-db-arg-equiv acl2::x x-equiv)
              (comp-db-arg-list-equiv (cons acl2::x acl2::y)
                                      (cons x-equiv acl2::y)))
     :rule-classes :congruence)

    Theorem: cons-of-comp-db-arg-list-fix-y-under-comp-db-arg-list-equiv

    (defthm cons-of-comp-db-arg-list-fix-y-under-comp-db-arg-list-equiv
      (comp-db-arg-list-equiv
           (cons acl2::x (comp-db-arg-list-fix acl2::y))
           (cons acl2::x acl2::y)))

    Theorem: cons-comp-db-arg-list-equiv-congruence-on-y-under-comp-db-arg-list-equiv

    (defthm
     cons-comp-db-arg-list-equiv-congruence-on-y-under-comp-db-arg-list-equiv
     (implies (comp-db-arg-list-equiv acl2::y y-equiv)
              (comp-db-arg-list-equiv (cons acl2::x acl2::y)
                                      (cons acl2::x y-equiv)))
     :rule-classes :congruence)

    Theorem: consp-of-comp-db-arg-list-fix

    (defthm consp-of-comp-db-arg-list-fix
      (equal (consp (comp-db-arg-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: comp-db-arg-list-fix-under-iff

    (defthm comp-db-arg-list-fix-under-iff
      (iff (comp-db-arg-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: comp-db-arg-list-fix-of-cons

    (defthm comp-db-arg-list-fix-of-cons
      (equal (comp-db-arg-list-fix (cons a x))
             (cons (comp-db-arg-fix a)
                   (comp-db-arg-list-fix x))))

    Theorem: len-of-comp-db-arg-list-fix

    (defthm len-of-comp-db-arg-list-fix
      (equal (len (comp-db-arg-list-fix acl2::x))
             (len acl2::x)))

    Theorem: comp-db-arg-list-fix-of-append

    (defthm comp-db-arg-list-fix-of-append
      (equal (comp-db-arg-list-fix (append std::a std::b))
             (append (comp-db-arg-list-fix std::a)
                     (comp-db-arg-list-fix std::b))))

    Theorem: comp-db-arg-list-fix-of-repeat

    (defthm comp-db-arg-list-fix-of-repeat
      (equal (comp-db-arg-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (comp-db-arg-fix acl2::x))))

    Theorem: list-equiv-refines-comp-db-arg-list-equiv

    (defthm list-equiv-refines-comp-db-arg-list-equiv
      (implies (list-equiv acl2::x acl2::y)
               (comp-db-arg-list-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-comp-db-arg-list-fix

    (defthm nth-of-comp-db-arg-list-fix
      (equal (nth acl2::n (comp-db-arg-list-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (comp-db-arg-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-append-1

    (defthm
         comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-append-1
      (implies (comp-db-arg-list-equiv acl2::x fty::x-equiv)
               (comp-db-arg-list-equiv (append acl2::x acl2::y)
                                       (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-append-2

    (defthm
         comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-append-2
      (implies (comp-db-arg-list-equiv acl2::y fty::y-equiv)
               (comp-db-arg-list-equiv (append acl2::x acl2::y)
                                       (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-nthcdr-2

    (defthm
         comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-nthcdr-2
      (implies (comp-db-arg-list-equiv acl2::l l-equiv)
               (comp-db-arg-list-equiv (nthcdr acl2::n acl2::l)
                                       (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-take-2

    (defthm comp-db-arg-list-equiv-implies-comp-db-arg-list-equiv-take-2
      (implies (comp-db-arg-list-equiv acl2::l l-equiv)
               (comp-db-arg-list-equiv (take acl2::n acl2::l)
                                       (take acl2::n l-equiv)))
      :rule-classes (:congruence))