• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
        • Gentle-introduction-to-ACL2-programming
        • ACL2-tutorial
        • About-ACL2
          • Recursion-and-induction
          • Operational-semantics
          • Soundness
          • Release-notes
          • Version
          • Acknowledgments
          • Using-ACL2
            • How-to-contribute
            • Pre-built-binary-distributions
            • Common-lisp
            • Git-quick-start
            • Copyright
            • Building-ACL2
            • ACL2-help
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Installation
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Installation
    • About-ACL2

    Using-ACL2

    Using ACL2

    Table of Contents

    • Invoking ACL2
    • Testing ACL2
    • Certifying ACL2 Books
    • Documentation
    • Emacs

    Invoking ACL2

    We assume that you have followed the installation instructions to install ACL2. The sources and, in general, an executable image are located in that directory. However, if you have not saved an executable image but instead use the directions for running ACL2 without building an executable image (see running-ACL2-without-executable), skip to “When ACL2 Starts Up” below.

    Invoke ACL2 by running the executable file, saved_acl2, for example as follows (but you can supply a suitable pathname if you are not standing in the directory that contains saved_acl2).

    mycomputer% ./saved_acl2

    If you on a Unix-like system, then to make it easy to invoke ACL2 by typing a short command, e.g.,

    mycomputer% acl2

    you may want to install an executable file on your path, e.g., ~/bin/acl2, containing the following two lines where <path> is the absolute pathname for the directory of saved_acl2.

    #!/bin/sh
    <path>/saved_acl2 "$@"

    Note: A carriage return in the file after the last line above may be important!

    When ACL2 Starts Up

    When you invoke ACL2, you should see the host Common Lisp print a header concerning the ACL2 version, license and copyright.

    Most or all hosts then automatically enter the ACL2 command loop, an ACL2 read-eval-print loop with the prompt:

    ACL2 !>

    In the very unlikely case that a host leaves you in Common Lisp's read-eval-print loop, then you'll need to evaluate the Common Lisp expression (ACL2::LP) or simply (LP) if the current package is "ACL2".

    Once in the ACL2 command loop, you can type an ACL2 term, typically followed by ``return'' or ``enter,'' and ACL2 will evaluate the term, print its value, and prompt you for another one. Below are three simple interactions.

    ACL2 !>t
    T
    ACL2 !>'abc
    ABC
    ACL2 !>(+ 2 2)
    4

    To get out of the ACL2 command loop, type the :q command. This returns you to the host Common Lisp. We sometimes call this ``raw Lisp.'' You may re-enter the command loop with (LP) as above. To quit ACL2 (and Lisp) entirely, submit the command, (quit).

    Note that when you are in raw Lisp you can overwrite or destroy ACL2 by executing inappropriate Common Lisp expressions. All bets are off once you've exited the ACL2 loop. That said, this is typically safe and many users do it. For example, you might exit the ACL2 loop, activate some debugging or trace features in raw Lisp, and then reenter the ACL2 loop. While developing proofs or tracking down problems, this can occasionally be reasonable behavior.

    Now you are ready to test your copy of ACL2.

    Testing ACL2

    An easy way to test the theorem prover is to type the following term to the ACL2 command loop.

    :mini-proveall

    This will cause a sequence of commands to be processed, each of which is first printed out as though you had typed it. Each will print some text, generally a proof of some conjecture. None should fail.

    A more elaborate test is to certify the community books; see community-books and certify-book. This certification is a good idea anyhow; this is our next topic. On a Unix-like system, you can also certify just a small but useful subset of the books in a few minutes by executing make basic in either the main ACL2 directory or the books/ subdirectory.

    Certifying ACL2 Books

    The community books, which reside in subdirectory books/, have been contributed by many ACL2 users. See books for a through discussion of the general topic of books.

    Books should be certified before they are used. ACL2 is distributed without book certificates, mainly because certification produces compiled code specific to the host. You should certify the books locally, both as a test of your ACL2 image and because books generally need to be certified before they can be used. See installation, or more specifically installation-summary, for how to perform this certification. For additional explanation and further options, see books-certification.

    Documentation

    See documentation for a discussion of ACL2's documentation system. To query ACL2 about a built-in topic, <topic>, submit :DOC <topic> to ACL2.

    Emacs

    Emacs users may find it helpful to load into emacs the file emacs/emacs-acl2.el for Emacs 24 or 25 or the file books/emacs/emacs-acl2.el for later Emacs versions. Utilities offered by this file are documented near the top of the file. In particular, this file automatically loads the ACL2-doc Emacs-based browser for ACL2 documentation.