• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
          • Defstobj
          • Defabsstobj
          • Stobj-table
          • Preservation-thms
          • Nested-stobjs
          • Defrstobj
          • With-global-stobj
          • User-stobjs-modified-warnings
          • Stobj-example-1
          • Defrstobj
          • Stobj-example-3
          • Stobj-example-1-proofs
          • With-local-stobj
          • Stobj-example-1-defuns
          • Declare-stobjs
          • Trans-eval-and-stobjs
          • With-local-state
          • Stobj-example-2
          • Stobj-example-1-implementation
          • Add-global-stobj
          • Swap-stobjs
          • Resize-list
          • Nth-aliases-table
          • Def-stobj-frame
          • Trans-eval-and-locally-bound-stobjs
          • Std/stobjs
            • Stobj-updater-independence
            • Def-1d-arr
            • Defstobj-clone
            • Def-2d-arr
            • Defabsstobj-events
              • Bitarr
              • Natarr
            • Count-keys
            • Update-nth-array
            • Remove-global-stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defmacro
          • Loop$-primer
          • Fast-alists
          • Defconst
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Std/stobjs
    • Defabsstobj

    Defabsstobj-events

    Alternative to defabsstobj that tries to prove the necessary correspondence and preservation theorems instead of making you prove them ahead of time.

    This is essentially a drop-in replacement for defabsstobj that. Instead of requiring you to copy/paste the preservation/correspondence theorems and prove them ahead of time, it just tries to go ahead and prove them before submitting the defabsstobj form.

    This can often eliminate a lot of tedious copy/paste updating. It is also useful in macros that generate abstract stobjs, such as def-1d-arr and similar.

    The syntax is like that of defabsstobj, e.g.,:

    (defabsstobj-events st
      :foundation st$c
      :recognizer (stp :logic st$ap :exec st$cp)
      :creator (create-st :logic create-st$a :exec create-st$c)
      :corr-fn st$corr
      :exports ((foo :logic foo$a :exec foo$c)
                ...
                (baz :exec baz$a :exec baz$c)))

    The macro operates very simply:

    1. Use defabsstobj-missing-events to generate the necessary theorems, then
    2. Try to submit these events to ACL2 via a make-event, then finally
    3. Submit the defabsstobj form.

    The theorems submitted in Step 2 are just attempted in your current theory and with no hints. If some theorem can't be proven, the easiest thing to do is extract it (copy and paste it) above your defabsstobj-events form so that you can give it hints. For instance:

    (encapsulate ()
     (local (defthm foo{correspondence}  ;; presumably need hints
              ...
              :hints (...)))
     (defabsstobj-events st ...))