On Mon, Mar 1, 2010 at 12:47 PM, Edward K. Ream <[email protected]> wrote:
> On Fri, Feb 26, 2010 at 4:06 PM, Edward K. Ream <[email protected]> wrote:
>> I am fairly confident that I can write a suite of scripts that will
>> fix all major problems discussed in pep8 in about a week.
>
> I'm pretty much on schedule, though I don't feel much urgency about
> the one-week deadline.
>
> Last night I had a cute Aha.  Although pep8.py won't use parse trees
> (ast's) while altering text, comparing the "before" and "after" ast
> trees is a simple, very strong test that pep8 has not altered the
> meaning of the program.  This Aha is important for all kinds of
> "beautifying" transformations.
>
> One complication: name changes can alter the semantics of certain
> nodes of the ast trees, but never the shape of ast trees.  Thus, we
> can define the notion of "isomorphic" ast's, that are the same except
> for the names of certain nodes. Two ast's are isomorphic if and only
> if:
>
> A. There is a bijection from all names in one tree to all the names in
> the other tree.  This mapping prohibits mapping two names in one tree
> to a single name in the other tree.
>
> B.  All nodes not pertaining to names are identical.
>
> C. All name-related nodes are the same modulo the bijection.

Cool, sort of a 'signature' for a chunk of code which uniquely identifies
the functionality underneath the naming. Sounds useful.

might be addressed by http://bicyclerepair.sourceforge.net/

Thanks,
Kent

>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups 
> "leo-editor" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/leo-editor?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to