• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
          • Vl-load-merge-descriptions
          • Vl-find-basename/extension
          • Vl-load-file
          • Vl-loadresult
          • Scope-of-defines
          • Vl-find-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-read-file
          • Vl-includeskips-report-gather
          • Vl-load-main
          • Extended-characters
            • Vl-location
              • Vl-location-p
              • Vl-string-between-locs
              • Vl-location-between-p
              • Vl-string-findloc
              • Vl-linecol
              • Vl-location-string
              • Vl-location-fix
              • Vl-location->line
              • Vl-location->filename
              • Vl-location->col
              • Vl-locationlist
                • Vl-locationlist-fix
                  • Vl-locationlist-equiv
                  • Vl-locationlist-p
                • *vl-fakeloc*
              • Vl-echar-p
              • Vl-echarlist->chars
              • Vl-echarlist-from-chars
              • Vl-echarlist-from-str
              • Vl-echarlist-unsigned-value
              • Vl-change-echarlist-locations
              • Vl-echar-digit-value
              • Vl-echarlist->string
            • Vl-load
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-preprocess-debug
            • Vl-write-preprocessor-debug-file
            • Vl-read-file-report-gather
            • Vl-load-descriptions
            • Vl-load-files
            • Translate-off
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-locationlist

    Vl-locationlist-fix

    (vl-locationlist-fix x) is a usual fty list fixing function.

    Signature
    (vl-locationlist-fix x) → fty::newx
    Arguments
    x — Guard (vl-locationlist-p x).
    Returns
    fty::newx — Type (vl-locationlist-p fty::newx).

    In the logic, we apply vl-location-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: vl-locationlist-fix$inline

    (defun vl-locationlist-fix$inline (x)
      (declare (xargs :guard (vl-locationlist-p x)))
      (let ((__function__ 'vl-locationlist-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 x
               (cons (vl-location-fix (car x))
                     (vl-locationlist-fix (cdr x))))
             :exec x)))

    Theorem: vl-locationlist-p-of-vl-locationlist-fix

    (defthm vl-locationlist-p-of-vl-locationlist-fix
      (b* ((fty::newx (vl-locationlist-fix$inline x)))
        (vl-locationlist-p fty::newx))
      :rule-classes :rewrite)

    Theorem: vl-locationlist-fix-when-vl-locationlist-p

    (defthm vl-locationlist-fix-when-vl-locationlist-p
      (implies (vl-locationlist-p x)
               (equal (vl-locationlist-fix x) x)))

    Function: vl-locationlist-equiv$inline

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

    Theorem: vl-locationlist-equiv-is-an-equivalence

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

    Theorem: vl-locationlist-equiv-implies-equal-vl-locationlist-fix-1

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

    Theorem: vl-locationlist-fix-under-vl-locationlist-equiv

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

    Theorem: equal-of-vl-locationlist-fix-1-forward-to-vl-locationlist-equiv

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

    Theorem: equal-of-vl-locationlist-fix-2-forward-to-vl-locationlist-equiv

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

    Theorem: vl-locationlist-equiv-of-vl-locationlist-fix-1-forward

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

    Theorem: vl-locationlist-equiv-of-vl-locationlist-fix-2-forward

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

    Theorem: car-of-vl-locationlist-fix-x-under-vl-location-equiv

    (defthm car-of-vl-locationlist-fix-x-under-vl-location-equiv
      (vl-location-equiv (car (vl-locationlist-fix acl2::x))
                         (car acl2::x)))

    Theorem: car-vl-locationlist-equiv-congruence-on-x-under-vl-location-equiv

    (defthm
      car-vl-locationlist-equiv-congruence-on-x-under-vl-location-equiv
      (implies (vl-locationlist-equiv acl2::x x-equiv)
               (vl-location-equiv (car acl2::x)
                                  (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-vl-locationlist-fix-x-under-vl-locationlist-equiv

    (defthm cdr-of-vl-locationlist-fix-x-under-vl-locationlist-equiv
      (vl-locationlist-equiv (cdr (vl-locationlist-fix acl2::x))
                             (cdr acl2::x)))

    Theorem: cdr-vl-locationlist-equiv-congruence-on-x-under-vl-locationlist-equiv

    (defthm
     cdr-vl-locationlist-equiv-congruence-on-x-under-vl-locationlist-equiv
     (implies (vl-locationlist-equiv acl2::x x-equiv)
              (vl-locationlist-equiv (cdr acl2::x)
                                     (cdr x-equiv)))
     :rule-classes :congruence)

    Theorem: cons-of-vl-location-fix-x-under-vl-locationlist-equiv

    (defthm cons-of-vl-location-fix-x-under-vl-locationlist-equiv
      (vl-locationlist-equiv (cons (vl-location-fix acl2::x) acl2::y)
                             (cons acl2::x acl2::y)))

    Theorem: cons-vl-location-equiv-congruence-on-x-under-vl-locationlist-equiv

    (defthm
     cons-vl-location-equiv-congruence-on-x-under-vl-locationlist-equiv
     (implies (vl-location-equiv acl2::x x-equiv)
              (vl-locationlist-equiv (cons acl2::x acl2::y)
                                     (cons x-equiv acl2::y)))
     :rule-classes :congruence)

    Theorem: cons-of-vl-locationlist-fix-y-under-vl-locationlist-equiv

    (defthm cons-of-vl-locationlist-fix-y-under-vl-locationlist-equiv
     (vl-locationlist-equiv (cons acl2::x (vl-locationlist-fix acl2::y))
                            (cons acl2::x acl2::y)))

    Theorem: cons-vl-locationlist-equiv-congruence-on-y-under-vl-locationlist-equiv

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

    Theorem: consp-of-vl-locationlist-fix

    (defthm consp-of-vl-locationlist-fix
      (equal (consp (vl-locationlist-fix acl2::x))
             (consp acl2::x)))

    Theorem: vl-locationlist-fix-of-cons

    (defthm vl-locationlist-fix-of-cons
      (equal (vl-locationlist-fix (cons a x))
             (cons (vl-location-fix a)
                   (vl-locationlist-fix x))))

    Theorem: len-of-vl-locationlist-fix

    (defthm len-of-vl-locationlist-fix
      (equal (len (vl-locationlist-fix acl2::x))
             (len acl2::x)))

    Theorem: vl-locationlist-fix-of-append

    (defthm vl-locationlist-fix-of-append
      (equal (vl-locationlist-fix (append std::a std::b))
             (append (vl-locationlist-fix std::a)
                     (vl-locationlist-fix std::b))))

    Theorem: vl-locationlist-fix-of-repeat

    (defthm vl-locationlist-fix-of-repeat
      (equal (vl-locationlist-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (vl-location-fix acl2::x))))

    Theorem: nth-of-vl-locationlist-fix

    (defthm nth-of-vl-locationlist-fix
      (equal (nth acl2::n (vl-locationlist-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (vl-location-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: vl-locationlist-equiv-implies-vl-locationlist-equiv-append-1

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

    Theorem: vl-locationlist-equiv-implies-vl-locationlist-equiv-append-2

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

    Theorem: vl-locationlist-equiv-implies-vl-locationlist-equiv-nthcdr-2

    (defthm vl-locationlist-equiv-implies-vl-locationlist-equiv-nthcdr-2
      (implies (vl-locationlist-equiv acl2::l l-equiv)
               (vl-locationlist-equiv (nthcdr acl2::n acl2::l)
                                      (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-locationlist-equiv-implies-vl-locationlist-equiv-take-2

    (defthm vl-locationlist-equiv-implies-vl-locationlist-equiv-take-2
      (implies (vl-locationlist-equiv acl2::l l-equiv)
               (vl-locationlist-equiv (take acl2::n acl2::l)
                                      (take acl2::n l-equiv)))
      :rule-classes (:congruence))