• 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
        • 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$
          • 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
    • Apply$

    Translam

    Print the translation of a lambda$ expression

    :translam (lambda$ (x) (+ 1 x))
    :translam (lambda (x) (+ 1 x))

    This function takes a lambda$ term or an unquoted LAMBDA constant. In the former case, it translates the lambda$ and prints the result. In the latter case it puts the LAMBDA in a QUOTE and translates it as though it occurred in a :FN slot. Unless an error is signaled it prints the same LAMBDA object as the result.

    This utility exists because you cannot write, say,

    :trans (lambda$ (x) (+ 1 x))

    because the trans utility assumes its argument in an ordinary (ilk NIL) slot. In such slots, lambda$ terms are disallowed and no restrictions are enforced on quoted LAMBDA objects.

    This utility is useful for seeing what the formal translation of a lambda$ term is. For example,

    ACL2 !>:translam (lambda$ (x)
                              (declare (type (satisfies natp) x))
                              (* x x))

    produces the quoted well-formed LAMBDA expression:

    '(LAMBDA (X)
             (DECLARE (TYPE (SATISFIES NATP) X)
                      (XARGS :GUARD (NATP X) :SPLIT-TYPES T)
                      (IGNORABLE X))
             (RETURN-LAST 'PROGN
                          '(LAMBDA$ (X)
                                    (DECLARE (TYPE (SATISFIES NATP) X))
                                    (* X X))
                          (BINARY-* X X)))

    You might now have an inkling about why we discourage you from trying to enter quoted well-formed LAMBDA objects by hand! The normal form of a quoted well-formed LAMBDA object is complicated so that apply$ can rapidly identify the parts, generate guard conditions, compile the object, recognize objects coming from lambda$ terms, etc.