• 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
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
            • Vl-consteval-$bits
            • Vl-consteval-shiftop
            • Vl-consteval-concat
            • Vl-consteval-ans
            • Vl-consteval-unary-reduxop
            • Vl-consteval-binop
            • Vl-consteval-cmpop
            • Vl-consteval-usertype-bits
            • Vl-consteval-binlogic
            • Vl-clog2
            • Vl-consteval-basictype-bits
            • Vl-consteval-wideunary
              • Vl-consteval-main
              • *vl-fake-elem-for-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
            • 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
    • Vl-consteval

    Vl-consteval-wideunary

    Signature
    (vl-consteval-wideunary op aval) → ans
    Arguments
    op — Guard (member op '(:vl-unary-plus :vl-unary-minus :vl-unary-bitnot)).
    aval — Guard (natp aval).
    Returns
    ans — Type (integerp ans).

    Definitions and Theorems

    Function: vl-consteval-wideunary

    (defun vl-consteval-wideunary (op aval)
     (declare
      (xargs
        :guard
        (and (member op
                     '(:vl-unary-plus :vl-unary-minus :vl-unary-bitnot))
             (natp aval))))
     (let ((__function__ 'vl-consteval-wideunary))
       (declare (ignorable __function__))
       (b* ((aval (lnfix aval)))
         (case op (:vl-unary-plus aval)
               (:vl-unary-minus (- aval))
               (:vl-unary-bitnot (lognot aval))
               (otherwise (progn$ (impossible) 0))))))

    Theorem: integerp-of-vl-consteval-wideunary

    (defthm integerp-of-vl-consteval-wideunary
      (b* ((ans (vl-consteval-wideunary op aval)))
        (integerp ans))
      :rule-classes :type-prescription)

    Theorem: vl-consteval-wideunary-of-nfix-aval

    (defthm vl-consteval-wideunary-of-nfix-aval
      (equal (vl-consteval-wideunary op (nfix aval))
             (vl-consteval-wideunary op aval)))

    Theorem: vl-consteval-wideunary-nat-equiv-congruence-on-aval

    (defthm vl-consteval-wideunary-nat-equiv-congruence-on-aval
      (implies (acl2::nat-equiv aval aval-equiv)
               (equal (vl-consteval-wideunary op aval)
                      (vl-consteval-wideunary op aval-equiv)))
      :rule-classes :congruence)