• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
        • Make-event
        • Defmacro
        • Untranslate-patterns
        • Tc
        • Trans*
        • Macro-aliases-table
        • Macro-args
        • Defabbrev
        • User-defined-functions-table
        • Trans
        • Untranslate-for-execution
        • Add-macro-fn
        • Check-vars-not-free
        • Safe-mode
        • Macro-libraries
          • B*
          • Defunc
          • Fty
            • Deftagsum
            • Defprod
            • Defflexsum
            • Defbitstruct
            • Deflist
            • Defalist
            • Defbyte
            • Deffixequiv
            • Defresult
            • Deffixtype
            • Defoption
            • Fty-discipline
            • Fold
            • Fty-extensions
              • Defbyte
              • Defresult
              • Fold
              • Defsubtype
              • Specific-types
              • Defset
              • Defflatsum
              • Deflist-of-len
              • Pos-list
              • Defbytelist
              • Defomap
              • Defbyte-standard-instances
              • Deffixtype-alias
              • Defbytelist-standard-instances
              • Defunit
              • Byte-list
              • Database
              • Byte
              • Pos-option
              • Nibble
              • Nat-option
              • String-option
              • Byte-list20
              • Byte-list32
              • Byte-list64
              • Pseudo-event-form
              • Natoption/natoptionlist
              • Nati
              • Character-list
              • Nat/natlist
              • Maybe-string
              • Nibble-list
              • Natoption/natoptionlist-result
              • Nat/natlist-result
              • Nat-option-list-result
              • Set
              • String-result
              • String-list-result
              • Nat-result
              • Nat-option-result
              • Nat-list-result
              • Maybe-string-result
              • Integer-result
              • Character-result
              • Character-list-result
              • Boolean-result
              • Map
              • Bag
              • Pos-set
                • Pos-sfix
                • Pos-setp
                  • Pos-set->=-pos
                  • Pos-set-max
                  • Pos-sequiv
                • Hex-digit-char-list
                • Dec-digit-char-list
                • Pseudo-event-form-list
                • Nat-option-list
                • Symbol-set
                • String-set
                • Nat-set
                • Oct-digit-char-list
                • Bin-digit-char-list
                • Bit-list
              • Defsubtype
              • Deftypes
              • Specific-types
              • Defset
              • Defflatsum
              • Deflist-of-len
              • Defbytelist
              • Defomap
              • Fty::basetypes
              • Defvisitors
              • Deffixtype-alias
              • Deffixequiv-sk
              • Defunit
              • Multicase
              • Deffixequiv-mutual
              • Fty::baselists
              • Def-enumcase
              • Defmap
            • Apt
            • Std/util
            • Defdata
            • Defrstobj
            • Seq
            • Match-tree
            • Defrstobj
            • With-supporters
            • Def-partial-measure
            • Template-subst
            • Soft
            • Defthm-domain
            • Event-macros
            • Def-universal-equiv
            • Def-saved-obligs
            • With-supporters-after
            • Definec
            • Sig
            • Outer-local
            • Data-structures
          • Trans1
          • Defmacro-untouchable
          • Set-duplicate-keys-action
          • Add-macro-alias
          • Magic-macroexpand
          • Defmacroq
          • Trans!
          • Remove-macro-fn
          • Remove-macro-alias
          • Add-binop
          • Untrans-table
          • Trans*-
          • Remove-binop
          • Tcp
          • Tca
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
        • B*
        • Defunc
        • Fty
          • Deftagsum
          • Defprod
          • Defflexsum
          • Defbitstruct
          • Deflist
          • Defalist
          • Defbyte
          • Deffixequiv
          • Defresult
          • Deffixtype
          • Defoption
          • Fty-discipline
          • Fold
          • Fty-extensions
            • Defbyte
            • Defresult
            • Fold
            • Defsubtype
            • Specific-types
            • Defset
            • Defflatsum
            • Deflist-of-len
            • Pos-list
            • Defbytelist
            • Defomap
            • Defbyte-standard-instances
            • Deffixtype-alias
            • Defbytelist-standard-instances
            • Defunit
            • Byte-list
            • Database
            • Byte
            • Pos-option
            • Nibble
            • Nat-option
            • String-option
            • Byte-list20
            • Byte-list32
            • Byte-list64
            • Pseudo-event-form
            • Natoption/natoptionlist
            • Nati
            • Character-list
            • Nat/natlist
            • Maybe-string
            • Nibble-list
            • Natoption/natoptionlist-result
            • Nat/natlist-result
            • Nat-option-list-result
            • Set
            • String-result
            • String-list-result
            • Nat-result
            • Nat-option-result
            • Nat-list-result
            • Maybe-string-result
            • Integer-result
            • Character-result
            • Character-list-result
            • Boolean-result
            • Map
            • Bag
            • Pos-set
              • Pos-sfix
              • Pos-setp
                • Pos-set->=-pos
                • Pos-set-max
                • Pos-sequiv
              • Hex-digit-char-list
              • Dec-digit-char-list
              • Pseudo-event-form-list
              • Nat-option-list
              • Symbol-set
              • String-set
              • Nat-set
              • Oct-digit-char-list
              • Bin-digit-char-list
              • Bit-list
            • Defsubtype
            • Deftypes
            • Specific-types
            • Defset
            • Defflatsum
            • Deflist-of-len
            • Defbytelist
            • Defomap
            • Fty::basetypes
            • Defvisitors
            • Deffixtype-alias
            • Deffixequiv-sk
            • Defunit
            • Multicase
            • Deffixequiv-mutual
            • Fty::baselists
            • Def-enumcase
            • Defmap
          • Apt
          • Std/util
          • Defdata
          • Defrstobj
          • Seq
          • Match-tree
          • Defrstobj
          • With-supporters
          • Def-partial-measure
          • Template-subst
          • Soft
          • Defthm-domain
          • Event-macros
          • Def-universal-equiv
          • Def-saved-obligs
          • With-supporters-after
          • Definec
          • Sig
          • Outer-local
          • Data-structures
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Pos-set

      Pos-setp

      Recognizer for pos-set.

      Signature
      (pos-setp x) → *

      Definitions and Theorems

      Function: pos-setp

      (defun pos-setp (x)
        (declare (xargs :guard t))
        (if (atom x)
            (null x)
          (and (posp (car x))
               (or (null (cdr x))
                   (and (consp (cdr x))
                        (fast-<< (car x) (cadr x))
                        (pos-setp (cdr x)))))))

      Theorem: booleanp-ofpos-setp

      (defthm booleanp-ofpos-setp
        (booleanp (pos-setp x)))

      Theorem: setp-when-pos-setp

      (defthm setp-when-pos-setp
        (implies (pos-setp x) (set::setp x))
        :rule-classes (:rewrite))

      Theorem: posp-of-head-when-pos-setp

      (defthm posp-of-head-when-pos-setp
        (implies (pos-setp x)
                 (equal (posp (set::head x))
                        (not (set::emptyp x)))))

      Theorem: pos-setp-of-tail-when-pos-setp

      (defthm pos-setp-of-tail-when-pos-setp
        (implies (pos-setp x)
                 (pos-setp (set::tail x))))

      Theorem: pos-setp-of-insert

      (defthm pos-setp-of-insert
        (equal (pos-setp (set::insert a x))
               (and (posp a)
                    (pos-setp (set::sfix x)))))

      Theorem: posp-when-in-pos-setp-binds-free-x

      (defthm posp-when-in-pos-setp-binds-free-x
        (implies (and (set::in a x) (pos-setp x))
                 (posp a)))

      Theorem: not-in-pos-setp-when-not-posp

      (defthm not-in-pos-setp-when-not-posp
        (implies (and (pos-setp x) (not (posp a)))
                 (not (set::in a x))))

      Theorem: pos-setp-of-union

      (defthm pos-setp-of-union
        (equal (pos-setp (set::union x y))
               (and (pos-setp (set::sfix x))
                    (pos-setp (set::sfix y)))))

      Theorem: pos-setp-of-intersect

      (defthm pos-setp-of-intersect
        (implies (and (pos-setp x) (pos-setp y))
                 (pos-setp (set::intersect x y))))

      Theorem: pos-setp-of-difference

      (defthm pos-setp-of-difference
        (implies (pos-setp x)
                 (pos-setp (set::difference x y))))

      Theorem: pos-setp-of-delete

      (defthm pos-setp-of-delete
        (implies (pos-setp x)
                 (pos-setp (set::delete a x))))