Is computing the cardinality of sum of regular expressions without kleene star closure is EXPTIME problem?
Note that sum of regular expressions is union of regular expressions. The alphabet of each regular expression is Σ={0,1}, and each regular expression in the sum is concatenation of 0, 1 and (0+1).
There is no kleene star closure, so the regular language of the sum of regular expressions is finite, and so the cardinality of this regular language is finite natural number, as defined in discrete mathematics, which is the number of words in this regular language.
There are two known naive algorithms to compute this, but their running time are both Θ(2n) exponential blow up.
One naive algorithm is recursion that computes:
Where:
Computing the intersection regular language of two regular languages should be easy, because the fact that each regular expression in the sum is just concatenation of 0, 1 and (0+1), so in parallel 0∩0=0, 1∩1=1, (0+1)∩(0+1)=(0+1), 0∩(0+1)=0, 1∩(0+1)=1 and if 0 is found in regexp A and 1 in regexp B at the same offset or 1 is found in regexp A and 0 in regexp B at the same offset then L(A)∩L(B)=∅, i.e. both the languages are disjoint.
But the naive recursive algorithm runs over complete binary tree, whose height is n and it has 2n nodes, thus the running time complexity of the naive recursive algorithm is Θ(2n).
Another naive algorithm is iteration that computes:
The general formula was taken from this proof wiki webpage that doesn't show any proof for this formula.
But it seems that the algorithm iterates over all the different subsets of {R1, ... , Rn} and from the power set lemma it's known that {R1, ... , Rn} has 2n different subsets.
Thus the running time complexity of the naive iterative algorithm is also Θ(2n) exponential blow up as well as the naive recursive algorithm.
All known algorithms for this problem, for me, are exponential run time and thus it seems that this problem is EXPTIME, according to the definition of EXPTIME in computational complexity theory.
Maybe all best algorithms for this problem are Ω(2n) exponential run time, and there is no polynomial run time algorithm to compute this, but this requires a proof.
Just finding 2 exponential run time algorithms is not a proof.
But I don't know if this question is open or not in computer science.
I tried to google the answer for hours, but I didn't find it yet.
Is this open question in computer science?
If not, then what is the proof that this problem is in P or not in P, i.e. does exist polynomial algorithm to solve this problem?
EDIT:
Algorithm's input is sum of regular expressions, where each regular expression is concatenation of 0, 1 and (0+1).
The number of concatenations per regular expression in the sum is fixed.
All words in the regular language of the sum of regular expressions are in the same length.
The only operators in the regular expression are sum and concatenation.
EDIT:
"The number of concatenations per regular expresion in the sum is fixed."
infers the length of each word in the regular language.
If there is 1 concatenation, then the length of each word is 2, if there are 2 concatenations then the length of each word 3, if there are k concatenations then the length of each word is k+1.
For example in the regular expression: 0(0+1)1, there are 2 concatenations:
first concatenation is between 0 and (0+1) and second concatenation is between (0+1) and 1, so in total there are 2 concatenations and thus the length of each word in the regular language is 3, because all the other regular expressions in the sum have the same number of concatenations, in this example they all have 2 concatenations.
There are 2 words in the example regular expression above: 001 and 011, and their length is 3, and you can see that number of concatenations between each two nearby characters is 2.
Either number of concatenations per regular expression or the length of each word in the regular language is given in the algorithm's input. This is not necessary that both are given, because if one of them is given, then this is possible to infer the other due to their relationship.