• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
              • Input-files-implementation
                • Input-files-process-inputs
                • Input-files-gen-events
                • Input-files-process-preprocess-args
                • Input-files-process-inputs-and-gen-events
                • Input-files-complete-preprocess-extra-args
                • Input-files-process-ienv
                • Input-files-fn
                • Input-files-read-files
                • Input-files-process-const
                • String-stringlist-map-map-cons-values
                • Input-files-process-path
                  • Input-files-process-files
                  • Input-files-process-process
                  • Input-files-preprocess-arg-std
                  • Input-files-process-preprocess
                  • Input-files-process-keep-going
                  • Input-files-process-inputp
                  • Input-files-preprocess-inputp
                  • *input-files-allowed-options*
                  • Input-files-definition
                • Input-files-prog
              • Compilation-database
              • Printer
              • Output-files
              • Abstract-syntax-operations
              • Implementation-environments
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • Gcc-builtins
              • Preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Input-files-implementation

    Input-files-process-path

    Process the :path input.

    Signature
    (input-files-process-path path) → (mv erp new-path)
    Returns
    new-path — Type (stringp new-path).

    If the string is not / but ends with /, we remove the ending /. This is for uniformity when concatenating this with the files specified in the :files input.

    Definitions and Theorems

    Function: input-files-process-path

    (defun input-files-process-path (path)
     (declare (xargs :guard t))
     (let ((__function__ 'input-files-process-path))
      (declare (ignorable __function__))
      (b*
       (((reterr) "")
        ((unless (stringp path))
         (reterr
          (msg
           "The :PATH input must be a string, ~
                          but it is ~x0 instead."
           path)))
        (path-chars (acl2::explode path))
        ((unless (consp path-chars))
         (reterr
          (msg
           "The :PATH input must be not empty, ~
                          but it is the empty string instead.")))
        (path-chars (if (and (consp (cdr path-chars))
                             (eql (car (last path-chars)) #\/))
                        (butlast path-chars 1)
                      path-chars))
        (path (acl2::implode path-chars)))
       (retok path))))

    Theorem: stringp-of-input-files-process-path.new-path

    (defthm stringp-of-input-files-process-path.new-path
      (b* (((mv acl2::?erp ?new-path)
            (input-files-process-path path)))
        (stringp new-path))
      :rule-classes :rewrite)