• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
            • Tree-terminatedp
            • Tree->string
            • String-has-finite-parse-trees-p
            • Parse-trees-of-string-p
            • Tree-match-element-p
            • Parse-treep
            • Symbol
            • String-unambiguousp
            • Tree-match-num-val-p
            • Nat-match-insensitive-char-p
            • Nats-match-insensitive-chars-p
            • Tree-option
            • String-parsablep
            • Lookup-rulename
            • Nats-match-sensitive-chars-p
            • Numrep-match-repeat-range-p
            • Tree-match-char-val-p
            • Tree-list-match-repetition-p
            • String-ambiguousp
            • Parse
            • Tree-match-prose-val-p
            • Nat-match-sensitive-char-p
            • Theorems-about-terminated-trees-matching-elements
            • Tree-option-result
            • Tree-list-result
            • Tree-list-list-result
            • Tree-result
            • Tree-list-list-match-concatenation-p
            • Languagep
            • Terminal-string-for-rules-p
            • Tree-list-list-match-alternation-p
            • Tree-list-match-element-p
            • Parse!
            • String
            • Tree-set
              • Tree-set-fix
              • Tree-setp
                • Tree-set-equiv
              • Trees
            • Abstract-syntax
            • Core-rules
            • Concrete-syntax
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Tree-set

    Tree-setp

    Recognizer for tree-set.

    Signature
    (tree-setp x) → *

    Definitions and Theorems

    Function: tree-setp

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

    Theorem: booleanp-oftree-setp

    (defthm booleanp-oftree-setp
      (booleanp (tree-setp x)))

    Theorem: setp-when-tree-setp

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

    Theorem: treep-of-head-when-tree-setp

    (defthm treep-of-head-when-tree-setp
      (implies (tree-setp x)
               (equal (treep (head x))
                      (not (emptyp x)))))

    Theorem: tree-setp-of-tail-when-tree-setp

    (defthm tree-setp-of-tail-when-tree-setp
      (implies (tree-setp x)
               (tree-setp (tail x))))

    Theorem: tree-setp-of-insert

    (defthm tree-setp-of-insert
      (equal (tree-setp (insert a x))
             (and (treep a) (tree-setp (sfix x)))))

    Theorem: treep-when-in-tree-setp-binds-free-x

    (defthm treep-when-in-tree-setp-binds-free-x
      (implies (and (in a x) (tree-setp x))
               (treep a)))

    Theorem: not-in-tree-setp-when-not-treep

    (defthm not-in-tree-setp-when-not-treep
      (implies (and (tree-setp x) (not (treep a)))
               (not (in a x))))

    Theorem: tree-setp-of-union

    (defthm tree-setp-of-union
      (equal (tree-setp (union x y))
             (and (tree-setp (sfix x))
                  (tree-setp (sfix y)))))

    Theorem: tree-setp-of-intersect

    (defthm tree-setp-of-intersect
      (implies (and (tree-setp x) (tree-setp y))
               (tree-setp (intersect x y))))

    Theorem: tree-setp-of-difference

    (defthm tree-setp-of-difference
      (implies (tree-setp x)
               (tree-setp (difference x y))))

    Theorem: tree-setp-of-delete

    (defthm tree-setp-of-delete
      (implies (tree-setp x)
               (tree-setp (delete a x))))