POV-Ray : Newsgroups : povray.off-topic : An even more interesting problem : Re: An even more interesting problem Server Time
28 Jul 2024 18:24:45 EDT (-0400)
  Re: An even more interesting problem  
From: Kevin Wampler
Date: 24 May 2013 14:44:06
Message: <519fb4f6@news.povray.org>
On 5/24/2013 11:20 AM, Orchid Win7 v1 wrote:
> Suppose I give you two arbitrary regular expressions. Are they equivalent?

It depends on what you specifically mean by "regular expression", but 
probably this problem is PSPACE-complete.  From what I can tell is 
generally solved by converting each regexp into a DFA and checking if 
they are isomorphic.

> Does there exist an algorithm to determine whether two regexes are
> equivalent? What complexity class does this algorithm live in? What does
> "equivalent" even mean in this context? What about if one expression
> matches a subset of the other? Or a superset? Or in general two
> partially-overlapping sets?

There exists a Perl library to do some related computations of this 
sort, although it will sometimes fail to detect an equivalence (but I 
think never detects a false equivalence).

http://search.cpan.org/~vbar/Regexp-Compare-0.17/lib/Regexp/Compare.pm


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.