• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
          • Lambda
          • Warrant
          • Defwarrant
          • Badge
          • Lambda$
          • Tame
          • Defbadge
          • Print-cl-cache
          • Introduction-to-apply$
          • Well-formed-lambda-objectp
          • Rewriting-calls-of-apply$-ev$-and-loop$-scions
          • Mixed-mode-functions
          • Explain-giant-lambda-object
            • Gratuitous-lambda-object-restrictions
            • Scion
            • Ilk
            • Ev$
            • Translam
            • Fn-equal
            • Apply$-guard
            • L<
            • Apply$-lambda-guard
            • Apply$-userfn
            • Badge-userfn
            • Defun$
            • Apply$-lambda
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Fast-alists
          • Defconst
          • Defmacro
          • Loop$-primer
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
            • Let
            • Declare
            • Mbe
            • Apply$
              • Lambda
              • Warrant
              • Defwarrant
              • Badge
              • Lambda$
              • Tame
              • Defbadge
              • Print-cl-cache
              • Introduction-to-apply$
              • Well-formed-lambda-objectp
              • Rewriting-calls-of-apply$-ev$-and-loop$-scions
              • Mixed-mode-functions
              • Explain-giant-lambda-object
                • Gratuitous-lambda-object-restrictions
                • Scion
                • Ilk
                • Ev$
                • Translam
                • Fn-equal
                • Apply$-guard
                • L<
                • Apply$-lambda-guard
                • Apply$-userfn
                • Badge-userfn
                • Defun$
                • Apply$-lambda
              • Fmt
              • Loop$
              • Return-last
              • Mv-let
              • Df
              • Pseudo-termp
              • Defwarrant
              • Mbt
              • Time$
              • Ec-call
              • Mv-nth
              • Sys-call
              • Msg
              • Er
              • Value-triple
              • O-p
              • Comp
              • Member
              • O<
              • Cw
              • Flet
              • Or
              • Hons
              • Cbd
              • Mv
              • Defbadge
              • Append
              • *ACL2-exports*
              • Comment
              • Eql
              • List
              • Unsigned-byte-p
              • Posp
              • Natp
              • The
              • Nth
              • And
              • Len
              • Time-tracker
              • Term-order
              • True-listp
              • Msgp
              • Booleanp
              • <
              • If
              • Pseudo-term-listp
              • +
              • Not
              • With-global-stobj
              • Bitp
              • Equal
              • Cdr
              • Car
              • String-listp
              • Nat-listp
              • Implies
              • Iff
              • Character-listp
              • Alistp
              • Cons
              • Symbol-listp
              • Macrolet
              • Quote
              • Integerp
              • Consp
              • State-global-let*
              • Compress1
              • Symbolp
              • Stringp
              • *common-lisp-symbols-from-main-lisp-package*
              • Characterp
              • True-list-listp
              • Prog2$
              • *
              • Last-prover-steps
              • Hons-acons
              • Let*
              • Eq
              • With-guard-checking
              • @
              • Length
              • With-local-stobj
              • Hard-error
              • -
              • Zp
              • Search
              • Intersection$
              • Assign
              • Aset1
              • Symbol-name
              • Union$
              • Set-gc-strategy
              • In-tau-intervalp
              • Cons-with-hint
              • Break-on-error
              • Pand
              • Case-match
              • Fast-alist-fork
              • Sys-call+
              • Signed-byte-p
              • ACL2-count
              • Remove-duplicates
              • With-serialize-character
              • Observation
              • Hons-resize
              • Make-tau-interval
              • Assoc
              • Logbitp
              • Termp
              • Position
              • *standard-co*
              • Hons-acons!
              • Update-nth
              • Aref1
              • Symbol-alistp
              • Read-run-time
              • Take
              • Symbol-package-name
              • Hons-wash
              • Keywordp
              • Expt
              • Coerce
              • Non-exec
              • Get-internal-time
              • Intern
              • Case
              • Standard-oi
              • Standard-co
              • Good-bye
              • Formula
              • Atom
              • Without-evisc
              • Ash
              • With-local-state
              • Spec-mv-let
              • Intern-in-package-of-symbol
              • Binary-+
              • <=
              • With-fast-alist
              • Set-difference$
              • Hons-clear
              • Flush-compress
              • Rationalp
              • Por
              • Rassoc
              • Logand
              • Remove-assoc
              • =
              • Nthcdr
              • Pargs
              • Nfix
              • Hons-copy
              • Alphorder
              • Subsetp
              • Floor
              • Remove1-assoc
              • No-duplicatesp
              • Mv-list
              • Canonical-pathname
              • Aset2
              • Serialize-read
              • Random$
              • Fmt-to-comment-window
              • F-put-global
              • Compress2
              • Concatenate
              • Swap-stobjs
              • Fast-alist-clean
              • Assert$
              • Remove
              • Remove1
              • Intersectp
              • Endp
              • Put-assoc
              • Princ$
              • Primitive
              • Keyword-value-listp
              • True-list-fix
              • Integer-listp
              • Illegal
              • Hons-get
              • With-output-lock
              • Setenv$
              • Open-output-channel!
              • Fast-alist-free
              • Er-progn
              • Cw-print-base-radix
              • Reverse
              • Cond
              • Complex
              • Add-to-set
              • Truncate
              • Digit-char-p
              • Code-char
              • Char-code
              • Set-print-case
              • Set-print-base
              • Read-ACL2-oracle
              • Error1
              • Print-object$
              • Plet
              • Logior
              • Integer-length
              • Zip
              • With-live-state
              • Hons-assoc-equal
              • Extend-pathname
              • In-package
              • With-guard-checking-event
              • Term-listp
              • Print-object$+
              • Fmx-cw
              • String
              • Mod
              • Unary--
              • Set-print-radix
              • Resize-list
              • Pkg-witness
              • Revappend
              • Null
              • Term-list-listp
              • Make-fast-alist
              • Header
              • Boole$
              • Subseq
              • Logxor
              • With-guard-checking-error-triple
              • /
              • Make-list
              • Char-upcase
              • Char-downcase
              • Strip-cars
              • Set-fmt-hard-right-margin
              • Make-ord
              • Ifix
              • Fast-alist-free-on-exit
              • F-get-global
              • Aref2
              • Standard-char-p
              • Lognot
              • Must-be-equal
              • Integer-range-p
              • Getenv$
              • Binary-append
              • Er-hard
              • Eqlablep
              • Cpu-core-count
              • Boolean-listp
              • Allocate-fixnum-range
              • ACL2-numberp
              • Butlast
              • Pairlis$
              • Mod-expt
              • Hons-equal
              • Gc$
              • Substitute
              • Ceiling
              • With-stolen-alist
              • Mv?-let
              • String-upcase
              • String-downcase
              • Round
              • Count
              • Char
              • Sys-call-status
              • Progn$
              • Pprogn
              • Lexorder
              • Hons-summary
              • Break$
              • Assert*
              • Alpha-char-p
              • Strip-cdrs
              • Serialize-write
              • Keyword-listp
              • Upper-case-p
              • Lower-case-p
              • Logeqv
              • List*
              • Last
              • Proofs-co
              • Maximum-length
              • Fix
              • Explode-nonnegative-integer
              • Eqlable-listp
              • Dimensions
              • Default
              • Arity
              • Sublis
              • Max
              • Evenp
              • Explode-atom
              • Change
              • Zerop
              • String<
              • String-equal
              • Abs
              • Set-print-base-radix
              • Print-base-p
              • Nonnegative-integer-quotient
              • Intern$
              • Getprop
              • Binary-*
              • Aset1-trusted
              • Symbol<
              • String-append
              • Rfix
              • Mv?
              • Logic-fns-list-listp
              • Fast-alist-fork!
              • Er-hard?
              • Char-equal
              • 1+
              • *standard-oi*
              • Sys-call*
              • Mbt*
              • Hons-wash!
              • Hons-clear!
              • Signum
              • Rem
              • Real/rationalp
              • Rational-listp
              • Pos-listp
              • O-first-coeff
              • Logic-fnsp
              • Logic-fns-listp
              • Hons-copy-persistent
              • Gc-strategy
              • Fast-alist-summary
              • String>=
              • String<=
              • Acons
              • O-first-expt
              • Fast-alist-clean!
              • >=
              • >
              • Subst
              • Logcount
              • Getpropc
              • Evens
              • Er-soft
              • Digit-to-char
              • Comp-gcl
              • Atom-listp
              • Arities-okp
              • ACL2-number-listp
              • /=
              • Cadr
              • *standard-ci*
              • Unary-/
              • The-true-list
              • Realfix
              • O-rst
              • Fast-alist-len
              • Complex/complex-rationalp
              • Array2p
              • Array1p
              • Logtest
              • Logandc1
              • Char<
              • Trace-co
              • Putprop
              • Get-real-time
              • Eqlable-alistp
              • Count-keys
              • Assoc-string-equal
              • Logorc1
              • Logandc2
              • Denominator
              • 1-
              • Packn
              • Logic-termp
              • Logic-term-list-listp
              • Fmt!
              • Fms
              • Cw!
              • Assoc-keyword
              • String>
              • Numerator
              • Logorc2
              • Lognor
              • Char>=
              • Update-nth-array
              • The-number
              • Odds
              • Makunbound-global
              • Make-character-list
              • Make
              • List$
              • Int=
              • Get-cpu-time
              • Fmt-to-comment-window!
              • Fms!
              • F-boundp-global
              • Complex-rationalp
              • Alist-to-doublets
              • Access
              • Min
              • Lognand
              • Listp
              • Identity
              • Char>
              • Char<=
              • Zpf
              • Standard-char-listp
              • O-finp
              • Number-subtrees
              • Logic-term-listp
              • Last-cdr
              • Fmt1!
              • Fmt-to-comment-window!+
              • Character-alistp
              • Oddp
              • Minusp
              • Imagpart
              • Conjugate
              • Xor
              • Unquote
              • String-alistp
              • Packn-pos
              • Maybe-flush-and-compress1
              • Kwote
              • Fmt1
              • Fmt-to-comment-window+
              • Cw-print-base-radix!
              • Alist-keys-subsetp
              • Realpart
              • Plusp
              • First
              • Symbol-name-lst
              • R-symbol-alistp
              • R-eqlable-alistp
              • Fmx
              • Cw!+
              • Cons-subtrees
              • Cons-count-bounded
              • Cddr
              • Caar
              • Proper-consp
              • Kwote-lst
              • Improper-consp
              • Cw+
              • Rest
              • Standard-char-p+
              • Mbe1
              • Caddr
              • Pairlis-x2
              • Pairlis-x1
              • O>=
              • O<=
              • O-infp
              • Merge-sort-lexorder
              • Fix-true-list
              • Cdddr
              • Set-fmt-soft-right-margin
              • Real-listp
              • O>
              • Cddar
              • Cdar
              • Cdadr
              • Cdaar
              • Cadar
              • Caadr
              • Caaar
              • Cadddr
              • Caddar
              • Third
              • Tenth
              • Sixth
              • Seventh
              • Second
              • Ninth
              • Fourth
              • Fifth
              • Eighth
              • Cddddr
              • Cdddar
              • Cddadr
              • Cddaar
              • Cdaddr
              • Cdadar
              • Cdaadr
              • Cdaaar
              • Cadadr
              • Cadaar
              • Caaddr
              • Caadar
              • Caaadr
              • Caaaar
              • Hons-shrink-alist!
              • Hons-shrink-alist
              • Flush-hons-get-hash-table-link
              • Delete-assoc
            • 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
          • Miscellaneous
          • Output-controls
          • Bdd
          • Macros
          • Installation
          • Mailing-lists
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Apply$

      Explain-giant-lambda-object

      print data related to a large lambda object

      Translate will signal an error if it encounters an “excessively large” lambda object. These objects are so large they are difficult to comprehend when printed. So the error message directs you to this documentation topic. To see the lambda object that caused the error, execute

      (explain-giant-lambda-object)

      The rest of this documentation topic explains why we detect these objects and what you can do about them.

      When a lambda object is translated we hons-copy it so that it is uniquely represented. This speeds up the performance of the compiled lambda cache (see print-cl-cache).

      However, if the number of conses in the lambda object is greater than or equal to (lambda-object-count-max-val), we cause an error. If this error has been signaled in your session we recommend that you evaluate (explain-giant-lambda-object), which will tell you more about the excessively large lambda object. The current value of (lambda-object-count-max-val) is 200,000. For reference, the largest function definition in the ACL2 sources (as of Version 8.6) is the mutual-recursion event defining rewrite and its 51 mutually recursive subfunctions. The total number of conses in that clique is 14,656.

      There are generally two ways excessively large lambda objects come into existence: (1) they are generated automatically, as by macros, functions, or make-event, or (2) you wrote a small lambda object but used a big quoted constant in it.

      (1) If the offending lambda object was built mechanically, we recommend that you redefine the generation process so that it introduces a named function. For example, suppose the lambda object sketched below is excessively large.

      (lambda (x y)
        (if (eq x 'FOO1)
            (my-foo1 y)
            (if (eq x 'FOO2)
                (my-foo2 y)
                ...)))

      Then perhaps instead of generating that object you could generate the definition

      (defun my-big-switch (x y)
        (if (eq x 'FOO1)
            (my-foo1 y)
            (if (eq x 'FOO2)
                (my-foo2 y)
                ...)))

      And then use the quite small (lambda$ (x y) (my-big-switch x y)) in place of the offending lambda object. Of course, this is not always easy to carry out, since it would also require calling defwarrant on my-big-switch and providing that warrant as a hypothesis to any theorem involving the new lambda object.

      (2) If the offending lambda object just contains large quoted constants perhaps you can bind a variable to the large value outside of the lambda object and pass that variable into the lambda object in a new formal.

      For example, suppose the term (regression-suite) returns is a list of pairs of sample inputs and correct output for testing some software system whose binary machine code is in the constant declared below.

      (defconst *system*
        '(#x488b55f0
          #x31ff
          #xff142570081050
          #xf84995b0000
          #xf645f801
          #xf8573100000
          #x807df019
          ...))

      Then we might wish to execute something like the following.

      ACL2 !>(loop$ for pair in (regression-suite)
                    always (equal (sim *system* (car pair)) (cdr pair)))

      which simulates the *system* on every input in the regression suite and compares the result to the known correct answer.

      The formal translation of this term is

      (always$ '(lambda (loop$-ivar)
                  (equal (sim '(#x488b55f0
                                #x31ff
                                #xff142570081050
                                #xf84995b0000
                                #xf645f801
                                #xf8573100000
                                #x807df019
                                ...)
                              (car loop$-ivar))
                         (cdr loop$-ivar)))
               (regression-suite))

      Note that the constant *system* has been rendered as its quoted value and that it is inside of the lambda object. If *system* is a very large constant, that lambda object may be excessively large.

      But we can avoid that by writing this instead.

      ACL2 !>(let ((sys *system*))
               (loop$ for pair in (regression-suite)
                      always (equal (sim sys (car pair)) (cdr pair))))

      which essentially translates to

      (let ((sys '(#x488b55f0
                   #x31ff
                   #xff142570081050
                   #xf84995b0000
                   #xf645f801
                   #xf8573100000
                   #x807df019
                   dots)))
        (always$+ '(lambda (loop$-gvars loop$-ivars)
                     (equal (sim (car loop$-gvars)
                                 (car (car loop$-ivars)))
                            (cdr (car loop$-ivars))))
                  (list sys)
                  (loop$-as (list (regression-suite)))))

      Note that the lambda object no longer contains the large constant. It now refers to a “global” variable whose value is that of *system*. The lambda object is quite small.

      For what it is worth, the largest single object in the ACL2 image (as of Version 8.6) is the value of (w state), the logical world. Upon starting the system (w state) contains 128,784 elements, but contains multiple pointers to shared substructures (e.g., to tails of itself). The total number of conses is on the order of (expt 10 655) when counted naively, but the total number of distinct conses is 1,875,653. So if you build a lambda object containing the value of (w state) it will be “excessively large.”