• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Implementation-environments
            • Concrete-syntax
              • Grammar
              • Files
              • Grammar-character-p
              • Keywords
              • Grammar-character-listp
              • File-paths
                • Filepath-option
                • Filepath
                  • Filepath-fix
                    • Filepath-equiv
                    • Filepathp
                    • Make-filepath
                    • Filepath->unwrap
                    • Change-filepath
                  • Filepath-set
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Filepath

    Filepath-fix

    Fixing function for filepath structures.

    Signature
    (filepath-fix x) → new-x
    Arguments
    x — Guard (filepathp x).
    Returns
    new-x — Type (filepathp new-x).

    Definitions and Theorems

    Function: filepath-fix$inline

    (defun filepath-fix$inline (x)
      (declare (xargs :guard (filepathp x)))
      (let ((__function__ 'filepath-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((unwrap (identity (cdr (std::da-nth 0 x)))))
               (list (cons 'unwrap unwrap)))
             :exec x)))

    Theorem: filepathp-of-filepath-fix

    (defthm filepathp-of-filepath-fix
      (b* ((new-x (filepath-fix$inline x)))
        (filepathp new-x))
      :rule-classes :rewrite)

    Theorem: filepath-fix-when-filepathp

    (defthm filepath-fix-when-filepathp
      (implies (filepathp x)
               (equal (filepath-fix x) x)))

    Function: filepath-equiv$inline

    (defun filepath-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (filepathp acl2::x)
                                  (filepathp acl2::y))))
      (equal (filepath-fix acl2::x)
             (filepath-fix acl2::y)))

    Theorem: filepath-equiv-is-an-equivalence

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

    Theorem: filepath-equiv-implies-equal-filepath-fix-1

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

    Theorem: filepath-fix-under-filepath-equiv

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

    Theorem: equal-of-filepath-fix-1-forward-to-filepath-equiv

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

    Theorem: equal-of-filepath-fix-2-forward-to-filepath-equiv

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

    Theorem: filepath-equiv-of-filepath-fix-1-forward

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

    Theorem: filepath-equiv-of-filepath-fix-2-forward

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