• 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
        • Defun
          • Xargs
            • Guard
            • Otf-flg
            • Normalize
            • Mutual-recursion
            • Defun-mode
            • Rulers
            • Defun-inline
            • Defun-nx
            • Defund
            • Set-ignore-ok
            • Set-well-founded-relation
            • Set-measure-function
            • Set-irrelevant-formals-ok
            • Defun-notinline
            • Set-bogus-defun-hints-ok
            • Defund-nx
            • Defun$
            • Defund-notinline
            • Defnd
            • Defn
            • Defund-inline
            • Set-bogus-measure-ok
          • Verify-guards
          • Table
          • Mutual-recursion
          • Memoize
          • Make-event
          • Include-book
          • Encapsulate
          • Defun-sk
          • Defttag
          • Defstobj
          • Defpkg
          • Defattach
          • Defabsstobj
          • Defchoose
          • Progn
          • Verify-termination
          • Redundant-events
          • Defmacro
          • Defconst
          • Skip-proofs
          • In-theory
          • Embedded-event-form
          • Value-triple
          • Comp
          • Local
          • Defthm
          • Progn!
          • Defevaluator
          • Theory-invariant
          • Assert-event
          • Defun-inline
          • Project-dir-alist
          • Partial-encapsulate
          • Define-trusted-clause-processor
          • Defproxy
          • Defexec
          • Defun-nx
          • Defthmg
          • Defpun
          • Defabbrev
          • Set-table-guard
          • Name
          • Defrec
          • Add-custom-keyword-hint
          • Regenerate-tau-database
          • Defcong
          • Deftheory
          • Defaxiom
          • Deftheory-static
          • Defund
          • Evisc-table
          • Verify-guards+
          • Logical-name
          • Profile
          • Defequiv
          • Defmacro-untouchable
          • Add-global-stobj
          • Defthmr
          • Defstub
          • Defrefinement
          • Deflabel
          • In-arithmetic-theory
          • Unmemoize
          • Defabsstobj-missing-events
          • Defthmd
          • Fake-event
          • Set-body
          • Defun-notinline
          • Functions-after
          • Macros-after
          • Dump-events
          • Defund-nx
          • Defun$
          • Remove-global-stobj
          • Remove-custom-keyword-hint
          • Dft
          • Defthy
          • Defund-notinline
          • Defnd
          • Defn
          • Defund-inline
          • Defmacro-last
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Xargs

    Normalize

    Storing simplified definition bodies and guards

    By default, when you submit a defun form, the body is simplified for certain later uses. This simplification is sometimes called ``normalization''; the ACL2 system function that accomplishes this task is normalize. Consider the following examples, where we make two definitions and then show their bodies using :pf..

    ACL2 !>(defun f1 (x y)
             (cons (implies x y) (integerp 3)))
    [.. output omitted ..]
     F1
    ACL2 !>(defun f2 (x y)
             (declare (xargs :normalize nil))
             (cons (implies x y) (integerp 3)))
    [.. output omitted ..]
     F2
    ACL2 !>:pf f1
    (EQUAL (F1 X Y) (IF X (IF Y '(T . T) '(NIL . T)) '(T . T)))
    ACL2 !>:pf f2
    (EQUAL (F2 X Y) (CONS (IMPLIES X Y) (INTEGERP 3)))
    ACL2 !>

    We see that the body of f1 has undergone the default simplification (with normalize), while the body of f2 has not because of the xargs in its defun form.

    The example above illustrates that normalization consists of the following three parts:

    • propagation upward of if tests;
    • potential simplification with type reasoning; and
    • the expansion of calls of a few built-in functions like implies (the full list is the value of the constant, *expandable-boot-strap-non-rec-fns*).

    We have seen an example where type reasoning can be expensive. So when ACL2 normalizes definition bodies and guards, it establishes a backchain-limit for type-set reasoning of 1, unless that limit is currently 0. (The global default is to have no limit.)

    Also see the community-books utility install-not-normalized.