• 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
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
              • Grammar
              • Files
              • File-paths
                • Filepath-option
                • Filepath
                • Irr-filepath
                • Filepath-set
                • Filepath-list
                  • Filepath-list-fix
                    • Filepath-list-equiv
                    • Filepath-listp
                • Grammar-characters
              • 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
    • Filepath-list

    Filepath-list-fix

    (filepath-list-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (filepath-list-fix x) → fty::newx
    Arguments
    x — Guard (filepath-listp x).
    Returns
    fty::newx — Type (filepath-listp fty::newx).

    In the logic, we apply filepath-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: filepath-list-fix$inline

    (defun filepath-list-fix$inline (x)
      (declare (xargs :guard (filepath-listp x)))
      (mbe :logic
           (if (atom x)
               nil
             (cons (filepath-fix (car x))
                   (filepath-list-fix (cdr x))))
           :exec x))

    Theorem: filepath-listp-of-filepath-list-fix

    (defthm filepath-listp-of-filepath-list-fix
      (b* ((fty::newx (filepath-list-fix$inline x)))
        (filepath-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: filepath-list-fix-when-filepath-listp

    (defthm filepath-list-fix-when-filepath-listp
      (implies (filepath-listp x)
               (equal (filepath-list-fix x) x)))

    Function: filepath-list-equiv$inline

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

    Theorem: filepath-list-equiv-is-an-equivalence

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

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

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

    Theorem: filepath-list-fix-under-filepath-list-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-filepath-list-fix-x-under-filepath-equiv

    (defthm car-of-filepath-list-fix-x-under-filepath-equiv
      (filepath-equiv (car (filepath-list-fix acl2::x))
                      (car acl2::x)))

    Theorem: car-filepath-list-equiv-congruence-on-x-under-filepath-equiv

    (defthm car-filepath-list-equiv-congruence-on-x-under-filepath-equiv
      (implies (filepath-list-equiv acl2::x x-equiv)
               (filepath-equiv (car acl2::x)
                               (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-filepath-list-fix-x-under-filepath-list-equiv

    (defthm cdr-of-filepath-list-fix-x-under-filepath-list-equiv
      (filepath-list-equiv (cdr (filepath-list-fix acl2::x))
                           (cdr acl2::x)))

    Theorem: cdr-filepath-list-equiv-congruence-on-x-under-filepath-list-equiv

    (defthm
      cdr-filepath-list-equiv-congruence-on-x-under-filepath-list-equiv
      (implies (filepath-list-equiv acl2::x x-equiv)
               (filepath-list-equiv (cdr acl2::x)
                                    (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-filepath-fix-x-under-filepath-list-equiv

    (defthm cons-of-filepath-fix-x-under-filepath-list-equiv
      (filepath-list-equiv (cons (filepath-fix acl2::x) acl2::y)
                           (cons acl2::x acl2::y)))

    Theorem: cons-filepath-equiv-congruence-on-x-under-filepath-list-equiv

    (defthm
          cons-filepath-equiv-congruence-on-x-under-filepath-list-equiv
      (implies (filepath-equiv acl2::x x-equiv)
               (filepath-list-equiv (cons acl2::x acl2::y)
                                    (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-filepath-list-fix-y-under-filepath-list-equiv

    (defthm cons-of-filepath-list-fix-y-under-filepath-list-equiv
      (filepath-list-equiv (cons acl2::x (filepath-list-fix acl2::y))
                           (cons acl2::x acl2::y)))

    Theorem: cons-filepath-list-equiv-congruence-on-y-under-filepath-list-equiv

    (defthm
     cons-filepath-list-equiv-congruence-on-y-under-filepath-list-equiv
     (implies (filepath-list-equiv acl2::y y-equiv)
              (filepath-list-equiv (cons acl2::x acl2::y)
                                   (cons acl2::x y-equiv)))
     :rule-classes :congruence)

    Theorem: consp-of-filepath-list-fix

    (defthm consp-of-filepath-list-fix
      (equal (consp (filepath-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: filepath-list-fix-under-iff

    (defthm filepath-list-fix-under-iff
      (iff (filepath-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: filepath-list-fix-of-cons

    (defthm filepath-list-fix-of-cons
      (equal (filepath-list-fix (cons a x))
             (cons (filepath-fix a)
                   (filepath-list-fix x))))

    Theorem: len-of-filepath-list-fix

    (defthm len-of-filepath-list-fix
      (equal (len (filepath-list-fix acl2::x))
             (len acl2::x)))

    Theorem: filepath-list-fix-of-append

    (defthm filepath-list-fix-of-append
      (equal (filepath-list-fix (append std::a std::b))
             (append (filepath-list-fix std::a)
                     (filepath-list-fix std::b))))

    Theorem: filepath-list-fix-of-repeat

    (defthm filepath-list-fix-of-repeat
      (equal (filepath-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (filepath-fix acl2::x))))

    Theorem: list-equiv-refines-filepath-list-equiv

    (defthm list-equiv-refines-filepath-list-equiv
      (implies (list-equiv acl2::x acl2::y)
               (filepath-list-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-filepath-list-fix

    (defthm nth-of-filepath-list-fix
      (equal (nth acl2::n (filepath-list-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (filepath-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: filepath-list-equiv-implies-filepath-list-equiv-append-1

    (defthm filepath-list-equiv-implies-filepath-list-equiv-append-1
      (implies (filepath-list-equiv acl2::x fty::x-equiv)
               (filepath-list-equiv (append acl2::x acl2::y)
                                    (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: filepath-list-equiv-implies-filepath-list-equiv-append-2

    (defthm filepath-list-equiv-implies-filepath-list-equiv-append-2
      (implies (filepath-list-equiv acl2::y fty::y-equiv)
               (filepath-list-equiv (append acl2::x acl2::y)
                                    (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: filepath-list-equiv-implies-filepath-list-equiv-nthcdr-2

    (defthm filepath-list-equiv-implies-filepath-list-equiv-nthcdr-2
      (implies (filepath-list-equiv acl2::l l-equiv)
               (filepath-list-equiv (nthcdr acl2::n acl2::l)
                                    (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: filepath-list-equiv-implies-filepath-list-equiv-take-2

    (defthm filepath-list-equiv-implies-filepath-list-equiv-take-2
      (implies (filepath-list-equiv acl2::l l-equiv)
               (filepath-list-equiv (take acl2::n acl2::l)
                                    (take acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: filepath-list-fix$inline-of-filepath-list-fix-x

    (defthm filepath-list-fix$inline-of-filepath-list-fix-x
      (equal (filepath-list-fix$inline (filepath-list-fix x))
             (filepath-list-fix$inline x)))

    Theorem: filepath-list-fix$inline-filepath-list-equiv-congruence-on-x

    (defthm filepath-list-fix$inline-filepath-list-equiv-congruence-on-x
      (implies (filepath-list-equiv x x-equiv)
               (equal (filepath-list-fix$inline x)
                      (filepath-list-fix$inline x-equiv)))
      :rule-classes :congruence)