• 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-find-file-aux
            • Vl-extend-pathname
            • 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-find-file

    Vl-extend-pathname

    (vl-extend-pathname dir filename) concatenates dir and filename, adding a slash to between them only if dir does not end with a slash.

    Definitions and Theorems

    Function: vl-ends-with-directory-separatorp

    (defun vl-ends-with-directory-separatorp (x)
      (declare (xargs :guard (stringp x)))
      (let ((len (length x)))
        (and (/= len 0)
             (eql (char x (- (length x) 1))
                  acl2::*directory-separator*))))

    Function: vl-extend-pathname

    (defun vl-extend-pathname (dir filename)
      (declare (xargs :guard (and (stringp dir) (stringp filename))))
      (cat dir
           (if (vl-ends-with-directory-separatorp dir)
               ""
             (implode (list acl2::*directory-separator*)))
           filename))

    Theorem: stringp-of-vl-extend-pathname

    (defthm stringp-of-vl-extend-pathname
      (stringp (vl-extend-pathname dir filename))
      :rule-classes :type-prescription)