• 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
          • Extract-vl-types
          • Hierarchy
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
          • Syscalls
            • Vl-syscall->returninfo
            • Vl-unary-syscall-p
              • Vl-typearg-syscall-p
              • Vl-0ary-syscall-p
              • Vl-*ary-syscall-p
              • Vl-$random-expr-p
              • Vl-simple-id-name
              • Vl-unary-syscall->arg
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Syscalls

    Vl-unary-syscall-p

    Recognize calls of a particular unary system function call.

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

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

    (vl-unary-syscall-p "$bits" x)

    Definitions and Theorems

    Function: vl-unary-syscall-p

    (defun vl-unary-syscall-p (name x)
      (declare (xargs :guard (and (stringp name) (vl-expr-p x))))
      (let ((__function__ 'vl-unary-syscall-p))
        (declare (ignorable __function__))
        (vl-expr-case x
                      :vl-call (and x.systemp
                                    (equal (vl-simple-id-name x.name)
                                           (string-fix name))
                                    (eql (len x.plainargs) 1)
                                    (car x.plainargs)
                                    (atom x.namedargs))
                      :otherwise nil)))

    Theorem: arity-stuff-about-vl-unary-syscall-p

    (defthm arity-stuff-about-vl-unary-syscall-p
      (implies
           (vl-unary-syscall-p name x)
           (vl-expr-case x
                         :vl-call (and x.systemp
                                       (equal (vl-simple-id-name x.name)
                                              (string-fix name))
                                       (eql (len x.plainargs) 1)
                                       (consp x.plainargs)
                                       (car x.plainargs)
                                       (atom x.namedargs))
                         :otherwise nil))
      :rule-classes :forward-chaining)

    Theorem: vl-unary-syscall-p-of-str-fix-name

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

    Theorem: vl-unary-syscall-p-streqv-congruence-on-name

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

    Theorem: vl-unary-syscall-p-of-vl-expr-fix-x

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

    Theorem: vl-unary-syscall-p-vl-expr-equiv-congruence-on-x

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