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

Maybe-posp

Recognizer for positive naturals and nil.

This is like an option type; when x satisfies maybe-posp, then either it is a positive, natural number or nothing.

Definitions and Theorems

Function: maybe-posp$inline

(defun maybe-posp$inline (x)
       (declare (xargs :guard t))
       (or (not x) (posp x)))

Theorem: maybe-posp-compound-recognizer

(defthm maybe-posp-compound-recognizer
        (equal (maybe-posp x)
               (or (and (integerp x) (< 0 x)) (not x)))
        :rule-classes :compound-recognizer)

Subtopics

Maybe-posp-fix
(maybe-posp-fix x) is the identity for maybe-posps, or coerces any non-posp to nil.
Maybe-pos-equiv
(maybe-posp-equiv x y) is an equivalence relation for maybe-posps, i.e., equality up to maybe-posp-fix.