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