• 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
        • Getting-started
        • Utilities
          • Name-database
          • Vl-gc
          • Make-lookup-alist
          • Symbol-list-names
          • Html-encoding
          • Nats-from
          • Redundant-mergesort
          • Longest-common-prefix
          • Vl-edition-p
          • Nat-listp
          • Vl-plural-p
            • Vl-remove-keys
            • Sum-nats
            • Vl-maybe-nat-listp
            • Url-encoding
            • Fast-memberp
            • Vl-string-keys-p
            • Max-nats
            • Longest-common-prefix-list
            • Character-list-listp
            • Vl-string-list-values-p
            • Vl-character-list-list-values-p
            • Remove-from-alist
            • Prefix-of-eachp
            • Vl-maybe-string-listp
            • Pos-listp
            • Vl-string-values-p
            • String-list-listp
            • True-list-listp
            • Symbol-list-listp
            • Explode-list
            • All-have-len
            • Min-nats
            • Debuggable-and
            • Vl-starname
            • Remove-equal-without-guard
            • String-fix
            • Longer-than-p
            • Clean-alist
            • Anyp
            • Or*
            • Fast-alist-free-each-alist-val
            • And*
            • Not*
            • Free-list-of-fast-alists
            • *nls*
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Utilities

    Vl-plural-p

    (vl-plural-p x) determines whether a description of a list should be plural instead of singluar.

    Signature
    (vl-plural-p x) → *

    Output sometimes needs to be customized depending on whether a list contains only one element or many elements, e.g.,

    • Warning: foo, bar, and baz are mismatched socks, vs.
    • Warning: foo is a mismatched sock.

    (vl-plural-p x) is a stupid function to distinguish between the cases. It returns true for a list like (foo bar baz) with more than one element, or false for a list like (foo) with exactly one element.

    We consider lists that have no elements to be plural. This gives the proper behavior in cases like:

    • 0 warnings to report,
    • 1 warning to report,
    • 2 warnings to report,
    • ...

    Definitions and Theorems

    Function: vl-plural-p$inline

    (defun vl-plural-p$inline (x)
      (declare (xargs :guard t))
      (let ((__function__ 'vl-plural-p))
        (declare (ignorable __function__))
        (mbe :logic (not (equal (len x) 1))
             :exec (or (atom x) (not (atom (cdr x)))))))