Hi, David --
Please see comments and questions below. Ultimately, it might be most
efficient for you if you don't bother to answer my questions (below)
now, but rather, to use the new capability awhile and then get back to
me (perhaps directly, outside the acl2-books list, though I'm fine
with including anyone who'd like to be in such a thread).
> Hi Matt,
>
> Very cool! This should help a lot when we have to compare versions of
> very large circuits that are fundamentally the same.
Excellent.
> Now for your next trick, can you make it dynamically print up to
> n-levels deeper, when it determines that there's a shared term within
> those n-levels? That'd make compare-windows even more useful! I
I don't understand the request. Suppose for example that we evaluate
the following three forms.
(defun make-tree (leaf n)
(declare (type (integer 0 *) n))
(if (zp n)
leaf
(let ((x (make-tree leaf (1- n))))
(cons x x))))
(set-iprint t :share t)
(set-evisc-tuple (evisc-tuple 2 2 nil nil) :sites :ld)
Currently we then have:
ACL2 !>(cons (list (make-tree 'a 10)) '(b c d e f))
((#@1#) B . #@2#)
ACL2 !>(cons (list (make-tree 'a 10)) '(b c d e f))
((#@1#) B . #@2#)
ACL2 !>
Are you saying that you'd like the second #@1 and #@2 replaced to show
more structure, for example? If so, then I don't see why that would
be helpful. If not, it might be best to give me your own concrete
example.
> expect that to be a different type of solution than what's currently
> implemented and probably not worth the time (unless something quick
> and clever comes to mind).
You might be right about "not worth the time". It took me
surprisingly long (almost 16 hours) to add the :share keyword
(including documentation). Perhaps it would be best for you to let me
know when you run into cases with the existing tool where you feel
additional features would be useful to you.
> Though, if it were only a factor of 10 or
> 100 slower, I can imagine cases where I'd turn it on and use it.
Showing me such a case might help me to understand better what you
have in mind.
> As one potential solution,. I can imagine that preprocessing a term
> with an equals consequence to generate a tree that records matches
> could be pretty cool.
Sorry, I didn't understand the three lines just above.
> I can't think of a useful application for this "next trick" outside of
> SVex recomposition proofs, so that's even more reason not to worry
> about it for now. Maybe during proofs with gag-mode disabled, users
> would prefer to hide parts (via iprinting) that aren't changing. It's
> kind of like the dynamic diff'ing and matching I did over a decade
> ago..., but we don't run ACL2 without gag mode that often these
> days....
I continue to believe that in almost all cases, watching an ACL2 proof
evolve is much more of a distraction than it is helpful. In those few
cases where focusing on checkpoints isn't the optimal output, I think
that almost all of those would be cases where large case splits might
be identified by looking at "Splitter note" output.
> Thanks,
> David
Thanks for being a possible early adopter, and even more, thanks for
the original idea!
What I imagined as a typical use of :share t is the following. One
tries a proof -- perhaps, as you mentioned, some SVex recomposition
proof -- and it fails. So you prove some lemmas or change the hints,
and then try again. You might want to know if the lemmas or hints
were effective. By comparing checkpoints in the two proof attempts,
you could see quickly whether your lemmas or hints had any effect.
-- Matt