• 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
          • Scratchobj
          • Minor-frame
          • Major-frame
          • Major-stack
          • Scratchlist
          • Minor-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
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Fgl

Fgl-stack

Representation of the FGL interpreter stack.

FGL stores the stack of its interpreter as a nested stobj stack inside its interp-st stobj. But the stack may also be extracted as an ordinary ACL2 object of type major-stack. This topic offers an overview of how these work; specifics of each datatype are in their respective topics.

A major-stack is a nonempty list of major-frame objects. Each such frame represents an entirely new scope for variables such as a function definition or rewrite rule application. Each major-frame contains some debugging info, a variable bindings alist, and a minor-stack, which is a nonempty list of minor-frame objects. Each minor frame represents a lambda body within the larger context of the major frame. It has its own bindings and debugging info, as well as a list of scratch objects representing arguments to be passed to subsequent function calls.

The distinction between major and minor stack frames is subtle, especially given ACL2's insistence that lambdas bind all the variables found in their bodies. The difference is that in FGL, when we encounter a lambda nesting, we preprocess it so as to ignore variables that are re-bound to themselves, instead keeping the current bindings and only adding to them. On the other hand, when we apply a rewrite rule we enter a completely new namespace where initially only the variables of the unifying substitution are bound. This lazy binding of lambdas allows us to support syntax-bind by allowing us to leave variables unbound until they are used in a nontrivial way: that is, passed into a function or bound to a different variable in a lambda.

Subtopics

Scratchobj
Type of an object stored in an FGL minor stack frame's scratch list.
Minor-frame
A minor stack frame representing a lambda body scope.
Major-frame
A major stack frame representing an entirely new namespace such as a function definition or rewrite rule.
Major-stack
A stack representing the current nesting of rule applications.
Scratchlist
A list of scratch objects (type scratchobj) representing arguments to future function calls, etc.
Minor-stack
A minor stack representing some nesting of lambda scopes within a major stack frame.