• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
          • Vl-load-merge-descriptions
          • Scope-of-defines
          • Vl-load-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-loadresult
          • Vl-read-file
          • Vl-find-basename/extension
          • Vl-find-file
          • Vl-read-files
          • Extended-characters
            • Vl-echar-p
            • Vl-location
              • Vl-location-p
              • Vl-location-fix
                • Vl-string-between-locs
                • Vl-location-between-p
                • Vl-string-findloc
                • Vl-location-equiv
                • Make-vl-location
                • Vl-location-string
                • Vl-location->filename
                • Vl-location->line
                • Change-vl-location
                • Vl-location->col
                • *vl-fakeloc*
              • 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-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-location

    Vl-location-fix

    Fixing function for vl-location structures.

    Signature
    (vl-location-fix x) → new-x
    Arguments
    x — Guard (vl-location-p x).
    Returns
    new-x — Type (vl-location-p new-x).

    Definitions and Theorems

    Function: vl-location-fix$inline

    (defun vl-location-fix$inline (x)
     (declare (xargs :guard (vl-location-p x)))
     (let ((__function__ 'vl-location-fix))
      (declare (ignorable __function__))
      (mbe :logic
           (b* ((filename (str-fix (std::prod-car (cdr x))))
                (line (pos-fix (std::prod-car (std::prod-cdr (cdr x)))))
                (col (nfix (std::prod-cdr (std::prod-cdr (cdr x))))))
             (cons :vl-location
                   (std::prod-cons filename (std::prod-cons line col))))
           :exec x)))

    Theorem: vl-location-p-of-vl-location-fix

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

    Theorem: vl-location-fix-when-vl-location-p

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

    Function: vl-location-equiv$inline

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

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

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

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

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

    Theorem: vl-location-fix-under-vl-location-equiv

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

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

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

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

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

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

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

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

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