• 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
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
        • Make-event
        • Defmacro
        • Untranslate-patterns
        • Tc
        • Trans*
        • Macro-aliases-table
        • Macro-args
        • Defabbrev
        • User-defined-functions-table
        • Trans
          • Untranslate-for-execution
          • Add-macro-fn
          • Check-vars-not-free
          • Safe-mode
          • Macro-libraries
          • Trans1
          • Defmacro-untouchable
          • Set-duplicate-keys-action
          • Add-macro-alias
          • Magic-macroexpand
          • Defmacroq
          • Trans!
          • Remove-macro-fn
          • Remove-macro-alias
          • Add-binop
          • Untrans-table
          • Trans*-
          • Remove-binop
          • Tcp
          • Tca
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Macros

    Trans

    Print the translation of a form

    Examples:
    :trans (list a b c)
    :trans (caddr x)
    :trans (cond (p q) (r))

    ACL2 accepts user-level syntax as input, but translates it to an internal syntax. This translation includes macroexpansion, replacing let forms by lambda expressions, quoting constants, and so on. See term for relevant background.

    Trans takes one argument, an alleged term in user syntax, and translates it, expanding the macros in it completely. Either an error is caused or the internal syntax for the term (representing its formal meaning) is printed. We also print the ``output signature'' which indicates how many results are returned and which are single-threaded objects. For example, a term that returns one ordinary object (e.g., an object other than state or a user-defined single-threaded object (see defstobj)) has the output signature

    => *

    A term that returns the single-threaded object STATE has the output signature

    => STATE

    and a term that returns four results might have the output signature

    => (MV $MEM * * STATE)

    This signature indicates that the first result is the (user defined) single-threaded object $MEM, that the next two results are ordinary, and that the last result is STATE.

    See trans! for a corresponding command that does not enforce restrictions of single-threaded objects. See trans* for a command that can show intermediate expansion results.

    The argument supplied to :trans may contain variables, including stobj names. However, variables that are not stobj names are assumed not to be dfs (see df). For example, :trans (df+ x y) causes an error; to see the desired translation use :trans! (df+ x y).

    It is sometimes more convenient to use trans1 which is like trans but which only does top-level macroexpansion.

    For more, see term.