• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vl
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Vl-fundecl
          • Vl-interface
          • Vl-design
          • Vl-assign
          • Vl-modinst
          • Vl-gateinst
          • Vl-taskdecl
          • Vl-portdecl
          • 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-dpiimport
          • Vl-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
          • Vl-plainarglist->exprs
          • Vl-class
          • Vl-taskdecllist->names
          • Vl-sort-blockitems-aux
          • Vl-fundecllist->names
          • Expressions-and-datatypes
          • Vl-udp
          • Vl-port
          • Vl-genelement
          • Vl-clkdecl
          • Vl-parse-temps
          • Vl-bind
          • Vl-namedarg
          • Vl-exprdist
          • Vl-clkassign
          • Vl-range
          • Vl-propport
          • Vl-typedef
          • Vl-gatedelay
          • Vl-dimension
          • Vl-sequence
          • Vl-clkskew
          • Vl-program
          • Vl-gatestrength
          • Vl-property
          • Vl-config
          • Vl-always
          • Vl-import
          • Vl-repeateventcontrol
          • Vl-timeliteral
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-final
          • Vl-maybe-clkskew
          • Vl-alias
          • Vl-maybe-nettypename
          • Vl-maybe-gatedelay
          • Vl-letdecl
          • Vl-direction-p
          • Vl-modelement
          • Vl-maybe-timeprecisiondecl
          • Vl-maybe-scopeid
          • Vl-maybe-gatestrength
          • Vl-maybe-direction
          • Vl-maybe-delayoreventcontrol
          • Vl-gclkdecl
          • Vl-fwdtypedef
          • Vl-maybe-udpsymbol-p
          • Vl-maybe-timeunitdecl
          • Vl-maybe-timeliteral
          • Vl-maybe-parse-temps
          • Vl-maybe-cstrength
          • Vl-arguments
          • Vl-maybe-module
          • Vl-maybe-design
          • Vl-covergroup
          • Vl-udpline
          • Vl-timeunitdecl
          • Vl-genvar
          • Vl-defaultdisable
          • Vl-context1
          • Vl-timeprecisiondecl
          • Vl-sort-blockitems
          • Vl-elabtask
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-modelement->loc
          • Vl-ctxelement
          • Vl-ctxelement->loc
          • Statements
          • Vl-interface->ifports
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-gatetype-p
          • Vl-typedeflist
          • Vl-genelement->loc
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-elabtask->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-port->loc
          • Property-expressions
          • Vl-taskdecllist
          • Vl-fundecllist
          • Vl-sequencelist
          • Vl-propertylist
          • Vl-portlist
          • Vl-dpiimportlist
          • Vl-dpiexportlist
          • Vl-classlist
          • Vl-arguments->args
          • Vl-alwaystype-p
          • Vl-modinstlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-blockstmt-p
          • Vl-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • Vl-assignlist
          • Vl-assertionlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-propportlist
          • Vl-programlist
          • Vl-packagelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-letdecllist
          • Vl-interfacelist
          • Vl-gateinstlist
          • Vl-fwdtypedeflist
          • Vl-covergrouplist
          • Vl-configlist
          • Vl-clkassignlist
          • Vl-casekey-p
          • Vl-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Testing-utilities
    • Math
  • 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