In computer science, more precisely in automata theory, a rational set of a monoid is an element of the minimal class of subsets of this monoid which contains all finite subsets and is closed under union, product and Kleene star. Rational sets are useful in automata theory, formal languages and algebra. In computer science, more precisely in automata theory, a rational set of a monoid is an element of the minimal class of subsets of this monoid which contains all finite subsets and is closed under union, product and Kleene star. Rational sets are useful in automata theory, formal languages and algebra. A rational set generalizes the notion of rational (regular) language (understood as defined by regular expressions) to monoids that are not necessarily free. Let ( N , ⋅ ) {displaystyle (N,cdot )} be a monoid with identity element e {displaystyle e} . The set R A T ( N ) {displaystyle mathrm {RAT} (N)} of rational subsets of N {displaystyle N} is the smallest set that contains every finite set and is closed under This means that any rational subset of N {displaystyle N} can be obtained by taking a finite number of finite subsets of N {displaystyle N} and applying the union, product and Kleene star operations a finite number of times.