• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
            • Lex-strings
            • Lex-identifiers
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
            • Chartypes
            • Vl-lex
            • Defchar
            • Tokens
              • Vl-inttoken-p
                • Vl-inttoken
                • Make-vl-inttoken
                • Change-vl-inttoken
                • Vl-inttoken-constraint-p
                  • Honsed-vl-inttoken
                  • Make-honsed-vl-inttoken
                  • Vl-inttoken->width
                  • Vl-inttoken->wasunsized
                  • Vl-inttoken->value
                  • Vl-inttoken->signedp
                  • Vl-inttoken->etext
                  • Vl-inttoken->bits
                • Vl-plaintoken-p
                • Vl-token->etext
                • Vl-token->type
                • Vl-token-p
                • Vl-idtoken-p
                • Vl-timetoken-p
                • Vl-stringtoken-p
                • Vl-kill-whitespace-and-comments
                • Vl-tokenlist->etext
                • Vl-extinttoken-p
                • Vl-sysidtoken-p
                • Vl-realtoken-p
                • Vl-tokenlist-p
                • Vl-tokenlist->string-with-spaces
                • Vl-idtoken-list-p
                • Vl-token->loc
                • Vl-plaintokentypelist-p
                • Vl-tokenlistlist-p
                • Vl-token->string
              • Lex-keywords
              • Lexstate
              • Make-test-tokens
              • Lexer-utils
              • Lex-comments
              • Vl-typo-uppercase-list-p
              • Vl-typo-lowercase-list-p
              • Vl-typo-number-list-p
            • Vl-loadstate
            • Parser
            • Vl-load-merge-descriptions
            • Scope-of-defines
            • Vl-load-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-loadresult
            • Vl-read-file
            • Vl-find-basename/extension
            • Vl-find-file
            • Vl-read-files
            • Extended-characters
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-inttoken-p

    Vl-inttoken-constraint-p

    Basic well-formedness constraint on integer tokens.

    Signature
    (vl-inttoken-constraint-p width value bits) → okp
    Arguments
    width — Guard (posp width).
    value — Guard (maybe-natp value).
    bits — Guard (vl-bitlist-p bits).

    If the integer has a value, then it must not have bits and the value must be in bounds for its width.

    If the integer has no value, then it must have exactly the right number of bits.

    Definitions and Theorems

    Function: vl-inttoken-constraint-p

    (defun vl-inttoken-constraint-p (width value bits)
      (declare (xargs :guard (and (posp width)
                                  (maybe-natp value)
                                  (vl-bitlist-p bits))))
      (let ((__function__ 'vl-inttoken-constraint-p))
        (declare (ignorable __function__))
        (if value (and (not bits)
                       (< value (expt 2 width)))
          (equal (len bits) width))))