• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
          • World
            • Logical-name
            • Formula
            • Redefined-names
            • Retract-world
              • Extend-world
              • Getprop
              • Getpropc
              • Putprop
              • Props
            • Io
            • Wormhole
            • Programming-with-state
            • W
            • Set-state-ok
            • Random$
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Mutual-recursion
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Loop$-primer
          • Fast-alists
          • Defmacro
          • Defconst
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Irrelevant-formals
          • Efficiency
          • 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
          • Defmacro-untouchable
          • Primitive
          • <<
          • Revert-world
          • Set-duplicate-keys-action
          • Unmemoize
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Defopen
          • Sleep
        • Start-here
        • Real
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • World

    Retract-world

    Install an initial segment (retraction) of a given ACL2 world

    See world for relevant background on ACL2 property list worlds. Here we discuss how to install an initial segment (retraction) of a user-defined world, that is, a world other than the one named 'current-acl2-world, which is maintained by the ACL2 system. Also see retract-world for a similar utility that instead extends a named world.

    General Form:
    
    (retract-world name wrld)

    where name is a symbol intended to name the given ACL2 property list world, world. Consider the following example.

    ACL2 !>(let* ((wrld0 nil)
                  (wrld1 (putprop 'my-sym1 'my-key1 'my-val1-old wrld0))
                  (wrld2 (putprop 'my-sym2 'my-key2 'my-val2 wrld1))
                  (wrld3 (putprop 'my-sym1 'my-key1 'my-val1 wrld2)))
             (pprogn (f-put-global 'my-w1 wrld1 state)
                     (f-put-global 'my-w3 (extend-world 'my-world wrld3) state)))
    <state>
    ACL2 !>(retract-world 'my-world (@ my-w1))
    ((MY-SYM1 MY-KEY1 . MY-VAL1-OLD))
    ACL2 !>(getprop 'my-sym1 'my-key1 nil 'my-world (@ my-w1))
    MY-VAL1-OLD
    ACL2 !>

    The first top-level form sets the values of state globals my-w1 and my-w3 to to the worlds obtained by extending the empty world one or three times, respectively, as shown. The second top-level form installs the value of my-w1 as the world that is current for the name 'my-world. The third top-level form returns the 'my-key1 property for the symbol 'my-sym1 in the installed world (@ my-w1), and it does so efficiently because that world is installed. See world.