• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
        • Isodata
        • Simplify-defun
        • Tailrec
        • Schemalg
        • Restrict
        • Expdata
          • Expdata-implementation
            • Expdata-event-generation
            • Expdata-fn
            • Expdata-input-processing
              • Expdata-symbol-surjmap-alistp
                • Expdata-surjmapp
                • Expdata-pos-surjmap-alistp
                • Expdata-process-surj
                • Expdata-process-arg/res-list-surj
                • Expdata-process-inputs
                • Expdata-process-surjmaps
                • Expdata-fresh-defsurj-thm-names
                • Expdata-process-arg/res-list
                • Expdata-process-arg/res-list-surj-list
                • Expdata-process-res
                • Expdata-process-newp-of-new-name
                • Expdata-fresh-defsurj-name-with-*s-suffix
                • Expdata-process-surjmaps-ress
                • Expdata-process-surjmaps-args
                • Expdata-process-arg/res-list-surj-add-args
                • Expdata-process-arg/res-list-surj-add-ress
                • Expdata-process-old
                • Expdata-process-arg/res-list-aux
                • Expdata-surjmap-listp
                • Expdata-fresh-defsurj-name-with-*s-suffix-aux
              • Expdata-macro-definition
          • Casesplit
          • Simplify-term
          • Simplify-defun-sk
          • Parteval
          • Solve
          • Wrap-output
          • Propagate-iso
          • Simplify
          • Finite-difference
          • Drop-irrelevant-params
          • Copy-function
          • Lift-iso
          • Rename-params
          • Utilities
          • Simplify-term-programmatic
          • Simplify-defun-sk-programmatic
          • Simplify-defun-programmatic
          • Simplify-defun+
          • Common-options
          • Common-concepts
        • Zfc
        • Acre
        • Milawa
        • Smtlink
        • Abnf
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • C
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Expdata-input-processing

    Expdata-symbol-surjmap-alistp

    Recognize alists from symbols to surjective mapping records.

    This is an ordinary std::defalist.

    Function: expdata-symbol-surjmap-alistp

    (defun expdata-symbol-surjmap-alistp (x)
      (declare (xargs :guard t))
      (if (consp x)
          (and (consp (car x))
               (symbolp (caar x))
               (expdata-surjmapp (cdar x))
               (expdata-symbol-surjmap-alistp (cdr x)))
        (null x)))

    Definitions and Theorems

    Function: expdata-symbol-surjmap-alistp

    (defun expdata-symbol-surjmap-alistp (x)
      (declare (xargs :guard t))
      (if (consp x)
          (and (consp (car x))
               (symbolp (caar x))
               (expdata-surjmapp (cdar x))
               (expdata-symbol-surjmap-alistp (cdr x)))
        (null x)))

    Theorem: expdata-symbol-surjmap-alistp-of-revappend

    (defthm expdata-symbol-surjmap-alistp-of-revappend
      (equal (expdata-symbol-surjmap-alistp (revappend acl2::x acl2::y))
             (and (expdata-symbol-surjmap-alistp (list-fix acl2::x))
                  (expdata-symbol-surjmap-alistp acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-remove

    (defthm expdata-symbol-surjmap-alistp-of-remove
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (expdata-symbol-surjmap-alistp (remove acl2::a acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-last

    (defthm expdata-symbol-surjmap-alistp-of-last
      (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
               (expdata-symbol-surjmap-alistp (last acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-nthcdr

    (defthm expdata-symbol-surjmap-alistp-of-nthcdr
      (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
               (expdata-symbol-surjmap-alistp (nthcdr acl2::n acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-butlast

    (defthm expdata-symbol-surjmap-alistp-of-butlast
     (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
              (expdata-symbol-surjmap-alistp (butlast acl2::x acl2::n)))
     :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-update-nth

    (defthm expdata-symbol-surjmap-alistp-of-update-nth
      (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
               (iff (expdata-symbol-surjmap-alistp
                         (update-nth acl2::n acl2::y acl2::x))
                    (and (and (consp acl2::y)
                              (symbolp (car acl2::y))
                              (expdata-surjmapp (cdr acl2::y)))
                         (or (<= (nfix acl2::n) (len acl2::x))
                             (and (consp nil)
                                  (symbolp (car nil))
                                  (expdata-surjmapp (cdr nil)))))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-repeat

    (defthm expdata-symbol-surjmap-alistp-of-repeat
      (iff (expdata-symbol-surjmap-alistp (repeat acl2::n acl2::x))
           (or (and (consp acl2::x)
                    (symbolp (car acl2::x))
                    (expdata-surjmapp (cdr acl2::x)))
               (zp acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-take

    (defthm expdata-symbol-surjmap-alistp-of-take
      (implies
           (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
           (iff (expdata-symbol-surjmap-alistp (take acl2::n acl2::x))
                (or (and (consp nil)
                         (symbolp (car nil))
                         (expdata-surjmapp (cdr nil)))
                    (<= (nfix acl2::n) (len acl2::x)))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-union-equal

    (defthm expdata-symbol-surjmap-alistp-of-union-equal
     (equal
         (expdata-symbol-surjmap-alistp (union-equal acl2::x acl2::y))
         (and (expdata-symbol-surjmap-alistp (list-fix acl2::x))
              (expdata-symbol-surjmap-alistp (double-rewrite acl2::y))))
     :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-intersection-equal-2

    (defthm expdata-symbol-surjmap-alistp-of-intersection-equal-2
      (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::y))
               (expdata-symbol-surjmap-alistp
                    (intersection-equal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-intersection-equal-1

    (defthm expdata-symbol-surjmap-alistp-of-intersection-equal-1
      (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
               (expdata-symbol-surjmap-alistp
                    (intersection-equal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-set-difference-equal

    (defthm expdata-symbol-surjmap-alistp-of-set-difference-equal
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (expdata-symbol-surjmap-alistp
                    (set-difference-equal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-when-subsetp-equal

    (defthm expdata-symbol-surjmap-alistp-when-subsetp-equal
      (and (implies (and (subsetp-equal acl2::x acl2::y)
                         (expdata-symbol-surjmap-alistp acl2::y))
                    (equal (expdata-symbol-surjmap-alistp acl2::x)
                           (true-listp acl2::x)))
           (implies (and (expdata-symbol-surjmap-alistp acl2::y)
                         (subsetp-equal acl2::x acl2::y))
                    (equal (expdata-symbol-surjmap-alistp acl2::x)
                           (true-listp acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-rcons

    (defthm expdata-symbol-surjmap-alistp-of-rcons
      (iff (expdata-symbol-surjmap-alistp (rcons acl2::a acl2::x))
           (and (and (consp acl2::a)
                     (symbolp (car acl2::a))
                     (expdata-surjmapp (cdr acl2::a)))
                (expdata-symbol-surjmap-alistp (list-fix acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-append

    (defthm expdata-symbol-surjmap-alistp-of-append
      (equal (expdata-symbol-surjmap-alistp (append acl2::a acl2::b))
             (and (expdata-symbol-surjmap-alistp (list-fix acl2::a))
                  (expdata-symbol-surjmap-alistp acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-rev

    (defthm expdata-symbol-surjmap-alistp-of-rev
      (equal (expdata-symbol-surjmap-alistp (rev acl2::x))
             (expdata-symbol-surjmap-alistp (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-duplicated-members

    (defthm expdata-symbol-surjmap-alistp-of-duplicated-members
      (implies
           (expdata-symbol-surjmap-alistp acl2::x)
           (expdata-symbol-surjmap-alistp (duplicated-members acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-difference

    (defthm expdata-symbol-surjmap-alistp-of-difference
      (implies
           (expdata-symbol-surjmap-alistp acl2::x)
           (expdata-symbol-surjmap-alistp (difference acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-intersect-2

    (defthm expdata-symbol-surjmap-alistp-of-intersect-2
      (implies
           (expdata-symbol-surjmap-alistp acl2::y)
           (expdata-symbol-surjmap-alistp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-intersect-1

    (defthm expdata-symbol-surjmap-alistp-of-intersect-1
      (implies
           (expdata-symbol-surjmap-alistp acl2::x)
           (expdata-symbol-surjmap-alistp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-union

    (defthm expdata-symbol-surjmap-alistp-of-union
      (iff (expdata-symbol-surjmap-alistp (union acl2::x acl2::y))
           (and (expdata-symbol-surjmap-alistp (sfix acl2::x))
                (expdata-symbol-surjmap-alistp (sfix acl2::y))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-mergesort

    (defthm expdata-symbol-surjmap-alistp-of-mergesort
      (iff (expdata-symbol-surjmap-alistp (mergesort acl2::x))
           (expdata-symbol-surjmap-alistp (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-delete

    (defthm expdata-symbol-surjmap-alistp-of-delete
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (expdata-symbol-surjmap-alistp (delete acl2::k acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-insert

    (defthm expdata-symbol-surjmap-alistp-of-insert
      (iff (expdata-symbol-surjmap-alistp (insert acl2::a acl2::x))
           (and (expdata-symbol-surjmap-alistp (sfix acl2::x))
                (and (consp acl2::a)
                     (symbolp (car acl2::a))
                     (expdata-surjmapp (cdr acl2::a)))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-sfix

    (defthm expdata-symbol-surjmap-alistp-of-sfix
      (iff (expdata-symbol-surjmap-alistp (sfix acl2::x))
           (or (expdata-symbol-surjmap-alistp acl2::x)
               (not (setp acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-list-fix

    (defthm expdata-symbol-surjmap-alistp-of-list-fix
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (expdata-symbol-surjmap-alistp (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-when-expdata-symbol-surjmap-alistp-compound-recognizer

    (defthm
      true-listp-when-expdata-symbol-surjmap-alistp-compound-recognizer
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (true-listp acl2::x))
      :rule-classes :compound-recognizer)

    Theorem: expdata-symbol-surjmap-alistp-when-not-consp

    (defthm expdata-symbol-surjmap-alistp-when-not-consp
      (implies (not (consp acl2::x))
               (equal (expdata-symbol-surjmap-alistp acl2::x)
                      (not acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-cdr-when-expdata-symbol-surjmap-alistp

    (defthm
     expdata-symbol-surjmap-alistp-of-cdr-when-expdata-symbol-surjmap-alistp
     (implies (expdata-symbol-surjmap-alistp (double-rewrite acl2::x))
              (expdata-symbol-surjmap-alistp (cdr acl2::x)))
     :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-cons

    (defthm expdata-symbol-surjmap-alistp-of-cons
      (equal (expdata-symbol-surjmap-alistp (cons acl2::a acl2::x))
             (and (and (consp acl2::a)
                       (symbolp (car acl2::a))
                       (expdata-surjmapp (cdr acl2::a)))
                  (expdata-symbol-surjmap-alistp acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-make-fal

    (defthm expdata-symbol-surjmap-alistp-of-make-fal
      (implies
           (and (expdata-symbol-surjmap-alistp acl2::x)
                (expdata-symbol-surjmap-alistp acl2::y))
           (expdata-symbol-surjmap-alistp (make-fal acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-surjmapp-of-cdr-when-member-equal-of-expdata-symbol-surjmap-alistp

    (defthm
     expdata-surjmapp-of-cdr-when-member-equal-of-expdata-symbol-surjmap-alistp
     (and (implies (and (expdata-symbol-surjmap-alistp acl2::x)
                        (member-equal acl2::a acl2::x))
                   (expdata-surjmapp (cdr acl2::a)))
          (implies (and (member-equal acl2::a acl2::x)
                        (expdata-symbol-surjmap-alistp acl2::x))
                   (expdata-surjmapp (cdr acl2::a))))
     :rule-classes ((:rewrite)))

    Theorem: symbolp-of-car-when-member-equal-of-expdata-symbol-surjmap-alistp

    (defthm
      symbolp-of-car-when-member-equal-of-expdata-symbol-surjmap-alistp
      (and (implies (and (expdata-symbol-surjmap-alistp acl2::x)
                         (member-equal acl2::a acl2::x))
                    (symbolp (car acl2::a)))
           (implies (and (member-equal acl2::a acl2::x)
                         (expdata-symbol-surjmap-alistp acl2::x))
                    (symbolp (car acl2::a))))
      :rule-classes ((:rewrite)))

    Theorem: consp-when-member-equal-of-expdata-symbol-surjmap-alistp

    (defthm consp-when-member-equal-of-expdata-symbol-surjmap-alistp
     (implies (and (expdata-symbol-surjmap-alistp acl2::x)
                   (member-equal acl2::a acl2::x))
              (consp acl2::a))
     :rule-classes
     ((:rewrite :backchain-limit-lst (0 0))
      (:rewrite
         :backchain-limit-lst (0 0)
         :corollary (implies (if (member-equal acl2::a acl2::x)
                                 (expdata-symbol-surjmap-alistp acl2::x)
                               'nil)
                             (consp acl2::a)))))

    Theorem: expdata-symbol-surjmap-alistp-of-remove-assoc

    (defthm expdata-symbol-surjmap-alistp-of-remove-assoc
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (expdata-symbol-surjmap-alistp
                    (remove-assoc-equal acl2::name acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-put-assoc

    (defthm expdata-symbol-surjmap-alistp-of-put-assoc
      (implies (and (expdata-symbol-surjmap-alistp acl2::x))
               (iff (expdata-symbol-surjmap-alistp
                         (put-assoc-equal acl2::name acl2::val acl2::x))
                    (and (symbolp acl2::name)
                         (expdata-surjmapp acl2::val))))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-fast-alist-clean

    (defthm expdata-symbol-surjmap-alistp-of-fast-alist-clean
      (implies
           (expdata-symbol-surjmap-alistp acl2::x)
           (expdata-symbol-surjmap-alistp (fast-alist-clean acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-hons-shrink-alist

    (defthm expdata-symbol-surjmap-alistp-of-hons-shrink-alist
      (implies (and (expdata-symbol-surjmap-alistp acl2::x)
                    (expdata-symbol-surjmap-alistp acl2::y))
               (expdata-symbol-surjmap-alistp
                    (hons-shrink-alist acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbol-surjmap-alistp-of-hons-acons

    (defthm expdata-symbol-surjmap-alistp-of-hons-acons
      (equal (expdata-symbol-surjmap-alistp
                  (hons-acons acl2::a acl2::n acl2::x))
             (and (symbolp acl2::a)
                  (expdata-surjmapp acl2::n)
                  (expdata-symbol-surjmap-alistp acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-surjmapp-of-cdr-of-hons-assoc-equal-when-expdata-symbol-surjmap-alistp

    (defthm
     expdata-surjmapp-of-cdr-of-hons-assoc-equal-when-expdata-symbol-surjmap-alistp
     (implies
        (expdata-symbol-surjmap-alistp acl2::x)
        (iff (expdata-surjmapp (cdr (hons-assoc-equal acl2::k acl2::x)))
             (hons-assoc-equal acl2::k acl2::x)))
     :rule-classes ((:rewrite)))

    Theorem: alistp-when-expdata-symbol-surjmap-alistp-rewrite

    (defthm alistp-when-expdata-symbol-surjmap-alistp-rewrite
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (alistp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: alistp-when-expdata-symbol-surjmap-alistp

    (defthm alistp-when-expdata-symbol-surjmap-alistp
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (alistp acl2::x))
      :rule-classes :tau-system)

    Theorem: expdata-surjmapp-of-cdar-when-expdata-symbol-surjmap-alistp

    (defthm expdata-surjmapp-of-cdar-when-expdata-symbol-surjmap-alistp
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (iff (expdata-surjmapp (cdar acl2::x))
                    (consp acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: symbolp-of-caar-when-expdata-symbol-surjmap-alistp

    (defthm symbolp-of-caar-when-expdata-symbol-surjmap-alistp
      (implies (expdata-symbol-surjmap-alistp acl2::x)
               (symbolp (caar acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: expdata-symbolp-of-key-of-symbol-surjmap-alist

    (defthm expdata-symbolp-of-key-of-symbol-surjmap-alist
      (implies (expdata-symbol-surjmap-alistp x)
               (symbolp (car (assoc-equal k x)))))

    Theorem: expdata-surjmapp-of-val-of-symbol-surjmap-alist

    (defthm expdata-surjmapp-of-val-of-symbol-surjmap-alist
      (implies (and (expdata-symbol-surjmap-alistp x)
                    (consp (assoc-equal k x)))
               (expdata-surjmapp (cdr (assoc-equal k x)))))