[TRE-general] Repeat histories
Chris Kuklewicz
tre-general at list.mightyreason.com
Wed Feb 21 23:16:06 EET 2007
Rici Lake wrote:
>
> If I get really enthusiastic, I might even code that to see if
> it works :)
>
Thanks from bringing more C.S. knowledge into this. As a physicist I bring very
little formal C.S. to the table.
And Rici Lake wrote:
>> a bunch of handwaving
>
> I forgot to mention, although I suppose it's obvious:
:) "Proof by intimidation"
http://www.everything2.com/index.pl?node_id=961354&lastnode_id=0
>
> If we establish that a given sub-expression (R)* is
> right-matchable, then we do not need ordinals at all;
> we can get the Posix semantics by using the shortest-
> non-empty-match rule for the last capture.
I am unlikely to believe that: (right-matchable property) implies (the shortest
final iteration implies Posix semantics).
Let me see if I can construct a counter example...
R = "a|ab|b"
R* = "(a|ab|b)*"
L(R*) is "" or any sequence of a's and b's
Lm(R*) is also "" or any sequence of a's and b's.
Since Lm(R*) == L(R*) I claim R has the right-matchable property.
Match R* against text "ab" two different ways:
The longest first iteration, used by Lm(R*), is "ab" which is the correct Posix
answer.
The shortest non-empty final iteration is "b" which not the correct Posix answer.
Further comment: The longest-final-match and shortest-final-match often imply
perverse things about the previous sequence of matches.
--
Chris
More information about the TRE-general
mailing list