• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
        • Fgl-function-mode
        • Fgl-object
        • Fgl-solving
        • Fgl-handling-if-then-elses
        • Fgl-getting-bits-from-objects
        • Fgl-primitive-and-meta-rules
        • Fgl-counterexamples
        • Fgl-interpreter-overview
        • Fgl-correctness-of-binding-free-variables
        • Fgl-debugging
        • Fgl-testbenches
        • Def-fgl-boolean-constraint
        • Fgl-stack
        • Fgl-rewrite-tracing
        • Def-fgl-param-thm
        • Def-fgl-thm
        • Fgl-fast-alist-support
        • Fgl-array-support
        • Advanced-equivalence-checking-with-fgl
        • Fgl-fty-support
        • Fgl-internals
          • Symbolic-arithmetic
          • Bfr
            • Bfr-eval
            • Bfrstate
              • Bfrstate-fix
                • Bfrstate-p
                • Bfrstate->mode
                • Bfrstate->bound
              • Bfr->aignet-lit
              • Bfr-p
              • Bounded-lit-fix
              • Bfr-list-fix
              • Aignet-lit->bfr
              • Variable-g-bindings
              • Bfr-listp$
              • Bfrstate>=
              • Bfr-listp-witness
              • Fgl-object-bindings-bfrlist
              • Bfr-set-var
              • Bfr-negate
              • Bfr-fix
              • Fgl-bfr-object-bindings-p
              • Bfr-mode
              • Bfr-mode-is
              • Lbfr-case
              • Bfrstate-case
              • Bfrstate-mode-is
              • Lbfr-mode-is
              • Bfr-mode-p
            • Fgl-interpreter-state
        • Removable-runes
        • Efficiency
        • Rewrite-bounds
        • Bash
        • Def-dag-measure
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bfrstate

    Bfrstate-fix

    Fixing function for bfrstate objects.

    Signature
    (bfrstate-fix x) → new-x
    Arguments
    x — Guard (bfrstate-p x).
    Returns
    new-x — Type (bfrstate-p new-x).

    Definitions and Theorems

    Function: bfrstate-fix$inline

    (defun bfrstate-fix$inline (x)
      (declare (xargs :guard (bfrstate-p x)))
      (let ((__function__ 'bfrstate-fix))
        (declare (ignorable __function__))
        (mbe :logic (logior (logand -4 (nfix x))
                            (bfr-mode-fix (logand 3 (nfix x))))
             :exec x)))

    Theorem: bfrstate-p-of-bfrstate-fix

    (defthm bfrstate-p-of-bfrstate-fix
      (b* ((new-x (bfrstate-fix$inline x)))
        (bfrstate-p new-x))
      :rule-classes :rewrite)

    Theorem: bfrstate-fix-when-bfrstate-p

    (defthm bfrstate-fix-when-bfrstate-p
      (implies (bfrstate-p x)
               (equal (bfrstate-fix x) x)))

    Function: bfrstate-equiv$inline

    (defun bfrstate-equiv$inline (x y)
      (declare (xargs :guard (and (bfrstate-p x) (bfrstate-p y))))
      (equal (bfrstate-fix x)
             (bfrstate-fix y)))

    Theorem: bfrstate-equiv-is-an-equivalence

    (defthm bfrstate-equiv-is-an-equivalence
      (and (booleanp (bfrstate-equiv x y))
           (bfrstate-equiv x x)
           (implies (bfrstate-equiv x y)
                    (bfrstate-equiv y x))
           (implies (and (bfrstate-equiv x y)
                         (bfrstate-equiv y z))
                    (bfrstate-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: bfrstate-equiv-implies-equal-bfrstate-fix-1

    (defthm bfrstate-equiv-implies-equal-bfrstate-fix-1
      (implies (bfrstate-equiv x x-equiv)
               (equal (bfrstate-fix x)
                      (bfrstate-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: bfrstate-fix-under-bfrstate-equiv

    (defthm bfrstate-fix-under-bfrstate-equiv
      (bfrstate-equiv (bfrstate-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-bfrstate-fix-1-forward-to-bfrstate-equiv

    (defthm equal-of-bfrstate-fix-1-forward-to-bfrstate-equiv
      (implies (equal (bfrstate-fix x) y)
               (bfrstate-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-bfrstate-fix-2-forward-to-bfrstate-equiv

    (defthm equal-of-bfrstate-fix-2-forward-to-bfrstate-equiv
      (implies (equal x (bfrstate-fix y))
               (bfrstate-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: bfrstate-equiv-of-bfrstate-fix-1-forward

    (defthm bfrstate-equiv-of-bfrstate-fix-1-forward
      (implies (bfrstate-equiv (bfrstate-fix x) y)
               (bfrstate-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: bfrstate-equiv-of-bfrstate-fix-2-forward

    (defthm bfrstate-equiv-of-bfrstate-fix-2-forward
      (implies (bfrstate-equiv x (bfrstate-fix y))
               (bfrstate-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: bfrstate-fix$inline-of-bfrstate-fix-x

    (defthm bfrstate-fix$inline-of-bfrstate-fix-x
      (equal (bfrstate-fix$inline (bfrstate-fix x))
             (bfrstate-fix$inline x)))

    Theorem: bfrstate-fix$inline-bfrstate-equiv-congruence-on-x

    (defthm bfrstate-fix$inline-bfrstate-equiv-congruence-on-x
      (implies (bfrstate-equiv x x-equiv)
               (equal (bfrstate-fix$inline x)
                      (bfrstate-fix$inline x-equiv)))
      :rule-classes :congruence)