• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • 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-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-atts
            • Vl-expr
              • Vl-expr-p
              • Vl-expr->atts
                • Vl-index
                • Vl-call
                • Vl-exprsign
                • Vl-maybe-expr
                • Vl-stream
                • Vl-expr-case
                • Vl-pattern
                • Vl-literal
                • Vl-binary
                • Vl-expr-update-atts
                • Vl-unary
                • Vl-special
                • Vl-qmark
                • Vl-inside
                • Vl-cast
                • Vl-multiconcat
                • Vl-mintypmax
                • Vl-tagged
                • Vl-concat
                • Vl-expr-equiv
                • Vl-eventexpr
                • Vl-expr-kind
                • Vl-exprlist
                • Vl-maybe-exprlist
                • Vl-expr-fix
                • Vl-expr-count
              • Vl-datatype
              • New-expression-representation
              • Vl-paramargs
              • Vl-evatom
              • Vl-maybe-paramargs
              • Vl-evatomlist
              • Vl-call-namedargs
              • Vl-paramvaluelist
              • Vl-namedparamvaluelist
            • 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-expr

    Vl-expr->atts

    Get the attributes from any expression.

    Signature
    (vl-expr->atts x) → atts
    Arguments
    x — Guard (vl-expr-p x).
    Returns
    atts — Type (vl-atts-p atts).

    Definitions and Theorems

    Function: vl-expr->atts

    (defun vl-expr->atts (x)
           (declare (xargs :guard (vl-expr-p x)))
           (let ((__function__ 'vl-expr->atts))
                (declare (ignorable __function__))
                (vl-expr-case x
                              :vl-special x.atts
                              :vl-literal x.atts
                              :vl-index x.atts
                              :vl-unary x.atts
                              :vl-binary x.atts
                              :vl-qmark x.atts
                              :vl-mintypmax x.atts
                              :vl-concat x.atts
                              :vl-multiconcat x.atts
                              :vl-stream x.atts
                              :vl-call x.atts
                              :vl-cast x.atts
                              :vl-inside x.atts
                              :vl-tagged x.atts
                              :vl-pattern x.atts
                              :vl-eventexpr x.atts)))

    Theorem: vl-atts-p-of-vl-expr->atts

    (defthm vl-atts-p-of-vl-expr->atts
            (b* ((atts (vl-expr->atts x)))
                (vl-atts-p atts))
            :rule-classes :rewrite)

    Theorem: vl-expr->atts-of-vl-expr-fix-x

    (defthm vl-expr->atts-of-vl-expr-fix-x
            (equal (vl-expr->atts (vl-expr-fix x))
                   (vl-expr->atts x)))

    Theorem: vl-expr->atts-vl-expr-equiv-congruence-on-x

    (defthm vl-expr->atts-vl-expr-equiv-congruence-on-x
            (implies (vl-expr-equiv x x-equiv)
                     (equal (vl-expr->atts x)
                            (vl-expr->atts x-equiv)))
            :rule-classes :congruence)

    The following are goofy rules: normally we want to normalize things to (vl-expr->atts <term>), but if <term> is a call of one of the particular expression constructors, we'll rewrite the other way so that we can simplify it to just whatever atts are being given to the constructor.

    Theorem: vl-expr-atts-when-vl-special

    (defthm
       vl-expr-atts-when-vl-special
       (implies
            (vl-expr-case x :vl-special)
            (and (implies (syntaxp (and (consp x)
                                        (eq (car x) 'vl-special)))
                          (equal (vl-expr->atts x)
                                 (vl-special->atts x)))
                 (implies (syntaxp (not (and (consp x)
                                             (eq (car x) 'vl-special))))
                          (equal (vl-special->atts x)
                                 (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-literal

    (defthm
       vl-expr-atts-when-vl-literal
       (implies
            (vl-expr-case x :vl-literal)
            (and (implies (syntaxp (and (consp x)
                                        (eq (car x) 'vl-literal)))
                          (equal (vl-expr->atts x)
                                 (vl-literal->atts x)))
                 (implies (syntaxp (not (and (consp x)
                                             (eq (car x) 'vl-literal))))
                          (equal (vl-literal->atts x)
                                 (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-index

    (defthm
     vl-expr-atts-when-vl-index
     (implies
      (vl-expr-case x :vl-index)
      (and
         (implies (syntaxp (and (consp x) (eq (car x) 'vl-index)))
                  (equal (vl-expr->atts x)
                         (vl-index->atts x)))
         (implies (syntaxp (not (and (consp x) (eq (car x) 'vl-index))))
                  (equal (vl-index->atts x)
                         (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-unary

    (defthm
     vl-expr-atts-when-vl-unary
     (implies
      (vl-expr-case x :vl-unary)
      (and
         (implies (syntaxp (and (consp x) (eq (car x) 'vl-unary)))
                  (equal (vl-expr->atts x)
                         (vl-unary->atts x)))
         (implies (syntaxp (not (and (consp x) (eq (car x) 'vl-unary))))
                  (equal (vl-unary->atts x)
                         (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-binary

    (defthm
     vl-expr-atts-when-vl-binary
     (implies
         (vl-expr-case x :vl-binary)
         (and (implies (syntaxp (and (consp x) (eq (car x) 'vl-binary)))
                       (equal (vl-expr->atts x)
                              (vl-binary->atts x)))
              (implies (syntaxp (not (and (consp x)
                                          (eq (car x) 'vl-binary))))
                       (equal (vl-binary->atts x)
                              (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-qmark

    (defthm
     vl-expr-atts-when-vl-qmark
     (implies
      (vl-expr-case x :vl-qmark)
      (and
         (implies (syntaxp (and (consp x) (eq (car x) 'vl-qmark)))
                  (equal (vl-expr->atts x)
                         (vl-qmark->atts x)))
         (implies (syntaxp (not (and (consp x) (eq (car x) 'vl-qmark))))
                  (equal (vl-qmark->atts x)
                         (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-mintypmax

    (defthm
     vl-expr-atts-when-vl-mintypmax
     (implies
          (vl-expr-case x :vl-mintypmax)
          (and (implies (syntaxp (and (consp x)
                                      (eq (car x) 'vl-mintypmax)))
                        (equal (vl-expr->atts x)
                               (vl-mintypmax->atts x)))
               (implies (syntaxp (not (and (consp x)
                                           (eq (car x) 'vl-mintypmax))))
                        (equal (vl-mintypmax->atts x)
                               (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-concat

    (defthm
     vl-expr-atts-when-vl-concat
     (implies
         (vl-expr-case x :vl-concat)
         (and (implies (syntaxp (and (consp x) (eq (car x) 'vl-concat)))
                       (equal (vl-expr->atts x)
                              (vl-concat->atts x)))
              (implies (syntaxp (not (and (consp x)
                                          (eq (car x) 'vl-concat))))
                       (equal (vl-concat->atts x)
                              (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-multiconcat

    (defthm
     vl-expr-atts-when-vl-multiconcat
     (implies
        (vl-expr-case x :vl-multiconcat)
        (and (implies (syntaxp (and (consp x)
                                    (eq (car x) 'vl-multiconcat)))
                      (equal (vl-expr->atts x)
                             (vl-multiconcat->atts x)))
             (implies (syntaxp (not (and (consp x)
                                         (eq (car x) 'vl-multiconcat))))
                      (equal (vl-multiconcat->atts x)
                             (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-stream

    (defthm
     vl-expr-atts-when-vl-stream
     (implies
         (vl-expr-case x :vl-stream)
         (and (implies (syntaxp (and (consp x) (eq (car x) 'vl-stream)))
                       (equal (vl-expr->atts x)
                              (vl-stream->atts x)))
              (implies (syntaxp (not (and (consp x)
                                          (eq (car x) 'vl-stream))))
                       (equal (vl-stream->atts x)
                              (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-call

    (defthm
     vl-expr-atts-when-vl-call
     (implies
      (vl-expr-case x :vl-call)
      (and
          (implies (syntaxp (and (consp x) (eq (car x) 'vl-call)))
                   (equal (vl-expr->atts x)
                          (vl-call->atts x)))
          (implies (syntaxp (not (and (consp x) (eq (car x) 'vl-call))))
                   (equal (vl-call->atts x)
                          (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-cast

    (defthm
     vl-expr-atts-when-vl-cast
     (implies
      (vl-expr-case x :vl-cast)
      (and
          (implies (syntaxp (and (consp x) (eq (car x) 'vl-cast)))
                   (equal (vl-expr->atts x)
                          (vl-cast->atts x)))
          (implies (syntaxp (not (and (consp x) (eq (car x) 'vl-cast))))
                   (equal (vl-cast->atts x)
                          (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-inside

    (defthm
     vl-expr-atts-when-vl-inside
     (implies
         (vl-expr-case x :vl-inside)
         (and (implies (syntaxp (and (consp x) (eq (car x) 'vl-inside)))
                       (equal (vl-expr->atts x)
                              (vl-inside->atts x)))
              (implies (syntaxp (not (and (consp x)
                                          (eq (car x) 'vl-inside))))
                       (equal (vl-inside->atts x)
                              (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-tagged

    (defthm
     vl-expr-atts-when-vl-tagged
     (implies
         (vl-expr-case x :vl-tagged)
         (and (implies (syntaxp (and (consp x) (eq (car x) 'vl-tagged)))
                       (equal (vl-expr->atts x)
                              (vl-tagged->atts x)))
              (implies (syntaxp (not (and (consp x)
                                          (eq (car x) 'vl-tagged))))
                       (equal (vl-tagged->atts x)
                              (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-pattern

    (defthm
       vl-expr-atts-when-vl-pattern
       (implies
            (vl-expr-case x :vl-pattern)
            (and (implies (syntaxp (and (consp x)
                                        (eq (car x) 'vl-pattern)))
                          (equal (vl-expr->atts x)
                                 (vl-pattern->atts x)))
                 (implies (syntaxp (not (and (consp x)
                                             (eq (car x) 'vl-pattern))))
                          (equal (vl-pattern->atts x)
                                 (vl-expr->atts x))))))

    Theorem: vl-expr-atts-when-vl-eventexpr

    (defthm
     vl-expr-atts-when-vl-eventexpr
     (implies
          (vl-expr-case x :vl-eventexpr)
          (and (implies (syntaxp (and (consp x)
                                      (eq (car x) 'vl-eventexpr)))
                        (equal (vl-expr->atts x)
                               (vl-eventexpr->atts x)))
               (implies (syntaxp (not (and (consp x)
                                           (eq (car x) 'vl-eventexpr))))
                        (equal (vl-eventexpr->atts x)
                               (vl-expr->atts x))))))

    For recurring into the atts we may need to know this.

    Theorem: vl-atts-count-of-vl-expr->atts

    (defthm vl-atts-count-of-vl-expr->atts
            (< (vl-atts-count (vl-expr->atts x))
               (vl-expr-count x))
            :rule-classes :linear)