• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
            • Vl-expr-typedecide
              • Vl-arithclass-p
                • Vl-arithclass-max
                • Vl-datatype-arithclass
                • Vl-integer-arithclass-p
                • Vl-integer-arithclass->exprsign
                • Vl-exprsign->arithclass
              • Vl-binaryop-typedecide
              • Vl-funcall-typedecide
              • Vl-index-typedecide
              • Vl-unaryop-typedecide
              • Vl-signedness-ambiguity-warning
              • Vl-syscall-typedecide
              • Vl-value-typedecide
              • Vl-operandinfo-signedness-caveat
            • Vl-exprlist-resolved->vals
            • Vl-make-idexpr-list
            • Vl-idexprlist->names
            • Vl-expr-selfsize
            • Vl-expr-update-subexprs
            • Vl-exprlist-to-plainarglist
            • Vl-call-namedargs-update-subexprs
            • Vl-valuerangelist-update-subexprs
            • Vl-streamexprlist-update-subexprs
            • Vl-op-p
            • Vl-maybe-exprlist-update-subexprs
            • Vl-evatomlist-update-subexprs
            • Vl-expr-values
            • Vl-keyvallist-update-subexprs
            • Vl-assignpat-update-subexprs
            • Vl-valuerange-update-subexprs
            • Vl-scopeexpr-update-subexprs
            • Vl-partselect-update-subexprs
            • Vl-hidexpr-update-subexprs
            • Vl-expr-add-atts
            • Vl-arrayrange-update-subexprs
            • Vl-streamexpr-update-subexprs
            • Vl-slicesize-update-subexprs
            • Vl-plusminus-update-subexprs
            • Vl-patternkey-update-subexprs
            • Vl-expr-ops
            • Vl-make-integer
            • Vl-range-update-subexprs
            • Vl-idexpr
            • Vl-make-index
            • Vl-expr->subexprs
            • Vl-bitlist-from-nat
            • Vl-pps-expr
            • Vl-maybe-exprlist->subexprs
            • Vl-hidexpr->subexprs
            • Vl-evatomlist->subexprs
            • Vl-call-namedargs->subexprs
            • Vl-valuerangelist->subexprs
            • Vl-streamexprlist->subexprs
            • Vl-keyvallist->subexprs
            • Vl-exprlist-has-ops
            • Vl-expr-resolved-p
            • Vl-valuerange->subexprs
            • Vl-streamexpr->subexprs
            • Vl-slicesize->subexprs
            • Vl-scopeexpr->subexprs
            • Vl-patternkey->subexprs
            • Vl-partselect->subexprs
            • Vl-assignpat->subexprs
            • Vl-arrayrange->subexprs
            • Vl-pps-origexpr
            • Vl-plusminus->subexprs
            • Vl-idscope
            • Vl-idexpr->name
            • Vl-expr-has-ops
            • Vl-resolved->val
            • Vl-range->subexprs
            • Vl-idexpr-p
            • Vl-idexprlist-p
            • Vl-exprlist-resolved-p
            • Vl-idscope->name
            • Vl-idscope-p
            • Vl-zbitlist-p
            • Vl-zatom-p
            • Vl-op-fix
            • Vl-oplist
            • Vl-expr-varnames
            • Vl-one-bit-constants
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
          • Syscalls
          • Allexprs
          • Lvalues
          • Port-tools
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-expr-typedecide

Vl-arithclass-p

Classification of expressions (or datatypes) as signed or unsigned integral, shortreal, real, or of some other kind.

These classifications are used in the description of expression types (signedness) found in SystemVerilog-2012 Sections 11.7-11.8.

It isn't entirely clear to me whether shortreal should be regarded as a different type than real, but it seems possibly useful to keep them separated.

We use ``other'' class to describe things that are valid but of some non-arithmetic type, for instance: unpacked structures, void, chandles, etc.

We use ``error'' class to describe the case where we really did have some kind of error determining the type.

This is an ordinary defenum.

Function: vl-arithclass-p

(defun vl-arithclass-p (x)
  (declare (xargs :guard t))
  (or (eq x ':vl-signed-int-class)
      (eq x ':vl-unsigned-int-class)
      (eq x ':vl-shortreal-class)
      (eq x ':vl-real-class)
      (eq x ':vl-other-class)
      (eq x ':vl-error-class)))

Theorem: type-when-vl-arithclass-p

(defthm type-when-vl-arithclass-p
  (implies (vl-arithclass-p x)
           (if (symbolp x)
               (if (not (equal x 't))
                   (not (equal x 'nil))
                 'nil)
             'nil))
  :rule-classes :compound-recognizer)

Subtopics

Vl-arithclass-max
(vl-arithclass-max x y &rest rst) computes the arithmetic class for a non self-determined operand, given the classes of the arguments.
Vl-datatype-arithclass
Decide whether the datatype is signed/unsigned/real/other.
Vl-integer-arithclass-p
Vl-integer-arithclass->exprsign
Vl-exprsign->arithclass