• 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
            • Edgesynth
            • Stmtrewrite
            • Cblock
            • Vl-always-convert-regports
            • Vl-always-convert-regs
            • Stmttemps
            • Edgesplit
            • Vl-always-check-reg
            • Vl-convert-regs
            • Latchsynth
            • Vl-always-check-regs
            • Vl-match-always-at-some-edges
              • Unelse
              • Vl-always-convert-reg
              • Vl-design-always-backend
              • Vl-stmt-guts
              • Vl-always-convert-regport
              • Vl-always-scary-regs
              • Eliminitial
              • Ifmerge
              • Vl-edge-control-p
              • Elimalways
            • 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
    • Always-top

    Vl-match-always-at-some-edges

    Recognize and decompose edge-triggered statements.

    Signature
    (vl-match-always-at-some-edges x) → (mv body? ctrl? edges)
    Arguments
    x — Guard (vl-stmt-p x).
    Returns
    body? — Type (equal (vl-stmt-p body?) (if body? t nil)).
    ctrl? — Type (and (equal (vl-eventcontrol-p ctrl?) (if body? t nil)) (equal (vl-edge-control-p ctrl?) (if body? t nil))) .
    edges — Type (and (vl-evatomlist-p edges) (vl-evatomlist-all-have-edges-p edges) (equal (consp edges) (if body? t nil)) (iff edges body?)) .

    Definitions and Theorems

    Function: vl-match-always-at-some-edges

    (defun vl-match-always-at-some-edges (x)
      (declare (xargs :guard (vl-stmt-p x)))
      (let ((__function__ 'vl-match-always-at-some-edges))
        (declare (ignorable __function__))
        (b* (((unless (eq (vl-stmt-kind x) :vl-timingstmt))
              (mv nil nil nil))
             ((vl-timingstmt x) x)
             ((unless (vl-edge-control-p x.ctrl))
              (mv nil nil nil)))
          (mv x.body x.ctrl
              (vl-eventcontrol->atoms x.ctrl)))))

    Theorem: return-type-of-vl-match-always-at-some-edges.body?

    (defthm return-type-of-vl-match-always-at-some-edges.body?
      (b* (((mv ?body? ?ctrl? ?edges)
            (vl-match-always-at-some-edges x)))
        (equal (vl-stmt-p body?)
               (if body? t nil)))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-match-always-at-some-edges.ctrl?

    (defthm return-type-of-vl-match-always-at-some-edges.ctrl?
      (b* (((mv ?body? ?ctrl? ?edges)
            (vl-match-always-at-some-edges x)))
        (and (equal (vl-eventcontrol-p ctrl?)
                    (if body? t nil))
             (equal (vl-edge-control-p ctrl?)
                    (if body? t nil))))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-match-always-at-some-edges.edges

    (defthm return-type-of-vl-match-always-at-some-edges.edges
      (b* (((mv ?body? ?ctrl? ?edges)
            (vl-match-always-at-some-edges x)))
        (and (vl-evatomlist-p edges)
             (vl-evatomlist-all-have-edges-p edges)
             (equal (consp edges) (if body? t nil))
             (iff edges body?)))
      :rule-classes :rewrite)

    Theorem: vl-match-always-at-some-edges-of-vl-stmt-fix-x

    (defthm vl-match-always-at-some-edges-of-vl-stmt-fix-x
      (equal (vl-match-always-at-some-edges (vl-stmt-fix x))
             (vl-match-always-at-some-edges x)))

    Theorem: vl-match-always-at-some-edges-vl-stmt-equiv-congruence-on-x

    (defthm vl-match-always-at-some-edges-vl-stmt-equiv-congruence-on-x
      (implies (vl-stmt-equiv x x-equiv)
               (equal (vl-match-always-at-some-edges x)
                      (vl-match-always-at-some-edges x-equiv)))
      :rule-classes :congruence)