• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • 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
              • Comp-dbp
              • Comp-db-fix
                • Comp-db-equiv
              • Json-to-comp-db-try-parse-equal-arg
              • Defpreprocess-map-fn
              • String-escape-for-shell
              • Comp-db-arg-list
              • 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
        • 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
        • 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
    • Comp-db

    Comp-db-fix

    (comp-db-fix x) is an ACL2::fty alist fixing function that follows the fix-keys strategy.

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

    Note that in the execution this is just an inline identity function.

    Definitions and Theorems

    Function: comp-db-fix$inline

    (defun comp-db-fix$inline (x)
      (declare (xargs :guard (comp-dbp x)))
      (mbe :logic
           (if (atom x)
               nil
             (if (consp (car x))
                 (cons (cons (str-fix (caar x))
                             (comp-db-entry-fix (cdar x)))
                       (comp-db-fix (cdr x)))
               (comp-db-fix (cdr x))))
           :exec x))

    Theorem: comp-dbp-of-comp-db-fix

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

    Theorem: comp-db-fix-when-comp-dbp

    (defthm comp-db-fix-when-comp-dbp
      (implies (comp-dbp x)
               (equal (comp-db-fix x) x)))

    Function: comp-db-equiv$inline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: cons-of-str-fix-k-under-comp-db-equiv

    (defthm cons-of-str-fix-k-under-comp-db-equiv
      (comp-db-equiv (cons (cons (str-fix acl2::k) acl2::v)
                           acl2::x)
                     (cons (cons acl2::k acl2::v) acl2::x)))

    Theorem: cons-streqv-congruence-on-k-under-comp-db-equiv

    (defthm cons-streqv-congruence-on-k-under-comp-db-equiv
      (implies (acl2::streqv acl2::k k-equiv)
               (comp-db-equiv (cons (cons acl2::k acl2::v) acl2::x)
                              (cons (cons k-equiv acl2::v) acl2::x)))
      :rule-classes :congruence)

    Theorem: cons-of-comp-db-entry-fix-v-under-comp-db-equiv

    (defthm cons-of-comp-db-entry-fix-v-under-comp-db-equiv
      (comp-db-equiv (cons (cons acl2::k (comp-db-entry-fix acl2::v))
                           acl2::x)
                     (cons (cons acl2::k acl2::v) acl2::x)))

    Theorem: cons-comp-db-entry-equiv-congruence-on-v-under-comp-db-equiv

    (defthm cons-comp-db-entry-equiv-congruence-on-v-under-comp-db-equiv
      (implies (comp-db-entry-equiv acl2::v v-equiv)
               (comp-db-equiv (cons (cons acl2::k acl2::v) acl2::x)
                              (cons (cons acl2::k v-equiv) acl2::x)))
      :rule-classes :congruence)

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

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

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

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

    Theorem: comp-db-fix-of-acons

    (defthm comp-db-fix-of-acons
      (equal (comp-db-fix (cons (cons acl2::a acl2::b) x))
             (cons (cons (str-fix acl2::a)
                         (comp-db-entry-fix acl2::b))
                   (comp-db-fix x))))

    Theorem: comp-db-fix-of-append

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

    Theorem: consp-car-of-comp-db-fix

    (defthm consp-car-of-comp-db-fix
      (equal (consp (car (comp-db-fix x)))
             (consp (comp-db-fix x))))