• 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
          • Expression-sizing
          • Occform
          • Oprewrite
            • Vl-op-oprewrite
            • Vl-modulelist-oprewrite
            • Vl-expr-oprewrite
            • Vl-maybe-delayoreventcontrol-oprewrite
            • Vl-repeateventcontrol-oprewrite
            • Vl-plainarglist-oprewrite
            • Vl-namedarglist-oprewrite
            • Vl-gateinstlist-oprewrite
            • Vl-delayoreventcontrol-oprewrite
            • Vl-modinstlist-oprewrite
            • Vl-initiallist-oprewrite
            • Vl-replicate-constint-value
            • Vl-evatomlist-oprewrite
            • Vl-assignlist-oprewrite
            • Vl-arguments-oprewrite
            • Vl-alwayslist-oprewrite
            • Vl-eventcontrol-oprewrite
            • Vl-delaycontrol-oprewrite
            • Vl-plainarg-oprewrite
            • Vl-namedarg-oprewrite
            • Vl-modinst-oprewrite
            • Vl-maybe-expr-oprewrite
            • Vl-initial-oprewrite
            • Vl-gateinst-oprewrite
            • Vl-assign-oprewrite
            • Vl-goofymux-p
            • Vl-evatom-oprewrite
            • Vl-always-oprewrite
            • Vl-replicate-weirdint-bits
            • Vl-maybe-consolidate-multiconcat
            • Vl-qmark-p
              • Vl-goofymux-rewrite
              • Vl-module-oprewrite
              • Vl-design-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
            • 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
    • Oprewrite

    Vl-qmark-p

    Recognize a ? b : c and return the components, or return nils for each when it's not a ?: expression.

    Signature
    (vl-qmark-p x) → (mv a b c)
    Arguments
    x — Guard (vl-expr-p x).
    Returns
    a — Type (equal (vl-expr-p a) (if a t nil)).
    b — Type (equal (vl-expr-p b) (if a t nil)).
    c — Type (equal (vl-expr-p c) (if a t nil)).

    Definitions and Theorems

    Function: vl-qmark-p

    (defun vl-qmark-p (x)
      (declare (xargs :guard (vl-expr-p x)))
      (let ((__function__ 'vl-qmark-p))
        (declare (ignorable __function__))
        (b* (((when (vl-fast-atom-p x))
              (mv nil nil nil))
             ((unless (and (eq (vl-nonatom->op x) :vl-qmark)
                           (mbt (equal (len (vl-nonatom->args x)) 3))))
              (mv nil nil nil))
             ((list a b c) (vl-nonatom->args x)))
          (mv a b c))))

    Theorem: return-type-of-vl-qmark-p.a

    (defthm return-type-of-vl-qmark-p.a
      (b* (((mv ?a ?b ?c) (vl-qmark-p x)))
        (equal (vl-expr-p a) (if a t nil)))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-qmark-p.b

    (defthm return-type-of-vl-qmark-p.b
      (b* (((mv ?a ?b ?c) (vl-qmark-p x)))
        (equal (vl-expr-p b) (if a t nil)))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-qmark-p.c

    (defthm return-type-of-vl-qmark-p.c
      (b* (((mv ?a ?b ?c) (vl-qmark-p x)))
        (equal (vl-expr-p c) (if a t nil)))
      :rule-classes :rewrite)

    Theorem: vl-qmark-p-of-vl-expr-fix-x

    (defthm vl-qmark-p-of-vl-expr-fix-x
      (equal (vl-qmark-p (vl-expr-fix x))
             (vl-qmark-p x)))

    Theorem: vl-qmark-p-vl-expr-equiv-congruence-on-x

    (defthm vl-qmark-p-vl-expr-equiv-congruence-on-x
      (implies (vl-expr-equiv x x-equiv)
               (equal (vl-qmark-p x)
                      (vl-qmark-p x-equiv)))
      :rule-classes :congruence)