[plt-dev] regexp equality
FWIW, I am testing the Scheme based zo-decompiler, so I just need
representation equality as produced by the reader.
On Fri, Feb 19, 2010 at 11:39 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Jay McCarthy wrote at 02/19/2010 01:20 PM:
>>
>> How do I test regexps for equality?
>>
>
> Comparing the write format has limited usefulness:
>
> (equal? (format "~S" #rx"aaa") (format "~S" #rx"aaa")) ==> #t
> (equal? (format "~S" #rx"aaa") (format "~S" #rx"bbb")) ==> #f
> (equal? (format "~S" #rx"[a]aa") (format "~S" #rx"aaa")) ==> #f
>
> I don't know that comparing whatever compiled automata or abstract
> representations would be good enough to prove whether or not two regexps are
> equivalent.
>
> --
> http://www.neilvandyke.org/
>
--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay
"The glory of God is Intelligence" - D&C 93