• 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->level

    Access the |AIGNET|::|LEVEL| field of a gatesimp bit structure.

    Signature
    (gatesimp->level x) → level
    Arguments
    x — Guard (gatesimp-p x).
    Returns
    level — Type (gatesimp-level-p level).

    Definitions and Theorems

    Function: gatesimp->level

    (defun gatesimp->level (x)
     (declare (xargs :guard (gatesimp-p x)))
     (mbe
         :logic
         (let ((x (gatesimp-fix x)))
           (part-select x :low 1 :width 3))
         :exec (the (unsigned-byte 3)
                    (logand (the (unsigned-byte 3) 7)
                            (the (unsigned-byte 5)
                                 (ash (the (unsigned-byte 6) x) -1))))))

    Theorem: gatesimp-level-p-of-gatesimp->level

    (defthm gatesimp-level-p-of-gatesimp->level
      (b* ((level (gatesimp->level x)))
        (gatesimp-level-p level))
      :rule-classes :rewrite)

    Theorem: gatesimp->level-of-gatesimp-fix-x

    (defthm gatesimp->level-of-gatesimp-fix-x
      (equal (gatesimp->level (gatesimp-fix x))
             (gatesimp->level x)))

    Theorem: gatesimp->level-gatesimp-equiv-congruence-on-x

    (defthm gatesimp->level-gatesimp-equiv-congruence-on-x
      (implies (gatesimp-equiv x x-equiv)
               (equal (gatesimp->level x)
                      (gatesimp->level x-equiv)))
      :rule-classes :congruence)

    Theorem: gatesimp->level-of-gatesimp

    (defthm gatesimp->level-of-gatesimp
      (equal (gatesimp->level (gatesimp hashp level xor-mode))
             (gatesimp-level-fix level)))

    Theorem: gatesimp->level-of-write-with-mask

    (defthm gatesimp->level-of-write-with-mask
     (implies
      (and
       (fty::bitstruct-read-over-write-hyps x gatesimp-equiv-under-mask)
       (gatesimp-equiv-under-mask x acl2::y fty::mask)
       (equal (logand (lognot fty::mask) 14)
              0))
      (equal (gatesimp->level x)
             (gatesimp->level acl2::y))))