Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace output gets error when certain lisp objects encountered #1432

Open
bendyarm opened this issue Sep 20, 2022 · 4 comments
Open

trace output gets error when certain lisp objects encountered #1432

bendyarm opened this issue Sep 20, 2022 · 4 comments

Comments

@bendyarm
Copy link
Member

Even when I go into lisp mode with :q and use the Common Lisp trace, this gets an error.

ACL2 !>:q

Exiting the ACL2 read-eval-print loop.  To re-enter, execute (LP).
? (zippy:with-zip-file (zip-file "~/kestrel-acl2/tmpzippy2/src.zip") 
  (let ((entry (aref (zippy:entries zip-file) 18821)))
     (zippy::entry-to-vector entry)))
#<VECTOR 14995 type (UNSIGNED-BYTE 8), simple>
? *package*
#<Package "ACL2">
? (in-package :cl-user)
#<Package "COMMON-LISP-USER">
? (trace 3bz:decompress)
(3BZ:DECOMPRESS)
? (zippy:with-zip-file (zip-file "~/kestrel-acl2/tmpzippy2/src.zip") 
  (let ((entry (aref (zippy:entries zip-file) 18821)))
     (zippy::entry-to-vector entry)))
1> (3BZ::DECOMPRESS 
> Error: Prin1$ called on an illegal object #<OCTET-VECTOR-CONTEXT #x30200758489D>
>        
>        .
> While executing: PRIN1$, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > 
@bendyarm
Copy link
Member Author

Hopefully there is nothing dependent on ACL2's exact trace$ output. If we made trace$ output just use Common Lisp's printer when an illegal object is encountered, that would be good so we could trace things from ACL2 without this sort of error.
However, if the exact trace$ output would be logically compromised by such a change, then at least it would be good if the raw lisp version would not get an error, as shown in the transcript above.

@MattKaufmann
Copy link
Contributor

A new trace$ printing option may be possible. In the meantime, the following from :DOC trace$ may be helpful, to overcome ACL2's hijacking of trace and untrace.

If you need the original trace utility supplied for those Lisps,
quit the ACL2 loop with :q and call old-trace and old-untrace in raw
Lisp where you would otherwise call trace and untrace.

@MattKaufmann
Copy link
Contributor

@bendyarm In principle, using option :evisc-tuple :print does what you want; see :DOC trace$. It doesn't quite do what I'd expect though; I plan to fix that tomorrow.

MattKaufmann pushed a commit that referenced this issue Sep 21, 2022
…cking in defun-one-output.

Quoting a comment in (defxdoc note-8-6 ...), as this didn't seem
worth a proper release note:

; Fixed error when attempting to use #@ reader in a book being certified.

[Low-level implementation note.  The addition of error-checking to
defun-one-output is a technical change of no consequence to ACL2
users.  It's a consequence of my encountering a weird error in my
initial modification of trace-hide-world-and-state.]

Closes GitHub Issue #1432.
@MattKaufmann
Copy link
Contributor

@bendyarm I've improved trace$ option :evisc-tuple :print as per the following from :DOC note-8-6.

  The [trace$] option :evisc-tuple :print, which continues to use raw
  Lisp printing, has undergone the following improvements when
  printing entry and exit values.  Thanks to Eric McCarthy for a
  query that led to these improvements.

    * Values are now pretty-printed.
    * Array values are no longer displayed as [stobj]s.  (This includes
      stobjs themselves, since they are arrays.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants