问题
I'm trying to make sense of an error message, so that I might consider
fixing it. What's the right way to fix the following error? Should I
go add :oslib
, :quicklisp
, and :quicklisp.osicat
to the include-books
inside books/oslib/rmtree.lisp
? Is my include-book form wrong?
ACL2 !>(include-book "oslib/top" :dir :system :ttags (oslib quicklisp
quicklisp.osicat))
ACL2 Error in ( INCLUDE-BOOK "oslib/top" ...): The ttag :OSLIB associated
with file /<elided>/acl2/books/oslib/lisptype.lisp
is not among the set of ttags permitted in the current context, specified
as follows:
((:OSLIB "/<elided>/acl2/books/oslib/rmtree.lisp")
:QUICKLISP :QUICKLISP.OSICAT).
See :DOC defttag.
Summary
Form: ( INCLUDE-BOOK "oslib/top" ...)
Rules: NIL
Time: 0.47 seconds (prove: 0.00, print: 0.00, other: 0.47)
ACL2 Error in ( INCLUDE-BOOK "oslib/top" ...): See :DOC failure.
******** FAILED ********
ACL2 !>
回答1:
I would strongly recommend always using :ttags :all
on include-books, or just omitting the :ttags
argument entirely and suppressing the warnings. For instance, you could do:
(include-book "oslib/top" :dir :system :ttags :all)
This may seem like overkill -- why would you want to permit any trust tags from this book when you know it only needs oslib
, quicklisp
, and quicklisp.osicat
? Isn't it safer to only permit the few trust tags that you know you need, instead?
The problem is: even though the oslib/top book only requires these three ttags today, it may be that, in the future, someone will extend it in some way that will require additional trust tags. If and when this happens, you'll have to update every place that you have included it with this restricted set of trust tags. Multiply this by many books and you've got a big mess on your hands.
At any rate, if you really want to limit the use of trust-tags, it's much better to put these restrictions in the cert-flags
sections of your cert.acl2
files, so that you can control them at the granularity of directories instead of individual includes. See custom certify-book commands for details.
回答2:
To allow books to include ttags themselves, place the ttags in parens, like so:
(include-book "oslib/top" :dir :system :ttags ((oslib) (quicklisp)
(quicklisp.osicat)))
来源:https://stackoverflow.com/questions/26004313/understanding-a-ttags-error