• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
          • Name-database
            • Vl-namedb
            • Vl-namedb-plain-name
            • Vl-namedb-pset-fix
            • Vl-namedb-plain-names
            • Vl-namedb-indexed-name
            • Vl-namedb-pmap-fix
            • Vl-unlike-any-prefix-p
              • Vl-namedb-pmap-okp
              • Vl-namedb-allnames
              • Vl-starting-namedb
              • Vl-pgenstr-highest
              • Vl-namedb-pset-okp
              • Vl-pgenstr-p
              • Vl-pgenstr->val
              • Vl-free-namedb
              • Vl-namedb-plain-name-quiet
              • Vl-pgenstr-highest-of-alist-keys
              • Vl-pgenstr
              • Vl-empty-namedb
              • Vl-namedb-nameset
              • Vl-unlike-any-prefix-p-of-alist-keys
              • Vl-namedb-prefixmap
            • Vl-gc
            • Symbol-list-names
            • Ints-from
            • Nats-from
            • Make-lookup-alist
            • Redundant-mergesort
            • Longest-common-prefix
            • Vl-plural-p
            • Vl-remove-keys
            • Vl-merge-contiguous-indices
            • Vl-edition-p
            • Sum-nats
            • Vl-maybe-integer-listp
            • Fast-memberp
            • Nat-listp
            • Max-nats
            • Longest-common-prefix-list
            • Character-list-listp
            • Vl-character-list-list-values-p
            • Remove-from-alist
            • Prefix-of-eachp
            • Vl-string-keys-p
            • Vl-maybe-nat-listp
            • Vl-string-list-values-p
            • String-list-listp
            • Vl-string-values-p
            • True-list-listp
            • Symbol-list-listp
            • Explode-list
            • All-have-len
            • Pos-listp
            • Min-nats
            • Debuggable-and
            • Vl-starname
            • Remove-equal-without-guard
            • Vl-maybe-string-list
            • String-fix
            • Longer-than-p
            • Anyp
            • Fast-alist-free-each-alist-val
            • Not*
            • Free-list-of-fast-alists
            • *nls*
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Name-database

    Vl-unlike-any-prefix-p

    (vl-unlike-any-prefix-p name prefixes) determines whether for all p in prefixes, (vl-pgenstr-p p name) is false.

    We use this function in the implementation of vl-namedb-plain-name. When requesting a plain name, one might ask for a name like foo_3, which could screw up the prefix map if we are using foo as a prefix.

    One solution would be to fix up the prefix map when this occurs. But we take the easier approach of just not allowing you to request any name that matches a current prefix.

    Definitions and Theorems

    Function: vl-unlike-any-prefix-p

    (defun vl-unlike-any-prefix-p (name prefixes)
      (declare (xargs :guard (and (stringp name)
                                  (string-listp prefixes))))
      (or (atom prefixes)
          (and (not (vl-pgenstr-p (car prefixes) name))
               (vl-unlike-any-prefix-p name (cdr prefixes)))))

    Theorem: vl-unlike-any-prefix-p-when-atom

    (defthm vl-unlike-any-prefix-p-when-atom
      (implies (atom prefixes)
               (vl-unlike-any-prefix-p name prefixes)))

    Theorem: vl-unlike-any-prefix-p-of-cons

    (defthm vl-unlike-any-prefix-p-of-cons
      (equal (vl-unlike-any-prefix-p name (cons a x))
             (and (not (vl-pgenstr-p a name))
                  (vl-unlike-any-prefix-p name x))))

    Theorem: vl-pgenstr-p-when-vl-unlike-any-prefix-p

    (defthm vl-pgenstr-p-when-vl-unlike-any-prefix-p
      (implies (and (member-equal key prefixes)
                    (vl-unlike-any-prefix-p name prefixes))
               (not (vl-pgenstr-p key name))))

    Theorem: vl-unlike-any-prefix-p-preserves-set-equiv-prefixes

    (defthm vl-unlike-any-prefix-p-preserves-set-equiv-prefixes
      (implies (set-equiv prefixes prefixes-equiv)
               (equal (vl-unlike-any-prefix-p name prefixes)
                      (vl-unlike-any-prefix-p name prefixes-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-prefix-map-correct-p-aux-when-vl-unlike-any-prefix-p

    (defthm vl-prefix-map-correct-p-aux-when-vl-unlike-any-prefix-p
      (implies
           (and (vl-prefix-map-correct-p-aux domain pmap names)
                (vl-unlike-any-prefix-p name (alist-keys pmap)))
           (vl-prefix-map-correct-p-aux domain pmap (cons name names))))

    Theorem: vl-prefix-map-correct-p-when-vl-unlike-any-prefix-p

    (defthm vl-prefix-map-correct-p-when-vl-unlike-any-prefix-p
      (implies (and (vl-prefix-map-correct-p pset names)
                    (vl-unlike-any-prefix-p name (alist-keys pset)))
               (vl-prefix-map-correct-p pset (cons name names))))