• 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-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
    • Loader

    Vl-load-description

    Try to load a description from the search path.

    Signature
    (vl-load-description name st state) → (mv st state)
    Arguments
    name — The name of the description we want to load.
        Guard (stringp name).
    st — Guard (vl-loadstate-p st).
    Returns
    st — Type (vl-loadstate-p st).
    state — Type (state-p1 state), given (force (state-p1 state)).

    Definitions and Theorems

    Function: vl-load-description

    (defun vl-load-description (name st state)
     (declare (xargs :stobjs (state)))
     (declare (xargs :guard (and (stringp name)
                                 (vl-loadstate-p st))))
     (let ((__function__ 'vl-load-description))
      (declare (ignorable __function__))
      (b*
       (((vl-loadstate st) st)
        ((vl-loadconfig config) st.config)
        (warnings (vl-parsestate->warnings st.pstate))
        ((mv filename warnings state)
         (vl-find-basename/extension name config.search-exts
                                     config.search-path warnings state))
        ((unless filename)
         (b* ((warnings (warn :type :vl-warn-find-failed
                              :msg "Unable to find a file for ~s0."
                              :args (list name))))
           (mv (vl-loadstate-set-warnings warnings)
               state)))
        (st (vl-loadstate-set-warnings warnings)))
       (vl-load-file filename st state))))

    Theorem: vl-loadstate-p-of-vl-load-description.st

    (defthm vl-loadstate-p-of-vl-load-description.st
      (b* (((mv ?st acl2::?state)
            (vl-load-description name st state)))
        (vl-loadstate-p st))
      :rule-classes :rewrite)

    Theorem: state-p1-of-vl-load-description.state

    (defthm state-p1-of-vl-load-description.state
      (implies (force (state-p1 state))
               (b* (((mv ?st acl2::?state)
                     (vl-load-description name st state)))
                 (state-p1 state)))
      :rule-classes :rewrite)

    Theorem: unique-names-after-vl-load-description

    (defthm unique-names-after-vl-load-description
     (b* (((mv new-st &)
           (vl-load-description name st state)))
      (implies
       (uniquep (vl-descriptionlist->names (vl-loadstate->descs st)))
       (no-duplicatesp
            (vl-descriptionlist->names (vl-loadstate->descs new-st))))))