• 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
          • 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

    Pattern match simple kinds of latch statements.

    Signature
    (vl-match-latchbody 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

    (defun vl-match-latchbody (x)
      (declare (xargs :guard (vl-stmt-p x)))
      (let ((__function__ 'vl-match-latchbody))
        (declare (ignorable __function__))
        (b* (((mv test lhs rhs delay)
              (vl-match-latchbody-form1 x))
             ((when test) (mv test lhs rhs delay)))
          (vl-match-latchbody-form2 x))))

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

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

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

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

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

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

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

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