• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
      • Bdd
      • Faig
      • Bed
      • 4v
        • 4v-sexprs
        • 4v-monotonicity
        • 4v-operations
          • 4v-ite
          • 4v-res
          • 4v-not-list
          • 4v-unfloat
          • 4v-wand
          • 4v-wor
          • 4v-zif
          • 4v-tristate
          • 4v-xdet
            • 4v-xor
            • 4v-iff
            • 4v-and
            • 4v-or
            • 4v-not
            • 4v-pullup
            • 4v-and-list
            • 4v-ite*
          • Why-4v-logic
          • 4v-<=
          • 4vp
          • 4vcases
          • 4v-fix
          • 4v-lookup
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • 4v-operations

    4v-xdet

    X-detection or identity circuit.

    (4v-xdet a) returns the value specified by the following truth table:

      a  |  out
    -----+-------
      T  |   F
      F  |   F
      X  |   X
      Z  |   X
    -----+-------

    This is a special operation that does not correspond to any sort of hardware circuit, but that is useful for efficiently implementing the x-detection semantics of Verilog's vector arithmetic operations.

    Definitions and Theorems

    Function: 4v-xdet$inline

    (defun 4v-xdet$inline (a)
           (declare (xargs :guard t))
           (4vcases a (t (4vf))
                    (f (4vf))
                    (& (4vx))))

    Theorem: 4v-xdet-truth-table

    (defthm 4v-xdet-truth-table
            (and (equal (4v-xdet (4vt)) (4vf))
                 (equal (4v-xdet (4vf)) (4vf))
                 (equal (4v-xdet (4vx)) (4vx))
                 (equal (4v-xdet (4vz)) (4vx)))
            :rule-classes nil)

    Theorem: 4v-equiv-implies-equal-4v-xdet-1

    (defthm 4v-equiv-implies-equal-4v-xdet-1
            (implies (4v-equiv a a-equiv)
                     (equal (4v-xdet a) (4v-xdet a-equiv)))
            :rule-classes (:congruence))