• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
        • Bagp
        • Bag
        • Tail
        • Head
        • Subbag
        • Intersect
        • Empty
        • Difference
        • Union
        • Insert
        • Bfix
          • Delete
          • Cardinality
          • Occs
          • In
        • Std/util
        • Std/strings
        • Std/io
        • Std/osets
        • Std/system
        • Std/basic
        • 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
    • Obags

    Bfix

    Fixing function for obags.

    Signature
    (bfix x) → fixed-x
    Arguments
    x — Guard (bagp x).
    Returns
    fixed-x — Type (bagp fixed-x).

    This is similar to sfix for osets.

    Definitions and Theorems

    Function: bfix

    (defun bfix (x)
           (declare (xargs :guard (bagp x)))
           (let ((__function__ 'bfix))
                (declare (ignorable __function__))
                (mbe :logic (if (bagp x) x nil)
                     :exec x)))

    Theorem: bagp-of-bfix

    (defthm bagp-of-bfix
            (b* ((fixed-x (bfix x))) (bagp fixed-x))
            :rule-classes :rewrite)

    Theorem: bfix-when-bagp

    (defthm bfix-when-bagp
            (implies (bagp x) (equal (bfix x) x)))