• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
          • Binder-functions
          • Fgl-syntactic-checker-binders
          • Fancy-ev
          • Backtraces
            • Interp-st-stack-backtrace-top
            • Backtrace
              • Backtrace-fix
                • Backtrace-frame
                • Backtrace-spec
                • Backtrace-equiv
                • Backtrace-p
                • Backtrace-frame-to-obj
                • Backtrace-speclist
              • Interp-st-stack-backtrace
              • Interp-st-stack-full-backtrace
              • Function-rules-to-backtrace-spec
              • Backtrace-to-obj
            • Binder
            • Annotate
            • Binder-rules
            • Def-fgl-program
            • Bind-var
            • Abort-current-rewrite
            • Add-fgl-brewrites
            • Def-fgl-rewrite
            • Narrow-equiv
            • Trigger-constraints
            • Def-fgl-branch-merge
            • Add-fgl-rewrites
            • Syntax-bind
            • Fgl-interp-obj
            • Fgl-hide
            • Collect-cmr-rewrites-for-formula-name
            • Fgl-time
            • Fgl-prog2
            • Assume
            • Add-fgl-binder-meta
            • Add-fgl-primitive
            • Add-fgl-meta
            • Add-fgl-branch-merges
            • Syntax-interp
            • Cmr::rewritelist->lhses
            • Remove-fgl-brewrites
            • Remove-fgl-branch-merges
            • Lhses->branch-function-syms
            • Enable-execution
            • Abort-rewrite
            • Remove-fgl-rewrites
            • Lhses->leading-function-syms
            • Remove-fgl-primitive
            • Remove-fgl-binder-meta
            • If!
            • Disable-execution
            • Remove-fgl-meta
            • Fgl-time-fn
            • Disable-definition
            • Def-fgl-brewrite
          • Fgl-function-mode
          • Fgl-object
          • Fgl-solving
          • Fgl-handling-if-then-elses
          • Fgl-counterexamples
          • Fgl-getting-bits-from-objects
          • Fgl-primitive-and-meta-rules
          • Fgl-interpreter-overview
          • Fgl-correctness-of-binding-free-variables
          • Fgl-debugging
          • Fgl-testbenches
          • Def-fgl-boolean-constraint
          • Fgl-stack
          • Def-fgl-param-thm
          • Fgl-rewrite-tracing
          • Def-fgl-thm
          • Fgl-fast-alist-support
          • Fgl-array-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-fty-support
          • Fgl-internals
        • 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
    • Backtrace

    Backtrace-fix

    (backtrace-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (backtrace-fix x) → fty::newx
    Arguments
    x — Guard (backtrace-p x).
    Returns
    fty::newx — Type (backtrace-p fty::newx).

    In the logic, we apply backtrace-frame-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: backtrace-fix$inline

    (defun backtrace-fix$inline (x)
      (declare (xargs :guard (backtrace-p x)))
      (let ((__function__ 'backtrace-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (backtrace-frame-fix (car x))
                     (backtrace-fix (cdr x))))
             :exec x)))

    Theorem: backtrace-p-of-backtrace-fix

    (defthm backtrace-p-of-backtrace-fix
      (b* ((fty::newx (backtrace-fix$inline x)))
        (backtrace-p fty::newx))
      :rule-classes :rewrite)

    Theorem: backtrace-fix-when-backtrace-p

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

    Function: backtrace-equiv$inline

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

    Theorem: backtrace-equiv-is-an-equivalence

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

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

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

    Theorem: backtrace-fix-under-backtrace-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-backtrace-fix-x-under-backtrace-frame-equiv

    (defthm car-of-backtrace-fix-x-under-backtrace-frame-equiv
      (backtrace-frame-equiv (car (backtrace-fix x))
                             (car x)))

    Theorem: car-backtrace-equiv-congruence-on-x-under-backtrace-frame-equiv

    (defthm
        car-backtrace-equiv-congruence-on-x-under-backtrace-frame-equiv
      (implies (backtrace-equiv x x-equiv)
               (backtrace-frame-equiv (car x)
                                      (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-backtrace-fix-x-under-backtrace-equiv

    (defthm cdr-of-backtrace-fix-x-under-backtrace-equiv
      (backtrace-equiv (cdr (backtrace-fix x))
                       (cdr x)))

    Theorem: cdr-backtrace-equiv-congruence-on-x-under-backtrace-equiv

    (defthm cdr-backtrace-equiv-congruence-on-x-under-backtrace-equiv
      (implies (backtrace-equiv x x-equiv)
               (backtrace-equiv (cdr x) (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-backtrace-frame-fix-x-under-backtrace-equiv

    (defthm cons-of-backtrace-frame-fix-x-under-backtrace-equiv
      (backtrace-equiv (cons (backtrace-frame-fix x) y)
                       (cons x y)))

    Theorem: cons-backtrace-frame-equiv-congruence-on-x-under-backtrace-equiv

    (defthm
       cons-backtrace-frame-equiv-congruence-on-x-under-backtrace-equiv
      (implies (backtrace-frame-equiv x x-equiv)
               (backtrace-equiv (cons x y)
                                (cons x-equiv y)))
      :rule-classes :congruence)

    Theorem: cons-of-backtrace-fix-y-under-backtrace-equiv

    (defthm cons-of-backtrace-fix-y-under-backtrace-equiv
      (backtrace-equiv (cons x (backtrace-fix y))
                       (cons x y)))

    Theorem: cons-backtrace-equiv-congruence-on-y-under-backtrace-equiv

    (defthm cons-backtrace-equiv-congruence-on-y-under-backtrace-equiv
      (implies (backtrace-equiv y y-equiv)
               (backtrace-equiv (cons x y)
                                (cons x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-backtrace-fix

    (defthm consp-of-backtrace-fix
      (equal (consp (backtrace-fix x))
             (consp x)))

    Theorem: backtrace-fix-under-iff

    (defthm backtrace-fix-under-iff
      (iff (backtrace-fix x) (consp x)))

    Theorem: backtrace-fix-of-cons

    (defthm backtrace-fix-of-cons
      (equal (backtrace-fix (cons a x))
             (cons (backtrace-frame-fix a)
                   (backtrace-fix x))))

    Theorem: len-of-backtrace-fix

    (defthm len-of-backtrace-fix
      (equal (len (backtrace-fix x)) (len x)))

    Theorem: backtrace-fix-of-append

    (defthm backtrace-fix-of-append
      (equal (backtrace-fix (append std::a std::b))
             (append (backtrace-fix std::a)
                     (backtrace-fix std::b))))

    Theorem: backtrace-fix-of-repeat

    (defthm backtrace-fix-of-repeat
      (equal (backtrace-fix (acl2::repeat n x))
             (acl2::repeat n (backtrace-frame-fix x))))

    Theorem: list-equiv-refines-backtrace-equiv

    (defthm list-equiv-refines-backtrace-equiv
      (implies (acl2::list-equiv x y)
               (backtrace-equiv x y))
      :rule-classes :refinement)

    Theorem: nth-of-backtrace-fix

    (defthm nth-of-backtrace-fix
      (equal (nth n (backtrace-fix x))
             (if (< (nfix n) (len x))
                 (backtrace-frame-fix (nth n x))
               nil)))

    Theorem: backtrace-equiv-implies-backtrace-equiv-append-1

    (defthm backtrace-equiv-implies-backtrace-equiv-append-1
      (implies (backtrace-equiv x fty::x-equiv)
               (backtrace-equiv (append x y)
                                (append fty::x-equiv y)))
      :rule-classes (:congruence))

    Theorem: backtrace-equiv-implies-backtrace-equiv-append-2

    (defthm backtrace-equiv-implies-backtrace-equiv-append-2
      (implies (backtrace-equiv y fty::y-equiv)
               (backtrace-equiv (append x y)
                                (append x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: backtrace-equiv-implies-backtrace-equiv-nthcdr-2

    (defthm backtrace-equiv-implies-backtrace-equiv-nthcdr-2
      (implies (backtrace-equiv l l-equiv)
               (backtrace-equiv (nthcdr n l)
                                (nthcdr n l-equiv)))
      :rule-classes (:congruence))

    Theorem: backtrace-equiv-implies-backtrace-equiv-take-2

    (defthm backtrace-equiv-implies-backtrace-equiv-take-2
      (implies (backtrace-equiv l l-equiv)
               (backtrace-equiv (take n l)
                                (take n l-equiv)))
      :rule-classes (:congruence))