• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
          • Syscalls
            • Vl-syscall->returninfo
            • Vl-*ary-syscall-p
              • Vl-*ary-syscall->args
            • Vl-unary-syscall-p
            • Vl-0ary-syscall-p
            • Vl-sysfun-should-size-args-p
            • Vl-$random-expr-p
            • Vl-sysfunexpr->name
            • Vl-sysfunexpr-p
            • Vl-unary-syscall->arg
          • Relocate
          • Expr-cleaning
          • Namemangle
          • Caremask
          • Port-tools
          • Lvalues
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Syscalls

Vl-*ary-syscall-p

Recognize calls of a particular system function call, without any arity checking.

Signature
(vl-*ary-syscall-p name x) → *
Arguments
name — Name of the particular system call, e.g., $size.
    Guard (stringp name).
x — Expression to test.
    Guard (vl-expr-p x).

For instance, to see if x is a call of $size, you could write:

(vl-*ary-syscall-p "$size" x)

Definitions and Theorems

Function: vl-*ary-syscall-p

(defun vl-*ary-syscall-p (name x)
  (declare (xargs :guard (and (stringp name) (vl-expr-p x))))
  (let ((__function__ 'vl-*ary-syscall-p))
    (declare (ignorable __function__))
    (b* (((when (vl-fast-atom-p x)) nil)
         ((vl-nonatom x))
         ((unless (and (eq x.op :vl-syscall)
                       (consp x.args)))
          nil)
         (fn (first x.args))
         ((unless (vl-sysfunexpr-p fn)) nil))
      (equal (vl-sysfunexpr->name fn)
             (string-fix name)))))

Theorem: arity-stuff-about-vl-*ary-syscall-p

(defthm arity-stuff-about-vl-*ary-syscall-p
  (implies (vl-*ary-syscall-p name x)
           (and (not (equal (vl-expr-kind x) :atom))
                (equal (vl-nonatom->op x) :vl-syscall)
                (consp (vl-nonatom->args x))))
  :rule-classes :forward-chaining)

Theorem: vl-*ary-syscall-p-of-str-fix-name

(defthm vl-*ary-syscall-p-of-str-fix-name
  (equal (vl-*ary-syscall-p (str-fix name) x)
         (vl-*ary-syscall-p name x)))

Theorem: vl-*ary-syscall-p-streqv-congruence-on-name

(defthm vl-*ary-syscall-p-streqv-congruence-on-name
  (implies (streqv name name-equiv)
           (equal (vl-*ary-syscall-p name x)
                  (vl-*ary-syscall-p name-equiv x)))
  :rule-classes :congruence)

Theorem: vl-*ary-syscall-p-of-vl-expr-fix-x

(defthm vl-*ary-syscall-p-of-vl-expr-fix-x
  (equal (vl-*ary-syscall-p name (vl-expr-fix x))
         (vl-*ary-syscall-p name x)))

Theorem: vl-*ary-syscall-p-vl-expr-equiv-congruence-on-x

(defthm vl-*ary-syscall-p-vl-expr-equiv-congruence-on-x
  (implies (vl-expr-equiv x x-equiv)
           (equal (vl-*ary-syscall-p name x)
                  (vl-*ary-syscall-p name x-equiv)))
  :rule-classes :congruence)

Subtopics

Vl-*ary-syscall->args
Access the argument to a vl-*ary-syscall-p, not including the function name.