• 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
            • Vl-loadstate-fix
              • Vl-loadstate-p
              • Make-vl-loadstate
              • Vl-loadstate-equiv
              • Change-vl-loadstate
              • Vl-loadstate->reportcard
              • Vl-loadstate->descalist
              • Vl-loadstate->pstate
              • Vl-loadstate->filemap
              • Vl-loadstate->descs
              • Vl-loadstate->defines
              • Vl-loadstate->config
            • 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-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-loadstate

    Vl-loadstate-fix

    Fixing function for vl-loadstate structures.

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

    Definitions and Theorems

    Function: vl-loadstate-fix$inline

    (defun vl-loadstate-fix$inline (x)
     (declare (xargs :guard (vl-loadstate-p x)))
     (let ((__function__ 'vl-loadstate-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (b*
        ((config
            (vl-loadconfig-fix (std::prod-car (std::prod-car (cdr x)))))
         (descs
          (vl-descriptionlist-fix
               (std::prod-car (std::prod-cdr (std::prod-car (cdr x))))))
         (descalist
              (std::prod-cdr (std::prod-cdr (std::prod-car (cdr x)))))
         (defines
          (vl-defines-fix
               (std::prod-car (std::prod-car (std::prod-cdr (cdr x)))))
    )
         (reportcard
          (vl-reportcard-fix
               (std::prod-cdr (std::prod-car (std::prod-cdr (cdr x))))))
         (pstate
          (vl-parsestate-fix
               (std::prod-car (std::prod-cdr (std::prod-cdr (cdr x))))))
         (filemap
          (vl-filemap-fix
              (std::prod-cdr (std::prod-cdr (std::prod-cdr (cdr x)))))))
        (let ((descalist (vl-make-descalist descs)))
         (cons
           :vl-loadstate
           (std::prod-cons
                (std::prod-cons config (std::prod-cons descs descalist))
                (std::prod-cons (std::prod-cons defines reportcard)
                                (std::prod-cons pstate filemap))))))
       :exec x)))

    Theorem: vl-loadstate-p-of-vl-loadstate-fix

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

    Theorem: vl-loadstate-fix-when-vl-loadstate-p

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

    Function: vl-loadstate-equiv$inline

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

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

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

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

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

    Theorem: vl-loadstate-fix-under-vl-loadstate-equiv

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

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

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

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

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

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

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

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

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