• 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
          • Vl-module
          • Vl-vardecl
          • Expressions
          • Vl-fundecl
          • Vl-assign
          • Vl-gateinst
          • Vl-modinst
          • Vl-commentmap
            • Vl-commentmap-p
              • Vl-descriptionlist-inject-comments-aux
              • Vl-commentmap-entry-sort
              • Vl-commentmap-falp
              • Vl-adjust-minloc-for-comments
              • Vl-kill-whitespace-and-comments
              • Vl-description-inject-comments
              • Vl-gather-comments
              • Vl-descriptionlist-inject-comments
              • Vl-description-add-warning
              • Vl-description-set-comments
              • Vl-gather-comments-fal
              • Vl-commentmap-fal
              • Vl-description->minloc
              • Vl-description->maxloc
              • Vl-description->comments
              • Vl-description-has-comments-p
            • Vl-commentmap-fix
            • Vl-commentmap-equiv
          • Vl-portdecl
          • Vl-taskdecl
          • Vl-design
          • Vl-interface
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Vl-fundecllist->names
          • Vl-package
          • Vl-port
          • Vl-udp
          • Vl-paramdecl
          • Vl-genelement
          • Vl-cycledelayrange
          • Vl-namedarg
          • Vl-sort-blockitems-aux
          • Vl-distitem
          • Vl-gatedelay
          • Vl-repetition
          • Vl-typedef
          • Vl-range
          • Vl-gatestrength
          • Vl-program
          • Vl-config
          • Vl-always
          • Vl-datatype-update-dims
          • Vl-import
          • Vl-enumbasetype
          • Vl-repeateventcontrol
          • Vl-paramargs
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-maybe-range
          • Vl-maybe-nettypename
          • Vl-maybe-gatestrength
          • Vl-maybe-gatedelay
          • Vl-maybe-delayoreventcontrol
          • Vl-alias
          • Maybe-string-fix
          • Vl-maybe-packeddimension
          • Vl-fwdtypedef
          • Vl-evatom
          • Vl-packeddimension-p
          • Vl-maybe-udpsymbol
          • Vl-maybe-module
          • Vl-maybe-direction
          • Vl-maybe-datatype
          • Vl-maybe-cstrength
          • Vl-direction-p
          • Vl-arguments
          • Vl-maybe-design
          • Vl-udpline
          • Vl-exprdist
          • Vl-context1
          • Vl-genvar
          • Vl-enumitem
          • Vl-datatype-update-udims
          • Vl-datatype-update-pdims
          • Vl-modelement
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-sort-blockitems
          • Vl-distweighttype-p
          • Vl-ctxelement->loc
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-modelement->loc
          • Vl-ctxelement
          • Vl-coretypename-p
          • Vl-packeddimensionlist
          • Vl-modelementlist->genelements
          • Vl-gatetype-p
          • Vl-paramdecllist
          • Vl-lifetime-p
          • Vl-datatype->udims
          • Vl-datatype->pdims
          • Vl-timeunit-p
          • Vl-repetitiontype-p
          • Vl-port->name
          • Vl-importlist
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-cstrength-p
          • Statements
          • Vl-udpentry-p
          • Vl-packeddimension-fix
          • Vl-nettypename-p
          • Vl-portdecllist
          • Vl-port->loc
          • Vl-enumbasekind-fix
          • Vl-arguments->args
          • Vl-taskdecllist
          • Vl-portlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-fundecllist
          • Vl-blockstmt-p
          • Vl-assignlist
          • Vl-alwaystype-p
          • Vl-typedeflist
          • Vl-syntaxversion-p
          • Vl-randomqualifier-p
          • Vl-modinstlist
          • Vl-gateinstlist
          • Vl-blockitemlist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-programlist
          • Vl-paramvaluelist
          • Vl-packagelist
          • Vl-namedparamvaluelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-interfacelist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-fwdtypedeflist
          • Vl-evatomlist
          • Vl-enumitemlist
          • Vl-distlist
          • Vl-configlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-regularportlist
          • Vl-rangelist-list
          • Vl-rangelist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-maybe-range-list
          • Vl-interfaceportlist
          • Vl-argumentlist
          • Data-types
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-commentmap

Vl-commentmap-p

Recognizer for vl-commentmap.

Signature
(vl-commentmap-p x) → *

Definitions and Theorems

Function: vl-commentmap-p

(defun vl-commentmap-p (x)
  (declare (xargs :guard t))
  (let ((__function__ 'vl-commentmap-p))
    (declare (ignorable __function__))
    (if (atom x)
        t
      (and (consp (car x))
           (vl-location-p (caar x))
           (stringp (cdar x))
           (vl-commentmap-p (cdr x))))))

Theorem: vl-commentmap-p-of-revappend

(defthm vl-commentmap-p-of-revappend
  (equal (vl-commentmap-p (revappend acl2::x acl2::y))
         (and (vl-commentmap-p (list-fix acl2::x))
              (vl-commentmap-p acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-remove

(defthm vl-commentmap-p-of-remove
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (remove acl2::a acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-last

(defthm vl-commentmap-p-of-last
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (vl-commentmap-p (last acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-nthcdr

(defthm vl-commentmap-p-of-nthcdr
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (vl-commentmap-p (nthcdr acl2::n acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-butlast

(defthm vl-commentmap-p-of-butlast
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (vl-commentmap-p (butlast acl2::x acl2::n)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-update-nth

(defthm vl-commentmap-p-of-update-nth
  (implies
       (vl-commentmap-p (double-rewrite acl2::x))
       (iff (vl-commentmap-p (update-nth acl2::n acl2::y acl2::x))
            (and (and (consp acl2::y)
                      (vl-location-p (car acl2::y))
                      (stringp (cdr acl2::y)))
                 (or (<= (nfix acl2::n) (len acl2::x))
                     (and (consp nil)
                          (vl-location-p (car nil))
                          (stringp (cdr nil)))))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-repeat

(defthm vl-commentmap-p-of-repeat
  (iff (vl-commentmap-p (repeat acl2::n acl2::x))
       (or (and (consp acl2::x)
                (vl-location-p (car acl2::x))
                (stringp (cdr acl2::x)))
           (zp acl2::n)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-take

(defthm vl-commentmap-p-of-take
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (iff (vl-commentmap-p (take acl2::n acl2::x))
                (or (and (consp nil)
                         (vl-location-p (car nil))
                         (stringp (cdr nil)))
                    (<= (nfix acl2::n) (len acl2::x)))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-union-equal

(defthm vl-commentmap-p-of-union-equal
  (equal (vl-commentmap-p (union-equal acl2::x acl2::y))
         (and (vl-commentmap-p (list-fix acl2::x))
              (vl-commentmap-p (double-rewrite acl2::y))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-intersection-equal-2

(defthm vl-commentmap-p-of-intersection-equal-2
  (implies (vl-commentmap-p (double-rewrite acl2::y))
           (vl-commentmap-p (intersection-equal acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-intersection-equal-1

(defthm vl-commentmap-p-of-intersection-equal-1
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (vl-commentmap-p (intersection-equal acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-set-difference-equal

(defthm vl-commentmap-p-of-set-difference-equal
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (set-difference-equal acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-set-equiv-congruence

(defthm vl-commentmap-p-set-equiv-congruence
  (implies (set-equiv acl2::x acl2::y)
           (equal (vl-commentmap-p acl2::x)
                  (vl-commentmap-p acl2::y)))
  :rule-classes :congruence)

Theorem: vl-commentmap-p-when-subsetp-equal

(defthm vl-commentmap-p-when-subsetp-equal
  (and (implies (and (subsetp-equal acl2::x acl2::y)
                     (vl-commentmap-p acl2::y))
                (vl-commentmap-p acl2::x))
       (implies (and (vl-commentmap-p acl2::y)
                     (subsetp-equal acl2::x acl2::y))
                (vl-commentmap-p acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-rcons

(defthm vl-commentmap-p-of-rcons
  (iff (vl-commentmap-p (acl2::rcons acl2::a acl2::x))
       (and (and (consp acl2::a)
                 (vl-location-p (car acl2::a))
                 (stringp (cdr acl2::a)))
            (vl-commentmap-p (list-fix acl2::x))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-rev

(defthm vl-commentmap-p-of-rev
  (equal (vl-commentmap-p (rev acl2::x))
         (vl-commentmap-p (list-fix acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-duplicated-members

(defthm vl-commentmap-p-of-duplicated-members
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (duplicated-members acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-difference

(defthm vl-commentmap-p-of-difference
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (difference acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-intersect-2

(defthm vl-commentmap-p-of-intersect-2
  (implies (vl-commentmap-p acl2::y)
           (vl-commentmap-p (intersect acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-intersect-1

(defthm vl-commentmap-p-of-intersect-1
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (intersect acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-union

(defthm vl-commentmap-p-of-union
  (iff (vl-commentmap-p (union acl2::x acl2::y))
       (and (vl-commentmap-p (sfix acl2::x))
            (vl-commentmap-p (sfix acl2::y))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-mergesort

(defthm vl-commentmap-p-of-mergesort
  (iff (vl-commentmap-p (mergesort acl2::x))
       (vl-commentmap-p (list-fix acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-delete

(defthm vl-commentmap-p-of-delete
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (delete acl2::k acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-insert

(defthm vl-commentmap-p-of-insert
  (iff (vl-commentmap-p (insert acl2::a acl2::x))
       (and (vl-commentmap-p (sfix acl2::x))
            (and (consp acl2::a)
                 (vl-location-p (car acl2::a))
                 (stringp (cdr acl2::a)))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-sfix

(defthm vl-commentmap-p-of-sfix
  (iff (vl-commentmap-p (sfix acl2::x))
       (or (vl-commentmap-p acl2::x)
           (not (setp acl2::x))))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-list-fix

(defthm vl-commentmap-p-of-list-fix
  (equal (vl-commentmap-p (list-fix acl2::x))
         (vl-commentmap-p acl2::x))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-append

(defthm vl-commentmap-p-of-append
  (equal (vl-commentmap-p (append acl2::a acl2::b))
         (and (vl-commentmap-p acl2::a)
              (vl-commentmap-p acl2::b)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-when-not-consp

(defthm vl-commentmap-p-when-not-consp
  (implies (not (consp acl2::x))
           (vl-commentmap-p acl2::x))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-cdr-when-vl-commentmap-p

(defthm vl-commentmap-p-of-cdr-when-vl-commentmap-p
  (implies (vl-commentmap-p (double-rewrite acl2::x))
           (vl-commentmap-p (cdr acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-cons

(defthm vl-commentmap-p-of-cons
  (equal (vl-commentmap-p (cons acl2::a acl2::x))
         (and (and (consp acl2::a)
                   (vl-location-p (car acl2::a))
                   (stringp (cdr acl2::a)))
              (vl-commentmap-p acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-make-fal

(defthm vl-commentmap-p-of-make-fal
  (implies (and (vl-commentmap-p acl2::x)
                (vl-commentmap-p acl2::y))
           (vl-commentmap-p (make-fal acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: stringp-of-cdr-when-member-equal-of-vl-commentmap-p

(defthm stringp-of-cdr-when-member-equal-of-vl-commentmap-p
  (and (implies (and (vl-commentmap-p acl2::x)
                     (member-equal acl2::a acl2::x))
                (stringp (cdr acl2::a)))
       (implies (and (member-equal acl2::a acl2::x)
                     (vl-commentmap-p acl2::x))
                (stringp (cdr acl2::a))))
  :rule-classes ((:rewrite)))

Theorem: vl-location-p-of-car-when-member-equal-of-vl-commentmap-p

(defthm vl-location-p-of-car-when-member-equal-of-vl-commentmap-p
  (and (implies (and (vl-commentmap-p acl2::x)
                     (member-equal acl2::a acl2::x))
                (vl-location-p (car acl2::a)))
       (implies (and (member-equal acl2::a acl2::x)
                     (vl-commentmap-p acl2::x))
                (vl-location-p (car acl2::a))))
  :rule-classes ((:rewrite)))

Theorem: consp-when-member-equal-of-vl-commentmap-p

(defthm consp-when-member-equal-of-vl-commentmap-p
  (implies (and (vl-commentmap-p acl2::x)
                (member-equal acl2::a acl2::x))
           (consp acl2::a))
  :rule-classes
  ((:rewrite :backchain-limit-lst (0 0))
   (:rewrite :backchain-limit-lst (0 0)
             :corollary (implies (if (member-equal acl2::a acl2::x)
                                     (vl-commentmap-p acl2::x)
                                   'nil)
                                 (consp acl2::a)))))

Theorem: vl-commentmap-p-of-fast-alist-clean

(defthm vl-commentmap-p-of-fast-alist-clean
  (implies (vl-commentmap-p acl2::x)
           (vl-commentmap-p (fast-alist-clean acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-hons-shrink-alist

(defthm vl-commentmap-p-of-hons-shrink-alist
  (implies (and (vl-commentmap-p acl2::x)
                (vl-commentmap-p acl2::y))
           (vl-commentmap-p (hons-shrink-alist acl2::x acl2::y)))
  :rule-classes ((:rewrite)))

Theorem: vl-commentmap-p-of-hons-acons

(defthm vl-commentmap-p-of-hons-acons
  (equal (vl-commentmap-p (hons-acons acl2::a acl2::n acl2::x))
         (and (vl-location-p acl2::a)
              (stringp acl2::n)
              (vl-commentmap-p acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: stringp-of-cdr-of-hons-assoc-equal-when-vl-commentmap-p

(defthm stringp-of-cdr-of-hons-assoc-equal-when-vl-commentmap-p
  (implies (vl-commentmap-p acl2::x)
           (iff (stringp (cdr (hons-assoc-equal acl2::k acl2::x)))
                (hons-assoc-equal acl2::k acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: stringp-of-cdar-when-vl-commentmap-p

(defthm stringp-of-cdar-when-vl-commentmap-p
  (implies (vl-commentmap-p acl2::x)
           (iff (stringp (cdar acl2::x))
                (consp acl2::x)))
  :rule-classes ((:rewrite)))

Theorem: vl-location-p-of-caar-when-vl-commentmap-p

(defthm vl-location-p-of-caar-when-vl-commentmap-p
  (implies (vl-commentmap-p acl2::x)
           (iff (vl-location-p (caar acl2::x))
                (consp acl2::x)))
  :rule-classes ((:rewrite)))

Subtopics

Vl-descriptionlist-inject-comments-aux
(vl-descriptionlist-inject-comments-aux x fal all-descs) maps vl-description-inject-comments across a list.
Vl-commentmap-entry-sort
A basic sort for comment maps.
Vl-commentmap-falp
Data structure that supports efficient comment gathering.
Vl-adjust-minloc-for-comments
Tweak starting location so that we get comments preceding the module keyword.
Vl-kill-whitespace-and-comments
Prepare a token list for parsing by removing whitespace and comment tokens, and construct a comment map from any comment tokens.
Vl-description-inject-comments
Vl-gather-comments
Slow, but straightforward routine for gathering all comments between two locations.
Vl-descriptionlist-inject-comments
Associate all comments with their modules/interfaces/etc.
Vl-description-add-warning
Vl-description-set-comments
Vl-gather-comments-fal
Efficient routine for gathering comments using an vl-commentmap-falp.
Vl-commentmap-fal
Vl-description->minloc
Vl-description->maxloc
Vl-description->comments
Vl-description-has-comments-p