• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
        • Omaps
          • Defomap
          • Update
          • Mapp
          • Assoc
          • Update*
          • Size
          • Keys
          • From-lists
          • Update-induction-on-maps
          • Compatiblep
          • Tail
            • Head
            • Restrict
            • Submap
            • Map
            • Rlookup
            • Emptyp
            • Rlookup*
            • Lookup*
            • Delete*
            • Values
            • In*
            • Lookup
            • Delete
            • Mfix
            • Head-val
            • Head-key
            • Omap-induction2
            • Omap-order-rules
          • All-by-membership
          • Defset
          • In
          • Primitives
          • Subset
          • Mergesort
          • Intersect
          • Union
          • Pick-a-point-subset-strategy
          • Delete
          • Double-containment
          • Difference
          • Cardinality
          • Set
          • Intersectp
        • Std/io
        • Std/basic
        • 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
    • Omaps

    Tail

    Rest of a non-empty omap after removing its smallest pair.

    Signature
    (tail map) → map1
    Arguments
    map — Guard (mapp map).
    Returns
    map1 — Type (mapp map1).

    This is similar to set::tail for osets.

    Definitions and Theorems

    Function: tail

    (defun tail (map)
      (declare (xargs :guard (mapp map)))
      (declare (xargs :guard (not (emptyp map))))
      (let ((__function__ 'tail))
        (declare (ignorable __function__))
        (cdr (mfix map))))

    Theorem: mapp-of-tail

    (defthm mapp-of-tail
      (b* ((map1 (tail map))) (mapp map1))
      :rule-classes :rewrite)

    Theorem: tail-when-emptyp

    (defthm tail-when-emptyp
      (implies (emptyp map)
               (equal (tail map) nil))
      :rule-classes (:rewrite :type-prescription))

    Theorem: tail-count

    (defthm tail-count
      (implies (not (emptyp map))
               (< (acl2-count (tail map))
                  (acl2-count map)))
      :rule-classes (:rewrite :linear))

    Theorem: tail-count-built-in

    (defthm tail-count-built-in
      (implies (not (emptyp map))
               (o< (acl2-count (tail map))
                   (acl2-count map)))
      :rule-classes :built-in-clause)

    Theorem: head-tail-order

    (defthm head-tail-order
      (implies (not (emptyp (tail x)))
               (<< (mv-nth 0 (head x))
                   (mv-nth 0 (head (tail x))))))

    Theorem: head-tail-order-contrapositive

    (defthm head-tail-order-contrapositive
      (implies (not (<< (mv-nth 0 (head x))
                        (mv-nth 0 (head (tail x)))))
               (emptyp (tail x))))