• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
          • Vl-lint
            • Vl-lintconfig-p
            • Condcheck
            • Lint-warning-suppression
            • Lucid
            • Lvaluecheck
            • Vl-interfacelist-alwaysstyle
            • Truncation-warnings
            • Vl-modulelist-alwaysstyle
            • Skip-detection
              • Vl-ctxexprlist->exprs
              • Sd-keylist->indicies
              • Sd-keylist-find-skipped
              • Sd-problem
              • Sd-key
                • Sd-key-fix
                  • Sd-key-equiv
                  • Make-sd-key
                  • Sd-key->index
                  • Change-sd-key
                  • Sd-key->pat
                  • Sd-key->orig
                  • Sd-key-p
                • Sd-patalist-compare
                • Sd-analyze-ctxexprs
                • Sd-keygen
                • Make-sd-patalist
                • Sd-analyze-modulelist
                • Sd-analyze-module-aux
                • Sd-analyze-module
                • Sd-pp-problem-long
                • Sd-problem-score
                • Sd-pp-problem-header
                • Sd-analyze-modulelist-aux
                • Sd-analyze-design
                • Sd-problem->
                • Sd-patalist
                • Sd-problemlist
                • Sd-pp-problem-brief
                • Sd-keylist
                • Sd-pp-problemlist-long
                • Sd-pp-problemlist-brief
                • Sd-natlist-linear-increments-p
                • Sd-keylist-linear-increments-p
              • Vl-lint-report
              • Vl-lintresult
              • Vl::vl-design-sv-use-set
              • Oddexpr-check
              • Leftright-check
              • Duplicate-detect
              • Selfassigns
              • *vl-lint-help*
              • Arith-compare-check
              • Dupeinst-check
              • Qmarksize-check
              • Lint-whole-file-suppression
              • Run-vl-lint-main
              • Logicassign
              • Run-vl-lint
              • Vl-print-certain-warnings
              • Duperhs-check
              • Vl-lint-top
              • Sd-filter-problems
              • Vl-modulelist-add-svbad-warnings
              • Vl-module-add-svbad-warnings
              • Check-case
              • Vl-lint-extra-actions
              • Drop-lint-stubs
              • Vl-lint-print-warnings
              • Drop-user-submodules
              • Check-namespace
              • Vl-lintconfig-loadconfig
              • Vl-lint-design->svex-modalist-wrapper
              • Vl-delete-sd-problems-for-modnames-aux
              • Vl-collect-new-names-from-orignames
              • Vl-lint-print-all-warnings
              • Vl-design-remove-unnecessary-modules
              • Vl-delete-sd-problems-for-modnames
              • Vl-always-check-style
              • Vl-vardecllist-svbad-warnings
              • Vl-vardecl-svbad-warnings
              • Vl-reportcard-remove-suppressed
              • Vl-reportcard-keep-suppressed
              • Vl-alwayslist-check-style
              • Vl-remove-nameless-descriptions
              • Vl-lint-apply-quiet
              • Vl-warninglist-remove-suppressed
              • Vl-warninglist-keep-suppressed
              • Vl-print-eliminated-descs
              • Vl-module-alwaysstyle
              • Vl-jp-reportcard-aux
              • Vl-interface-alwaysstyle
              • Vl-design-alwaysstyle
              • Vl-jp-description-locations
              • Vl-jp-reportcard
              • Vl-pp-stringlist-lines
              • Vl-jp-design-locations
              • Vl-datatype-svbad-p
              • Unpacked-range-check
              • Sd-problem-major-p
              • Vl-alwaysstyle
            • Vl-server
            • Vl-gather
            • Vl-zip
            • Vl-main
            • Split-plusargs
            • Vl-shell
            • Vl-json
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Sd-key

    Sd-key-fix

    Fixing function for sd-key structures.

    Signature
    (sd-key-fix x) → new-x
    Arguments
    x — Guard (sd-key-p x).
    Returns
    new-x — Type (sd-key-p new-x).

    Definitions and Theorems

    Function: sd-key-fix$inline

    (defun sd-key-fix$inline (x)
      (declare (xargs :guard (sd-key-p x)))
      (let ((__function__ 'sd-key-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((pat (str-fix (car (cdr x))))
                  (index (maybe-natp-fix (car (cdr (cdr x)))))
                  (orig (str-fix (cdr (cdr (cdr x))))))
               (cons :sd-key (cons pat (cons index orig))))
             :exec x)))

    Theorem: sd-key-p-of-sd-key-fix

    (defthm sd-key-p-of-sd-key-fix
      (b* ((new-x (sd-key-fix$inline x)))
        (sd-key-p new-x))
      :rule-classes :rewrite)

    Theorem: sd-key-fix-when-sd-key-p

    (defthm sd-key-fix-when-sd-key-p
      (implies (sd-key-p x)
               (equal (sd-key-fix x) x)))

    Function: sd-key-equiv$inline

    (defun sd-key-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (sd-key-p acl2::x)
                                  (sd-key-p acl2::y))))
      (equal (sd-key-fix acl2::x)
             (sd-key-fix acl2::y)))

    Theorem: sd-key-equiv-is-an-equivalence

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

    Theorem: sd-key-equiv-implies-equal-sd-key-fix-1

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

    Theorem: sd-key-fix-under-sd-key-equiv

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

    Theorem: equal-of-sd-key-fix-1-forward-to-sd-key-equiv

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

    Theorem: equal-of-sd-key-fix-2-forward-to-sd-key-equiv

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

    Theorem: sd-key-equiv-of-sd-key-fix-1-forward

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

    Theorem: sd-key-equiv-of-sd-key-fix-2-forward

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