• 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
              • Vl-edgesynth-stmt-p
              • Vl-edgetable-p
              • Vl-always-edgesynth
              • Vl-edgesynth-merge-data-ifs
              • Vl-assignstmtlist->controls
              • Vl-assignstmtlist->lhses
              • Vl-assignstmtlist->rhses
              • Vl-edgesynth-flatten-data-ifs
              • Vl-edgesynth-pattern-match
              • Nedgeflop
              • Vl-edgesynth-make-data-inputs
              • Vl-edgesynth-make-clock-inputs
              • Vl-edgesynth-stmt-clklift
              • Vl-edgesynth-blockelim
              • Vl-alwayslist-edgesynth
              • Vl-edgesynth-create
              • Vl-edgesynth-classify-iftest
                • Vl-edgesynth-classify-iftest-aux
                • Vl-module-edgesynth
                • Vl-edgesynth-normalize-ifs
                • Vl-edgesynth-delays-okp
                • Vl-edgesynth-stmt-assigns
                • Vl-make-edgetable
                • Vl-edgesynth-sort-edges
                • Vl-modulelist-edgesynth
                • Vl-modulelist-edgesynth-aux
                • Vl-assignstmtlist-p
                • Vl-edgesynth-edgelist-p
                • Vl-assigncontrols-p
                • Vl-edgesynth-stmt-conditions
                • Vl-edgesynth-edge-p
                • Vl-design-edgesynth
                • Vl-edgesynth-get-delay
                • Vl-edgesynth-iftype-p
                • Edge-tables
              • 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
    • Vl-edgesynth-classify-iftest

    Vl-edgesynth-classify-iftest-aux

    Walk through a clock expression, eliminating double negations.

    Signature
    (vl-edgesynth-classify-iftest-aux condition) → (mv type guts)
    Arguments
    condition — An expression that mentions just one clock.
        Guard (vl-expr-p condition).
    Returns
    type — Either :clock, :nclock, or :error.
        Type (vl-edgesynth-iftype-p type).
    guts — Canonical version of this clock to use, with negations stripped from negated clocks.
        Type (vl-expr-p guts), given the guard.

    Definitions and Theorems

    Function: vl-edgesynth-classify-iftest-aux

    (defun vl-edgesynth-classify-iftest-aux (condition)
      (declare (xargs :guard (vl-expr-p condition)))
      (let ((__function__ 'vl-edgesynth-classify-iftest-aux))
        (declare (ignorable __function__))
        (b* (((when (vl-fast-atom-p condition))
              (if (and (vl-idexpr-p condition)
                       (eql (vl-expr->finalwidth condition) 1)
                       (vl-expr->finaltype condition))
                  (mv :clock condition)
                (mv :error condition)))
             (op (vl-nonatom->op condition))
             (args (vl-nonatom->args condition))
             ((when (or (eq op :vl-unary-bitor)
                        (and (eq op :vl-concat)
                             (eql (len args) 1))))
              (b* (((mv type guts)
                    (vl-edgesynth-classify-iftest-aux (first args))))
                (if (or (eq type :clock) (eq type :nclock))
                    (mv type guts)
                  (mv type condition))))
             ((when (member op
                            '(:vl-unary-lognot :vl-unary-bitnot)))
              (b* (((mv type exp)
                    (vl-edgesynth-classify-iftest-aux (first args)))
                   ((when (eq type :clock))
                    (mv :nclock exp))
                   ((when (eq type :nclock))
                    (mv :clock exp)))
                (mv :error condition))))
          (mv :error condition))))

    Theorem: vl-edgesynth-iftype-p-of-vl-edgesynth-classify-iftest-aux.type

    (defthm
         vl-edgesynth-iftype-p-of-vl-edgesynth-classify-iftest-aux.type
      (b* (((mv common-lisp::?type ?guts)
            (vl-edgesynth-classify-iftest-aux condition)))
        (vl-edgesynth-iftype-p type))
      :rule-classes :rewrite)

    Theorem: vl-expr-p-of-vl-edgesynth-classify-iftest-aux.guts

    (defthm vl-expr-p-of-vl-edgesynth-classify-iftest-aux.guts
      (implies (and (force (vl-expr-p condition)))
               (b* (((mv common-lisp::?type ?guts)
                     (vl-edgesynth-classify-iftest-aux condition)))
                 (vl-expr-p guts)))
      :rule-classes :rewrite)

    Theorem: vl-idexpr-p-of-vl-edgesynth-classify-iftest-aux

    (defthm vl-idexpr-p-of-vl-edgesynth-classify-iftest-aux
      (b* (((mv type guts)
            (vl-edgesynth-classify-iftest-aux condition)))
        (implies (or (equal type :clock)
                     (equal type :nclock))
                 (and (vl-idexpr-p guts)
                      (equal (vl-expr->finalwidth guts) 1)
                      (vl-expr->finaltype guts)))))

    Theorem: name-bound-for-vl-edgesynth-classify-iftest-aux

    (defthm name-bound-for-vl-edgesynth-classify-iftest-aux
      (b* (((mv type guts)
            (vl-edgesynth-classify-iftest-aux condition)))
        (implies (and (vl-expr-p condition)
                      (or (equal type :clock)
                          (equal type :nclock)))
                 (member (vl-idexpr->name guts)
                         (vl-expr-names condition)))))