• 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
      • Start-here
      • Real
      • Debugging
      • Miscellaneous
        • Term
        • Ld
        • Hints
        • Type-set
        • Ordinals
        • ACL2-customization
        • With-prover-step-limit
        • With-prover-time-limit
        • Set-prover-step-limit
        • Local-incompatibility
        • Set-case-split-limitations
        • Subversive-recursions
        • Specious-simplification
        • Defsum
        • Oracle-timelimit
        • Thm
        • Defopener
        • Gcl
        • Case-split-limitations
        • Set-gc-strategy
        • Default-defun-mode
        • Top-level
        • Reader
          • Sharp-f-reader
          • Fancy-string-reader
          • Sharp-u-reader
          • Sharp-dot-reader
          • Backquote
            • Sharp-bang-reader
          • Ttags-seen
          • Adviser
          • Ttree
          • Abort-soft
          • Defsums
          • Gc$
          • With-timeout
          • Coi-debug::fail
          • Expander
          • Gc-strategy
          • Coi-debug::assert
          • Sin-cos
          • Def::doc
          • Syntax
          • Subversive-inductions
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Reader

    Backquote

    Variant of quotation introducing templates for data structures

    ACL2 supports the backquote (`) construct of Common Lisp. See any Common Lisp documentation for details, for example, its discussion in the Common Lisp HyperSpec. Here we give only a brief introduction.

    Together with the use of comma (,) and comma-atsign (,@), backquote provides a variant of quote that supports an escape mechanism, as illustrated by the following examples.

    ACL2 !>`(a b c)
    (A B C)
    ACL2 !>(let ((x '(a b c))) `(1 ,(cdr x) 2))
    (1 (B C) 2)
    ACL2 !>(let ((x '(a b c))) `(1 ,@(cdr x) 2))
    (1 B C 2)
    ACL2 !>

    The first example above illustrates that backquote is much like quote. The second example shows how a comma escapes from the quotation, inserting the value of the object that follows the comma. The third example is similar to the second, except that it uses comma followed by an atsign, which splices in the value (which must satisfy true-listp) rather than inserting it.