• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
        • Maybe-stringp
        • Maybe-natp
          • Maybe-natp-fix
          • Maybe-nat-equiv
          • Two-nats-measure
          • Impossible
          • Bytep
          • Nat-list-measure
          • Maybe-posp
          • Nibblep
          • Organize-symbols-by-pkg
          • Organize-symbols-by-name
          • Lnfix
          • Good-valuep
          • Streqv
          • Chareqv
          • Symbol-package-name-non-cl
          • Arith-equivs
          • Induction-schemes
          • Maybe-integerp
          • Char-fix
          • Pos-fix
          • Symbol-package-name-lst
          • Mbt$
          • Maybe-bitp
          • Good-pseudo-termp
          • Str-fix
          • Maybe-string-fix
          • Nonkeyword-listp
          • Lifix
          • Bfix
          • Std/basic/if*
          • Impliez
          • Tuplep
          • Std/basic/intern-in-package-of-symbol
          • Lbfix
          • Std/basic/symbol-name-lst
          • True
          • Std/basic/rfix
          • Std/basic/realfix
          • Std/basic/member-symbol-name
          • Std/basic/fix
          • False
          • Std/basic/nfix
          • Std/basic/ifix
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Fty::basetypes
    • Maybe-natp

    Maybe-nat-equiv

    (maybe-natp-equiv x y) is an equivalence relation for maybe-natps, i.e., equality up to maybe-natp-fix.

    Performance note. In the execution, this is just an inlined call of eql.

    Definitions and Theorems

    Function: maybe-nat-equiv$inline

    (defun maybe-nat-equiv$inline (x y)
      (declare (xargs :guard (and (maybe-natp x) (maybe-natp y))))
      (eql (maybe-natp-fix x)
           (maybe-natp-fix y)))

    Theorem: maybe-nat-equiv-is-an-equivalence

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

    Theorem: maybe-nat-equiv-implies-equal-maybe-natp-fix-1

    (defthm maybe-nat-equiv-implies-equal-maybe-natp-fix-1
      (implies (maybe-nat-equiv x x-equiv)
               (equal (maybe-natp-fix x)
                      (maybe-natp-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: maybe-natp-fix-under-maybe-nat-equiv

    (defthm maybe-natp-fix-under-maybe-nat-equiv
      (maybe-nat-equiv (maybe-natp-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))