• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
      • Arithmetic
      • Bit-vectors
        • Sparseint
        • Bitops
          • Bitops/merge
          • Bitops-compatibility
          • Bitops-books
          • Logbitp-reasoning
          • Bitops/signed-byte-p
          • Fast-part-select
          • Bitops/integer-length
          • Bitops/extra-defs
          • Install-bit
          • Trailing-0-count
          • Bitops/defaults
          • Logbitp-mismatch
          • Trailing-1-count
          • Bitops/rotate
          • Bitops/equal-by-logbitp
            • Open-logbitp-of-const-meta
            • Equal-by-logbitp
            • Equal-by-logbitp-hint
              • Equal-by-logbitp-hammer
            • Bitops/ash-bounds
            • Bitops/fast-logrev
            • Limited-shifts
            • Bitops/part-select
            • Bitops/parity
            • Bitops/saturate
            • Bitops/part-install
            • Bitops/logbitp-bounds
            • Bitops/ihsext-basics
            • Bitops/fast-rotate
            • Bitops/fast-logext
            • Bitops/ihs-extensions
          • Bv
          • Ihs
          • Rtl
        • Algebra
    • Bitops/equal-by-logbitp

    Equal-by-logbitp-hint

    Basic automation for equal-by-logbitp.

    The equal-by-logbitp-hint computed hint looks for goals of the form:

    (implies (and hyp1 hyp2 ...)
             (equal lhs rhs))

    And automatically generates an appropriate :functional-instance of the equal-by-logbitp theorem. A typical use of this hint might be:

    :hints(("Goal"
            :in-theory (enable foo bar))
           (and stable-under-simplificationp
                (equal-by-logbitp-hint)))

    Note that this hint is very aggressive. For instance, it doesn't try to determine whether lhs and rhs are numbers; it will try to use equal-by-logbitp anyway. Because of this, you would never want to add this to the default-hints.

    Definitions and Theorems

    Function: equal-by-logbitp-hint-fn

    (defun
     equal-by-logbitp-hint-fn (clause)
     (b*
      ((concl (car (last clause)))
       ((unless (and (consp concl)
                     (eq (car concl) 'equal)))
        nil)
       (lhs (cadr concl))
       (rhs (caddr concl))
       (hyp (cons 'and
                  (acl2::dumb-negate-lit-lst (butlast clause 1)))))
      (cons
       ':use
       (cons
        (cons
         (cons
          ':functional-instance
          (cons
           'equal-by-logbitp
           (cons
              (cons 'logbitp-hyp
                    (cons (cons 'lambda
                                (cons 'nil (cons hyp 'nil)))
                          'nil))
              (cons (cons 'logbitp-lhs
                          (cons (cons 'lambda
                                      (cons 'nil (cons lhs 'nil)))
                                'nil))
                    (cons (cons 'logbitp-rhs
                                (cons (cons 'lambda
                                            (cons 'nil (cons rhs 'nil)))
                                      'nil))
                          'nil)))))
         'nil)
        'nil))))