Testing the intersection of two regular languages

I want to check if two languages ​​have a common string. Both of these languages ​​belong to a subset of the regular languages ​​described below, and I only need to know if a string exists in both languages, and not create an example string.

The language is indicated by a globular type string

/foo/**/bar/*.baz

where **matches 0 or more characters, and *matches zero or more characters that are not /, and all other characters are literal.

Any ideas?

thank you microphone

EDIT:

I implemented something that seems to work well, but still need to check the correctness. You can see source and unit tests.

+5
2

FA A B " FA" AnB. AnB , , , .

AnB , , , . , , :

  • AnB A B . AnB (a, b), A A, B B.
  • (a, b) ->r (c, d) ( (a, b) (c, d) r) , f a ->r c A, b ->r d B.
  • (a, b) AnB iff A B A B .
  • (a, b) AnB, FA.

, , !

+9

, ( ), . :

  • NFA A B
  • NFA, C, A B.
  • 0 C , C (, , ).

, , , , .

+2

All Articles