• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
          • Binder-functions
          • Fgl-syntactic-checker-binders
          • Binder
          • Fancy-ev
          • Backtraces
            • Interp-st-stack-backtrace
            • Function-rules-to-backtrace-spec
          • Annotate
          • Binder-rules
          • Def-fgl-program
          • Bind-var
          • Add-fgl-brewrites
          • Def-fgl-rewrite
          • Narrow-equiv
          • Trigger-constraints
          • Def-fgl-branch-merge
          • Add-fgl-rewrites
          • Fgl-interp-obj
          • Syntax-bind
          • 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
          • Cmr::rewritelist->lhses
          • Syntax-interp
          • 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
        • 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
      • 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
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Fgl-rewrite-rules

Backtraces

Accessing a backtrace during FGL rewriting

The following utilities allow FGL to retrieve backtrace data while rewriting. These can be used to help debug code proofs or FGL rewriter problems.

Specifying backtrace data to collect

  • backtrace-spec is the data structure specifying an FGL rule to include in the backtrace and which variables of that rule to include. A list of these (a backtrace-speclist) are given to the backtrace collection functions to get data from multiple rules.
  • function-rules-to-backtrace-spec collects backtrace specs for all FGL rewrite rules targeting a particular function.

Collecting a backtrace of symbolic values

  • interp-st-stack-backtrace collects a backtrace for a list of backtrace-specs. The resulting object is a list of backtrace-frame objects, giving the frame number, rule name, and variable bindings.
  • interp-st-stack-backtrace-top returns the innermost frame (car) of the interp-st-stack-backtrace, stopping once it finds it.
  • interp-st-stack-full-backtrace collects a full backtrace; that is, one containing all of the bindings for all of the frames of the FGL stack, as a list of backtrace-frame objects.

Evaluating a backtrace under a satisfying assignment

A backtrace is a data structure with symbolic objects in it. Sometimes it is useful to evaluate this object to get concrete values for all of the symbolic objects.

  • backtrace-to-obj and backtrace-frame-to-obj construct proper symbolic objects from (respectively) a backtrace or backtrace-frame. It's likely that one of these already is a proper symbolic object, but these functions make sure of it.
  • fgl-counterexamples for utilities that can be used to derive a counterexample and evaluate the backtrace under it.

Subtopics

Interp-st-stack-backtrace
Collect a backtrace object from the FGL rewriter stack, given a list of rule specifications
Function-rules-to-backtrace-spec
Get a set of FGL backtrace specifiers for all FGL rules targeting a function symbol