简体   繁体   中英

Regular Expression Simplification Issue

I'm trying to understand the equivalence between regular expressions α and β defined below, but I'm losing my mind over conflicting information.

a+b:   a or b
ab:    concatenation of a and b
$:     empty string

α = (1*+0)+(1*+0) (0+1)*($+0+1)

β = (1*+0) (0+1)*($+0+1)

https://ivanzuzak.info/noam/webapps/regex_simplifier/ says, that α is equivalent to β .

My school however teaches that concatenation has stronger binding than union, meaning that:

11*+0 =/= 1(1*+0)

Which would mean that my α looks like this with parentheses:

α = (1*+0) + ( (1*+0)(0+1)*($+0+1) )

and that

α =/= ( (1*+0) + (1*+0) ) (0+1)*($+0+1)


I hope it's clear what my problem is, I'd appreciate any kind of help. Thanks.

Usually, two regular expressions are considered equivalent when they match the same set of words.

How they match it is not relevant. Therefore it doesn't matter which of the operators has greater precedence.

Note the subtle difference between being equal (in written form) and being equivalent (having the same effect).

Alright, it turns out that I have misunderstood why b+b <=> b.

It's that L1∪L2 <=> L2, if L1 is subset of L2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM