• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
              • Write-object
              • Objdesign-of-var
              • Compustate-scopes-numbers
              • Create-var
              • Read-object
              • Compustate
              • Frame
              • Enter-scope
              • Compustate-scopes-numbers-aux
              • Compustate-option
              • Push-frame
                • Exit-scope
                • Compustate-frames-number
                • Compustate-option-result
                • Scope-list-result
                • Pop-frame
                • Compustate-result
                • Scope-result
                • Compustate-top-frame-scopes-number
                • Top-frame
                • Heap
                • Scope
                • Scope-list
                • Frame-list
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Computation-states

    Push-frame

    Push a frame onto a computation state's call stack.

    Signature
    (push-frame frame compst) → new-compst
    Arguments
    frame — Guard (framep frame).
    compst — Guard (compustatep compst).
    Returns
    new-compst — Type (compustatep new-compst).

    Definitions and Theorems

    Function: push-frame

    (defun push-frame (frame compst)
      (declare (xargs :guard (and (framep frame)
                                  (compustatep compst))))
      (let ((__function__ 'push-frame))
        (declare (ignorable __function__))
        (b* ((stack (compustate->frames compst))
             (new-stack (cons (frame-fix frame) stack)))
          (change-compustate compst
                             :frames new-stack))))

    Theorem: compustatep-of-push-frame

    (defthm compustatep-of-push-frame
      (b* ((new-compst (push-frame frame compst)))
        (compustatep new-compst))
      :rule-classes :rewrite)

    Theorem: compustate-frames-number-of-push-frame

    (defthm compustate-frames-number-of-push-frame
      (b* ((?new-compst (push-frame frame compst)))
        (equal (compustate-frames-number new-compst)
               (1+ (compustate-frames-number compst)))))

    Theorem: push-frame-of-frame-fix-frame

    (defthm push-frame-of-frame-fix-frame
      (equal (push-frame (frame-fix frame) compst)
             (push-frame frame compst)))

    Theorem: push-frame-frame-equiv-congruence-on-frame

    (defthm push-frame-frame-equiv-congruence-on-frame
      (implies (frame-equiv frame frame-equiv)
               (equal (push-frame frame compst)
                      (push-frame frame-equiv compst)))
      :rule-classes :congruence)

    Theorem: push-frame-of-compustate-fix-compst

    (defthm push-frame-of-compustate-fix-compst
      (equal (push-frame frame (compustate-fix compst))
             (push-frame frame compst)))

    Theorem: push-frame-compustate-equiv-congruence-on-compst

    (defthm push-frame-compustate-equiv-congruence-on-compst
      (implies (compustate-equiv compst compst-equiv)
               (equal (push-frame frame compst)
                      (push-frame frame compst-equiv)))
      :rule-classes :congruence)