-
Notifications
You must be signed in to change notification settings - Fork 96
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
Fixtype of lists of strings fails #654
Comments
The following form works (somewhat to my surprise): I'm not sure how well fty's type-defining events deal with functions that
On Thu, Oct 13, 2016 at 11:47 AM, Alessandro Coglio <
|
Thanks for the quick reply. It seems that the success of the form depends on the included books. The following fails for me: The following succeeds: The following succeeds as well: |
Just reflecting upon what you already know: As you've ascertained, the form On Fri, Oct 14, 2016 at 8:37 AM, Alessandro Coglio <notifications@github.com
|
Right, but even with :true-listp t, I get a failure if I include fty/top, while it works if I include only fty/deftypes and fty/basetypes. Perhaps we should look into making fty/top and the form (with :true-listp t) compatible with each other? When using FTY, it seems reasonable to include fty/top as a starting point. |
On Fri, Oct 14, 2016 at 9:59 AM, Alessandro Coglio <notifications@github.com
|
I gave your suggested fix a shot (it's in my acl2 clone, branch string-list-fix), but when I try building I get an error that might have to do with circular dependencies. For instance, doing make clean (just to be sure) and then cert.pl std/strings/eqv.lisp hangs at the following line (after building a number of other certificates): Making /Users/AC/Kestrel/ACL2/acl2/books/std/strings/../../xdoc/str.acl2x on 19-Oct-2016 17:49:51 I'm not sure what an .acl2x file is, and I would have to study the STD and FTY code a bit to understand where the error arises and how to break the circular dependency (if that's the problem). |
xdoc/str is an awful sort of book (other examples being std/strings/defs-program and std/strings/pretty-program) which exists to provide program mode definitions of various useful functions without depending on the full dependencies of the books where they're defined. These books get certified in two passes, the first of which produces an .acl2x file instead of a regular certificate. The acl2x file is read as part of the second pass and tells ACL2 how make-events expand, so basically it determines the actual contents of the book. This is sound because in the second pass ACL2 checks these events just as it would any others, and these will be the events that get loaded when the certified book is included. So it's basically OK to do whatever we want in the first pass, including modifying the expansions that are written to the acl2x file. So in xdoc/str, in the first pass we include a bunch of (possibly uncertified) books from std/strings and, in program mode, redundantly replicate their definitions. We arrange (using the acl2x-replace utility) that the acl2x file doesn't contain those include-books, just the program mode definitions. So probably what's happening is that you've added a dependency in std/strings/eqv on xdoc/str (presumably because some fty books depend on it). xdoc/str doesn't exactly have a dependency on std/strings/eqv, but it probably includes it uncertified in its first pass. So when you try and include it, it also tries to include the book you're certifying, which tries to include it again, which doesn't work out too well. This is a tricky problem and I'm not sure what to suggest. Basically, we want to use nice string functions to generate documentation for fty types, but we want to use fty to define some of those nice string functions (namely, string-list-fix). We could try to remove the dependency on xdoc/str from fty; not sure how many functions we're using from there. @jaredcdavis might want to weigh in or just read this and be amused. |
This page shows, at the very end, a form to create a fixing function for the existing STRING-LISTP predicate. However, the following fails (starting in a fresh ACL2 session):
(include-book "centaur/fty/top" :dir :system)
(fty::deflist string-list :pred string-listp :elt-type stringp)
(I'm assigning this issue based on the author indicated in centaur/fty/deftypes.lisp.)
The text was updated successfully, but these errors were encountered: