• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
          • Trunc
          • Always-top
          • Gatesplit
          • Gate-elim
          • Expression-optimization
          • Elim-supplies
          • Wildelim
          • Drop-blankports
          • Clean-warnings
          • Addinstnames
          • Custom-transform-hooks
          • Annotate
          • Latchcode
            • Vl-latchcode-synth-always
            • Vl-match-latch-main
              • Vl-match-latchbody-form2
                • Vl-match-latchbody-form1
                • Vl-evatom-plain-p
                • Vl-match-latchbody
                • Vl-evatomlist-plain-p
              • Vl-careful-match-latch
              • Vl-careless-match-latch
              • Vl-latchcode-synth-alwayses
              • Vl-make-n-bit-latch-vec
              • Vl-make-n-bit-latch
            • 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
    • Vl-match-latch-main

    Vl-match-latchbody-form2

    Match if (test) lhs = [#delay] rhs.

    Signature
    (vl-match-latchbody-form2 x) → (mv test lhs rhs delay)
    Arguments
    x — Guard (vl-stmt-p x).
    Returns
    test — Type (equal (vl-expr-p test) (if test t nil)), given the guard.
    lhs — Type (and (equal (vl-expr-p lhs) (if test t nil)) (iff lhs test)), given the guard.
    rhs — Type (and (equal (vl-expr-p rhs) (if test t nil)) (iff rhs test)), given the guard.
    delay — maybe natp.

    Definitions and Theorems

    Function: vl-match-latchbody-form2

    (defun vl-match-latchbody-form2 (x)
     (declare (xargs :guard (vl-stmt-p x)))
     (let ((__function__ 'vl-match-latchbody-form2))
       (declare (ignorable __function__))
       (b*
        (((unless (vl-ifstmt-p x))
          (mv nil nil nil nil))
         ((vl-ifstmt x) x)
         ((unless (and (vl-nullstmt-p x.falsebranch)
                       (vl-assignstmt-p x.truebranch)))
          (mv nil nil nil nil))
         ((vl-assignstmt ass) x.truebranch)
         ((unless (or (eq ass.type :vl-blocking)
                      (eq ass.type :vl-nonblocking)))
          (mv nil nil nil nil))
         ((unless
               (or (not ass.ctrl)
                   (and (mbe :logic (vl-delaycontrol-p ass.ctrl)
                             :exec (eq (tag ass.ctrl) :vl-delaycontrol))
                        (vl-simpledelaycontrol-p ass.ctrl))))
          (mv nil nil nil nil))
         (ticks (and ass.ctrl
                     (vl-simpledelaycontrol->ticks ass.ctrl))))
        (mv x.condition
            ass.lvalue ass.expr ticks))))

    Theorem: return-type-of-vl-match-latchbody-form2.test

    (defthm return-type-of-vl-match-latchbody-form2.test
      (implies (and (force (vl-stmt-p x)))
               (b* (((mv ?test ?lhs ?rhs ?delay)
                     (vl-match-latchbody-form2 x)))
                 (equal (vl-expr-p test)
                        (if test t nil))))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-match-latchbody-form2.lhs

    (defthm return-type-of-vl-match-latchbody-form2.lhs
      (implies (and (force (vl-stmt-p x)))
               (b* (((mv ?test ?lhs ?rhs ?delay)
                     (vl-match-latchbody-form2 x)))
                 (and (equal (vl-expr-p lhs) (if test t nil))
                      (iff lhs test))))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-match-latchbody-form2.rhs

    (defthm return-type-of-vl-match-latchbody-form2.rhs
      (implies (and (force (vl-stmt-p x)))
               (b* (((mv ?test ?lhs ?rhs ?delay)
                     (vl-match-latchbody-form2 x)))
                 (and (equal (vl-expr-p rhs) (if test t nil))
                      (iff rhs test))))
      :rule-classes :rewrite)

    Theorem: maybe-natp-of-vl-match-latchbody-form2.ticks

    (defthm maybe-natp-of-vl-match-latchbody-form2.ticks
      (maybe-natp (mv-nth 3 (vl-match-latchbody-form2 x)))
      :rule-classes :type-prescription)