• 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
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
            • Vl-plainarglist-simp
            • Vl-modinstlist-simp
            • Vl-modulelist-simp
            • Vl-assignlist-simp
            • Vl-expr-simp-unary-bitnot
            • Vl-expr-simp-binary-bitor
              • Vl-expr-simp-binary-bitand
              • Vl-expr-simp-qmark
              • Vl-modinst-simp
              • Vl-plainarg-simp
              • Vl-module-simp
              • Vl-design-simp
              • Vl-assign-simp
              • Vl-expr-simp
            • Trunc
            • Always-top
            • Gatesplit
            • Gate-elim
            • Expression-optimization
            • Elim-supplies
            • Wildelim
            • Drop-blankports
            • Clean-warnings
            • Addinstnames
            • Custom-transform-hooks
            • Annotate
            • Latchcode
            • Elim-unused-vars
            • Problem-modules
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Expr-simp

    Vl-expr-simp-binary-bitor

    Signature
    (vl-expr-simp-binary-bitor x args) → new-x
    Arguments
    x — Expression to rewrite, of the form FOO | BAR.
        Guard (vl-expr-p x).
    args — Its already-rewritten args.
        Guard (vl-exprlist-p args).
    Returns
    new-x — Type (vl-expr-p new-x).

    Definitions and Theorems

    Function: vl-expr-simp-binary-bitor

    (defun vl-expr-simp-binary-bitor (x args)
      (declare (xargs :guard (and (vl-expr-p x)
                                  (vl-exprlist-p args))))
      (declare (xargs :guard (and (not (vl-atom-p x))
                                  (equal (vl-nonatom->op x)
                                         :vl-binary-bitor)
                                  (equal (len args) 2))))
      (let ((__function__ 'vl-expr-simp-binary-bitor))
        (declare (ignorable __function__))
        (b* (((list arg1 arg2) args)
             ((when (and (vl-expr-resolved-p arg2)
                         (eql (vl-resolved->val arg2) 0)
                         (equal (vl-expr->finalwidth x)
                                (vl-expr->finalwidth arg1))
                         (equal (vl-expr->finaltype x)
                                (vl-expr->finaltype arg1))))
              (b* ((ans (vl-expr-fix arg1)))
                (vl-cw-ps-seq (vl-cw "ORa0 rewrite ~a0 to ~a1~%" x ans))
                ans))
             ((when (and (vl-expr-resolved-p arg1)
                         (eql (vl-resolved->val arg1) 0)
                         (equal (vl-expr->finalwidth x)
                                (vl-expr->finalwidth arg2))
                         (equal (vl-expr->finaltype x)
                                (vl-expr->finaltype arg2))))
              (b* ((ans (vl-expr-fix arg2)))
                (vl-cw-ps-seq (vl-cw "OR0a rewrite ~a0 to ~a1~%" x ans))
                ans))
             ((when (and (vl-expr-resolved-p arg2)
                         (eql (vl-resolved->val arg2) 1)
                         (equal (vl-expr->finalwidth x) 1)
                         (equal (vl-expr->finalwidth arg1) 1)
                         (equal (vl-expr->finalwidth arg2) 1)
                         (eq (vl-expr->finaltype x) :vl-unsigned)
                         (eq (vl-expr->finaltype arg1)
                             :vl-unsigned)
                         (eq (vl-expr->finaltype arg2)
                             :vl-unsigned)))
              (b* ((ans (vl-expr-fix arg2)))
                (vl-cw-ps-seq (vl-cw "ORa1 rewrite ~a0 to ~a1~%" x ans))
                ans))
             ((when (and (vl-expr-resolved-p arg1)
                         (eql (vl-resolved->val arg1) 1)
                         (equal (vl-expr->finalwidth x) 1)
                         (equal (vl-expr->finalwidth arg1) 1)
                         (equal (vl-expr->finalwidth arg2) 1)
                         (eq (vl-expr->finaltype x) :vl-unsigned)
                         (eq (vl-expr->finaltype arg1)
                             :vl-unsigned)
                         (eq (vl-expr->finaltype arg2)
                             :vl-unsigned)))
              (b* ((ans (vl-expr-fix arg1)))
                (vl-cw-ps-seq (vl-cw "OR1a rewrite ~a0 to ~a1~%" x ans))
                ans)))
          (change-vl-nonatom x :args args))))

    Theorem: vl-expr-p-of-vl-expr-simp-binary-bitor

    (defthm vl-expr-p-of-vl-expr-simp-binary-bitor
      (b* ((new-x (vl-expr-simp-binary-bitor x args)))
        (vl-expr-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-expr-simp-binary-bitor-of-vl-expr-fix-x

    (defthm vl-expr-simp-binary-bitor-of-vl-expr-fix-x
      (equal (vl-expr-simp-binary-bitor (vl-expr-fix x)
                                        args)
             (vl-expr-simp-binary-bitor x args)))

    Theorem: vl-expr-simp-binary-bitor-vl-expr-equiv-congruence-on-x

    (defthm vl-expr-simp-binary-bitor-vl-expr-equiv-congruence-on-x
      (implies (vl-expr-equiv x x-equiv)
               (equal (vl-expr-simp-binary-bitor x args)
                      (vl-expr-simp-binary-bitor x-equiv args)))
      :rule-classes :congruence)

    Theorem: vl-expr-simp-binary-bitor-of-vl-exprlist-fix-args

    (defthm vl-expr-simp-binary-bitor-of-vl-exprlist-fix-args
      (equal (vl-expr-simp-binary-bitor x (vl-exprlist-fix args))
             (vl-expr-simp-binary-bitor x args)))

    Theorem: vl-expr-simp-binary-bitor-vl-exprlist-equiv-congruence-on-args

    (defthm
         vl-expr-simp-binary-bitor-vl-exprlist-equiv-congruence-on-args
      (implies (vl-exprlist-equiv args args-equiv)
               (equal (vl-expr-simp-binary-bitor x args)
                      (vl-expr-simp-binary-bitor x args-equiv)))
      :rule-classes :congruence)