• 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
      • Operational-semantics
      • Real
      • Start-here
        • Gentle-introduction-to-ACL2-programming
        • ACL2-tutorial
          • Introduction-to-the-theorem-prover
          • Pages Written Especially for the Tours
          • The-method
          • Advanced-features
          • Interesting-applications
          • Tips
          • Alternative-introduction
          • Tidbits
          • Annotated-ACL2-scripts
          • Startup
          • ACL2-as-standalone-program
          • ACL2-sedan
            • Defunc
            • Cgen
            • Ccg
            • Defdata
            • ACL2s-user-guide
            • ACL2s-tutorial
            • ACL2s-implementation-notes
            • Match
            • ACL2s-faq
            • ACL2s-intro
            • ACL2s-defaults
            • Definec
            • ACL2s-utilities
            • ACL2s-interface
              • Itest?-query
              • ACL2s-event
              • ACL2s-query
              • Quiet-mode-hooks
              • ACL2s-interface-symbol-package-tips
              • ACL2s-compute
                • ACL2s-interface::ACL2s-interface-utils
                • Quiet-mode
                • Capture-output
              • ACL2s-installation
            • Talks
            • Nqthm-to-ACL2
            • Tours
            • Emacs
          • About-ACL2
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • ACL2s-interface

    ACL2s-compute

    Run a single-value ACL2 computation from Common Lisp

    General form
    (acl2s-compute
      form                   ; The form to evaluate. Should return a single value.
      :quiet <bool>          ; Optional. Whether or not to suppress all ACL2 printed output. Defaults to nil.
      :capture-output <bool> ; Optional. Whether or not to capture all ACL2 printed output. Defaults to nil.
      ...)       ;; Any additional arguments will be passed to ld, except for :ld-error-action
    =>
    (list erp val)
    Returns
    erp is t if an error occurred during execution of form, and is nil otherwise.
    val is the single value that form evaluated to.

    The form argument should be an ACL2 expression that evaluates to a single value. Be careful about symbol packages when using acl2s-compute when inside a different package - you may need to fully specify the name of an ACL2 function when calling it. See ACL2s-interface-symbol-package-tips for more information.

    When the :quiet option is set to t, acl2s-compute will attempt to suppress all ACL2 printed output during evaluation of form. This temporarily overrides the current quiet-mode.

    When the :capture-output option is set to t, acl2s-compute will attempt capture all ACL2 printed output during evaluation of form. This temporarily overrides the current capture-output.

    Examples

    (acl2s-compute '(+ 1 2))
    Returns (nil 3)
    (acl2s-compute '(+ 1 2) :quiet nil :ld-pre-eval-print t)
    Returns (nil 3), does not attempt to suppress any ACL2 printed output, and passes :ld-pre-eval-print t to ACL2::ld
    (acl2s-compute '(append '(1 2) '(3 4)))
    Returns (nil (1 2 3 4))
    (acl2s-compute '(+ 1 '(1 2)))
    Returns (t nil) and prints out a guard violation error message
    (acl2s-compute '(mv nil t state))