• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
        • Base-api
        • Aignet-construction
          • Gatesimp
            • Gatesimp-p
            • !gatesimp->xor-mode
            • !gatesimp->level
            • !gatesimp->hashp
            • Gatesimp-fix
              • Gatesimp->xor-mode
              • Gatesimp->level
              • Gatesimp->hashp
            • Aignet-hash-mux
            • Aignet-hash-xor
            • Aignet-hash-and
            • Aignet-hash-or
            • Aignet-hash-iff
            • Aignet-build
            • Patbind-aignet-build
          • Representation
          • Aignet-copy-init
          • Aignet-simplify-with-tracking
          • Aignet-simplify-marked-with-tracking
          • Aignet-cnf
          • Aignet-simplify-marked
          • Aignet-complete-copy
          • Aignet-transforms
          • Aignet-eval
          • Semantics
          • Aignet-read-aiger
          • Aignet-write-aiger
          • Aignet-abc-interface
          • Utilities
        • Aig
        • Satlink
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Gatesimp

    Gatesimp-fix

    Fixing function for gatesimp bit structures.

    Signature
    (gatesimp-fix x) → fty::fixed
    Arguments
    x — Guard (gatesimp-p x).
    Returns
    fty::fixed — Type (gatesimp-p fty::fixed).

    Definitions and Theorems

    Function: gatesimp-fix

    (defun gatesimp-fix (x)
     (declare (xargs :guard (gatesimp-p x)))
     (let ((__function__ 'gatesimp-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (loghead
        6
        (logapp
         1 (part-select x :width 1 :low 0)
         (logapp
              3
              (gatesimp-level-fix (part-select x :width 3 :low 1))
              (gatesimp-xor-mode-fix (part-select x :width 2 :low 4)))))
       :exec x)))

    Theorem: gatesimp-p-of-gatesimp-fix

    (defthm gatesimp-p-of-gatesimp-fix
      (b* ((fty::fixed (gatesimp-fix x)))
        (gatesimp-p fty::fixed))
      :rule-classes :rewrite)

    Theorem: gatesimp-fix-when-gatesimp-p

    (defthm gatesimp-fix-when-gatesimp-p
      (implies (gatesimp-p x)
               (equal (gatesimp-fix x) x)))

    Function: gatesimp-equiv$inline

    (defun gatesimp-equiv$inline (x acl2::y)
      (declare (xargs :guard (and (gatesimp-p x)
                                  (gatesimp-p acl2::y))))
      (equal (gatesimp-fix x)
             (gatesimp-fix acl2::y)))

    Theorem: gatesimp-equiv-is-an-equivalence

    (defthm gatesimp-equiv-is-an-equivalence
      (and (booleanp (gatesimp-equiv x y))
           (gatesimp-equiv x x)
           (implies (gatesimp-equiv x y)
                    (gatesimp-equiv y x))
           (implies (and (gatesimp-equiv x y)
                         (gatesimp-equiv y z))
                    (gatesimp-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: gatesimp-equiv-implies-equal-gatesimp-fix-1

    (defthm gatesimp-equiv-implies-equal-gatesimp-fix-1
      (implies (gatesimp-equiv x x-equiv)
               (equal (gatesimp-fix x)
                      (gatesimp-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: gatesimp-fix-under-gatesimp-equiv

    (defthm gatesimp-fix-under-gatesimp-equiv
      (gatesimp-equiv (gatesimp-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))